dfskoll / rp-pppoe

Public repository for RP-PPPoE PPPoE client and server software
https://dianne.skoll.ca/projects/rp-pppoe/
47 stars 15 forks source link

Code to delegate IP assignment to pppd. #11

Closed jkroonza closed 2 years ago

jkroonza commented 2 years ago

This is done by using 0.0.0.0 for either myip or peerip to indicate delegate, as per pppd manpage, if either option is not given for

: then that's negotiated, so I'd recommend using -L at the very least, which will result in a.b.c.d: being passed to pppd, and then using something like radius to assign the remote IP address (or ippoold). In terms of usage, -L 0.0.0.0 will result in delegation of the local IP, and -R 0.0.0.0 of the remote IP. Signed-off-by: Jaco Kroon
jkroonza commented 2 years ago

The display IP obtained by using the following command is different from the actual custom IP, but the PPPoE dial-up client is the correct custom IP.

top -bn1 | grep 'pppd plugin pppoe.so' | grep -v 'grep' 3295 2324 root S 1048 0% 0% pppd plugin pppoe.so nic-br-lan rp_pppoe_sess 1184:80:76:93:b4:36:c2 rp_pppoe_service service-name1 file /etc/ppp/pppoe-server-options 10.0.0.1:10.67.20.160 nodetach noaccomp nopcomp default-asyncmap unit 1183 mru 1492 mtu 1492

Architecture Intel(R) Core(TM) i3-7100U CPU @ 2.40GHz Firmware Version OpenWrt 19.07-SNAPSHOT r11538-b086b0dd47 / LuCI openwrt-19.07 branch git-22.132.25288-61ea266 Kernel Version 4.14.275

Sun May 15 06:03:41 2022 daemon.info pppoe-server[2324]: Session 1253 closed for client 80:76:93:b4:36:c2 (10.67.20.229) on br-lan Sun May 15 06:03:46 2022 daemon.info pppoe-server[3295]: Session 1184 created for client 80:76:93:b4:36:c2 (10.67.20.160) on br-lan using Service-Name 'service-name1' Sun May 15 06:03:46 2022 daemon.info pppd[3295]: Plugin pppoe.so loaded. Sun May 15 06:03:46 2022 daemon.info pppd[3295]: PPPoE plugin from pppd 2.4.9 Sun May 15 06:03:46 2022 daemon.notice pppd[3295]: pppd 2.4.9 started by root, uid 0 Sun May 15 06:03:46 2022 daemon.warn pppd[3295]: Connected to 80:76:93:b4:36:c2 via interface br-lan Sun May 15 06:03:46 2022 daemon.info pppd[3295]: Using interface ppp1183 Sun May 15 06:03:46 2022 daemon.notice pppd[3295]: Connect: ppp1183 <--> br-lan Sun May 15 06:03:48 2022 daemon.notice pppd[3295]: peer from calling number 80:76:93:B4:36:C2 authorized Sun May 15 06:03:48 2022 daemon.notice pppd[3295]: local IP address 10.0.0.1 Sun May 15 06:03:48 2022 daemon.notice pppd[3295]: remote IP address 192.168.9.2

Relevance to the code being proposed here? Does it work correctly without this patch?

openwrtdiy commented 2 years ago

Feel sorry! The question I raised may not be related to this patch! I delete the previous feedback, it works fine with and without this patch! My current compiled firmware has your patch integrated!

dfskoll commented 2 years ago

Thanks! Looks good, and I have merged.