vimagick / dockerfiles

:whale: A curated list of delicious docker recipes 🇺🇦🇮🇱 (Let's Fight Against Dictatorship)
https://hub.docker.com/u/vimagick/
3.13k stars 786 forks source link

Freeradius for VPN #33

Open set321go opened 7 years ago

set321go commented 7 years ago

Hi there,

I'm trying to setup freeradius as the authentication server for my router but it's not working.

I customized your docker image to replace the DB host and password I've also customized your docker-compose to put freeradius into its own network

version: '2'

services:
  freeradius:
    image: vimagick/freeradius
    ports:
      - "1812:1812/udp"
      - "1813:1813/udp"
    restart: always
    networks:
     freeradius:
       ipv4_address: 172.30.0.100

  mysql:
    image: mysql
    volumes:
      - /var/freeradius/mysql:/docker-entrypoint-initdb.d
    environment:
      - MYSQL_ROOT_PASSWORD=root
    restart: always
    networks:
     freeradius:
       ipv4_address: 172.30.0.101

networks:
  freeradius:
    driver: bridge
    ipam:
      config:
      - subnet: 172.30.0.0/24

I ran through the checks for the DB and ensured my data matches. When I try and connect from a client using the connection info i see this on the radius server:

freeradius_1  | Fri Dec 16 18:39:12 2016 : Info: rlm_sql (sql): Opening additional connection (8), 1 of 32 pending slots used
freeradius_1  | Fri Dec 16 18:39:12 2016 : Info: rlm_sql (sql): Need 2 more connections to reach 10 spares

And on the router logs i get

Dec 16 18:49:45 ubnt pptpd[28570]: CTRL: CTRL read failed
Dec 16 18:49:45 ubnt pptpd[28570]: CTRL: couldn't read packet header (exit)
Dec 16 18:49:45 ubnt pptpd[28570]: CTRL: EOF or bad error reading ctrl packet length.
Dec 16 18:49:45 ubnt pppd[28571]: Connection terminated: no multilink.
Dec 16 18:49:45 ubnt pppd[28571]: Peer user failed CHAP authentication
Dec 16 18:49:45 ubnt pppd[28571]: rc_check_reply: received invalid reply digest from RADIUS server
Dec 16 18:49:44 ubnt pppd[28571]: Connect: ppp0 <--> /dev/pts/0

As you might have noticed i'm pretty clueless when it comes to radius!!

vimagick commented 7 years ago

Radius is a complex software. I spent some time on it several months ago. I still cannot get it right. I'll study it when I have time.