This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
technical:ppp-pppoe-basic [2023/09/26 22:10] admin [Our setup] |
technical:ppp-pppoe-basic [2023/10/15 06:56] (current) admin [Connecting a Client] |
||
|---|---|---|---|
| Line 4: | Line 4: | ||
| * It will consist of the following: | * It will consist of the following: | ||
| * A PPPoE server using RADIUS for AAA. | * A PPPoE server using RADIUS for AAA. | ||
| - | * Host machine act as a router. | + | * The host machine |
| * What will **not be** configured here: | * What will **not be** configured here: | ||
| * COA / Disconnection of users. | * COA / Disconnection of users. | ||
| - | ===== Our setup ===== | + | ===== Our Setup ===== |
| * We will use a standard Ubuntu 22.04 VM which is running in Virtual-box with **one** network interface. | * We will use a standard Ubuntu 22.04 VM which is running in Virtual-box with **one** network interface. | ||
| < | < | ||
| Line 18: | Line 18: | ||
| ===== Config file ===== | ===== Config file ===== | ||
| - | * Accel-ppp has a single configuration file with various sections. | + | * Accel-ppp has a single configuration file with various sections. |
| - | * Below is our slimmed down config | + | * Below is our slimmed down **accel-ppp.conf** |
| - | <code> | + | * We removed |
| + | <file bash accel-ppp.conf> | ||
| [modules] | [modules] | ||
| log_file | log_file | ||
| Line 38: | Line 39: | ||
| mtu=1400 | mtu=1400 | ||
| mru=1400 | mru=1400 | ||
| - | # | ||
| - | #pcomp=deny | ||
| - | #ccp=0 | ||
| - | # | ||
| ipv4=require | ipv4=require | ||
| ipv6=deny | ipv6=deny | ||
| Line 48: | Line 45: | ||
| ipv6-accept-peer-intf-id=1 | ipv6-accept-peer-intf-id=1 | ||
| lcp-echo-interval=20 | lcp-echo-interval=20 | ||
| - | # | ||
| lcp-echo-timeout=120 | lcp-echo-timeout=120 | ||
| unit-cache=1 | unit-cache=1 | ||
| - | # | ||
| [pppoe] | [pppoe] | ||
| verbose=1 | verbose=1 | ||
| - | # | ||
| - | # | ||
| - | # | ||
| - | # | ||
| called-sid=mac | called-sid=mac | ||
| - | #tr101=1 | ||
| - | # | ||
| - | # | ||
| - | # | ||
| - | # | ||
| - | # | ||
| - | # | ||
| - | # | ||
| - | # | ||
| - | # | ||
| - | # | ||
| interface=enp0s3 | interface=enp0s3 | ||
| Line 86: | Line 66: | ||
| dae-server=127.0.0.1: | dae-server=127.0.0.1: | ||
| verbose=1 | verbose=1 | ||
| - | #timeout=3 | ||
| - | #max-try=3 | ||
| - | # | ||
| - | # | ||
| - | # | ||
| - | #acct-on=0 | ||
| - | acct-interim-interval=120 | ||
| - | # | ||
| - | # | ||
| - | # | ||
| - | # | ||
| - | # | ||
| [client-ip-range] | [client-ip-range] | ||
| Line 105: | Line 73: | ||
| [ip-pool] | [ip-pool] | ||
| gw-ip-address=192.168.0.1 | gw-ip-address=192.168.0.1 | ||
| - | # | ||
| - | ## | ||
| attr=Framed-Pool | attr=Framed-Pool | ||
| 192.168.0.2-255 | 192.168.0.2-255 | ||
| Line 119: | Line 85: | ||
| log-emerg=/ | log-emerg=/ | ||
| log-fail-file=/ | log-fail-file=/ | ||
| - | # | ||
| - | # | ||
| - | # | ||
| copy=1 | copy=1 | ||
| - | #color=1 | ||
| - | # | ||
| - | # | ||
| - | # | ||
| level=3 | level=3 | ||
| Line 132: | Line 91: | ||
| vendor=Mikrotik | vendor=Mikrotik | ||
| attr=Mikrotik-Rate-Limit | attr=Mikrotik-Rate-Limit | ||
| - | # | ||
| - | # | ||
| - | # | ||
| - | # | ||
| - | #latency=50 | ||
| - | #mpu=0 | ||
| - | #mtu=0 | ||
| - | #r2q=10 | ||
| - | # | ||
| - | # | ||
| - | # | ||
| - | #ifb=ifb0 | ||
| up-limiter=police | up-limiter=police | ||
| down-limiter=tbf | down-limiter=tbf | ||
| - | # | ||
| - | # | ||
| - | # | ||
| - | #fwmark=1 | ||
| - | # | ||
| - | # | ||
| - | # | ||
| verbose=1 | verbose=1 | ||
| Line 159: | Line 99: | ||
| telnet=127.0.0.1: | telnet=127.0.0.1: | ||
| tcp=127.0.0.1: | tcp=127.0.0.1: | ||
| - | # | ||
| - | # | ||
| - | </code> | + | </file> |
| - | * Some of the sections | + | * Next we can look at some of these sections |
| ==== Modules ==== | ==== Modules ==== | ||
| Line 169: | Line 107: | ||
| * The following modules are crucial in our setup: | * The following modules are crucial in our setup: | ||
| * **pppoe** This module is used to create the PPPoE server. | * **pppoe** This module is used to create the PPPoE server. | ||
| - | * **auth_pap** We will use PAP authentication to keep it simple. There are however also support for other authentication protocols like CHAP and MSCHAP. | + | * **auth_pap** We will use PAP authentication to keep it simple. There are however also support for other authentication protocols like CHAP and MSCHAP. |
| * **radius** The PPP part of PPPoE will communicate with RADIUS in order to try and authenticate a user. The reply from RADIUS can be used to determine / set items like the IP Pool from which the client needs to get an IP Address, and the bandwidth allocated to the connection. | * **radius** The PPP part of PPPoE will communicate with RADIUS in order to try and authenticate a user. The reply from RADIUS can be used to determine / set items like the IP Pool from which the client needs to get an IP Address, and the bandwidth allocated to the connection. | ||
| * **shaper** In order to throttle / shape the bandwidth of the connection the shaper module is used. It can get a per user instruction from RADIUS or can apply a global defined default value for all the other connections. The shaper also includes support for more advanced features like bursting. | * **shaper** In order to throttle / shape the bandwidth of the connection the shaper module is used. It can get a per user instruction from RADIUS or can apply a global defined default value for all the other connections. The shaper also includes support for more advanced features like bursting. | ||
| Line 180: | Line 118: | ||
| ==== radius ==== | ==== radius ==== | ||
| - | * We comment the following out. If we don' | + | * We comment the following out. If we don't, Accel-ppp will not start up when the values specified does not match the IP setup of the machine. |
| < | < | ||
| # | # | ||
| Line 193: | Line 131: | ||
| ==== shaper ==== | ==== shaper ==== | ||
| - | * We use machine as a ** drop-in replacement for a Mikrotik router**. We then have to specify to the shaper to look for Mikrotik reply attributes and apply them. | + | * We use this machine as a ** drop-in replacement for a Mikrotik router**. |
| + | * We have to inform | ||
| < | < | ||
| vendor=Mikrotik | vendor=Mikrotik | ||
| Line 249: | Line 188: | ||
| * There are a couple of log files which you can **tail -f** in order to help troubleshoot if things are not working as intented. | * There are a couple of log files which you can **tail -f** in order to help troubleshoot if things are not working as intented. | ||
| < | < | ||
| - | system@osboxes: | + | cd / |
| + | ls -l | ||
| total 2576 | total 2576 | ||
| -rw------- 1 root root 1781664 Sep 26 19:05 accel-ppp.log | -rw------- 1 root root 1781664 Sep 26 19:05 accel-ppp.log | ||
| Line 368: | Line 308: | ||
| 261 36732 MASQUERADE | 261 36732 MASQUERADE | ||
| </ | </ | ||
| + | |||
| + | ===== Connecting a Client ===== | ||
| + | * Everything is now set up and ready for the first client to connect. | ||
| + | * We will use OpenWrt with the following /// | ||
| + | * The PPPoE username is '' | ||
| + | <code bash> | ||
| + | |||
| + | config interface ' | ||
| + | option device ' | ||
| + | option proto ' | ||
| + | option ipaddr ' | ||
| + | option netmask ' | ||
| + | |||
| + | config device | ||
| + | option name ' | ||
| + | option type ' | ||
| + | list ports ' | ||
| + | |||
| + | config interface ' | ||
| + | option device ' | ||
| + | option proto ' | ||
| + | option username ' | ||
| + | option password ' | ||
| + | </ | ||
| + | * This device has to be connected to the **same network** (broadcast domain) where our Accel-ppp server is running in order for the network packets to reach the PPPoE server. | ||
| + | |||
| + | ===== Checking The Log File ===== | ||
| + | * The Accel-ppp log file will give us more feedback when a client connects. | ||
| + | * Run the following command | ||
| + | < | ||
| + | sudo tail -f / | ||
| + | </ | ||
| + | * Here is the output we got | ||
| + | < | ||
| + | [2023-10-15 02: | ||
| + | [2023-10-15 02: | ||
| + | [2023-10-15 02: | ||
| + | [2023-10-15 02: | ||
| + | [2023-10-15 02: | ||
| + | [2023-10-15 02: | ||
| + | [2023-10-15 02: | ||
| + | |||
| + | </ | ||
| + | |||
| + | ===== Using accel-cmd ===== | ||
| + | * You can get more information on the current running instance of Accel-ppp by using the accel-cmd program. | ||
| + | < | ||
| + | accel-cmd show stat | ||
| + | </ | ||
| + | * Results in the following in our case | ||
| + | < | ||
| + | accel-cmd show stat | ||
| + | uptime: 0.08:17:34 | ||
| + | cpu: 0% | ||
| + | mem(rss/ | ||
| + | core: | ||
| + | mempool_allocated: | ||
| + | mempool_available: | ||
| + | thread_count: | ||
| + | thread_active: | ||
| + | context_count: | ||
| + | context_sleeping: | ||
| + | context_pending: | ||
| + | md_handler_count: | ||
| + | md_handler_pending: | ||
| + | timer_count: | ||
| + | timer_pending: | ||
| + | sessions: | ||
| + | starting: 0 | ||
| + | active: 1 | ||
| + | finishing: 0 | ||
| + | pppoe: | ||
| + | starting: 0 | ||
| + | active: 1 | ||
| + | delayed PADO: 0 | ||
| + | recv PADI: 4 | ||
| + | drop PADI: 0 | ||
| + | sent PADO: 4 | ||
| + | recv PADR(dup): 4(0) | ||
| + | sent PADS: 4 | ||
| + | filtered: 0 | ||
| + | radius(1, 164.160.89.129): | ||
| + | state: active | ||
| + | fail count: 0 | ||
| + | request count: 0 | ||
| + | queue length: 0 | ||
| + | auth sent: 4 | ||
| + | auth lost(total/ | ||
| + | auth avg query time(5m/ | ||
| + | acct sent: 7 | ||
| + | acct lost(total/ | ||
| + | acct avg query time(5m/ | ||
| + | interim sent: 254 | ||
| + | interim lost(total/ | ||
| + | interim avg query time(5m/ | ||
| + | |||
| + | </ | ||
| + | * To see the current active sessions | ||
| + | < | ||
| + | accel-cmd show sessions | ||
| + | </ | ||
| + | * Result in the following: | ||
| + | < | ||
| + | | ||
| + | --------+----------+-------------------+-------------+------------+-------+------+--------+---------- | ||
| + | | ||
| + | |||
| + | </ | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||