Ability to specify PPPoE server local address

Submitted by -
Status: New Idea

When running a network with multiple PPPoE servers in it, you end up with a case where the 10.255.253.0 address is on multiple routers.

This can be a tad confusing to say the least. Having this address able to be configurable would solve this problem.

A quick grep in /opt/vyatta shows it is hardcoded in at least 3 places:

/opt/vyatta/etc/pppoe-server/ppp-ip-down:if [ "$IPLOCAL" != "10.255.253.0" ] ; then
/opt/vyatta/etc/pppoe-server/ppp-ip-up:if [ "$IPLOCAL" != "10.255.253.0" ] ; then
/opt/vyatta/share/perl5/Vyatta/PPPoEServerConfig.pm:    return ("-L 10.255.253.0 -R $start -N $num -F", undef);

 

Comments
by
on ‎12-20-2013 08:14 AM

Regarding the IPLOCAL checking of 10.255.253.0 to determine if we're a PPPoE server client or not, it seems like the correct alternative is to use the ipparam ($6) instead, which removes the need to have a fixed local ip.

This is already used in /etc/ppp/ip-pre-up.d/0006rename-pppoe-server to determine if it's pppoe-server or not:

if [ "$IFPREFIX" != "pppoe-server" ]; then
    # its not a pppoe
    exit 0;
fi

Seems like a trivial change really, new option in the config "set service pppoe-server localip 1.2.3.4" and just return that instead in PPPoEServerConfig.pm in place of 10.255.253.0 once the ip-up and up-down scripts are fixed to use $6 instead of checking the ip.

by
on ‎12-20-2013 09:41 AM

A quick strings of ubnt-users seems to reference the magic IP address as well. I can't seem to find the source (http://community.ubnt.com/t5/EdgeMAX/Source-of-ubnt-users/td-p/662009) of ubnt-users so I can't confirm what exactly it's doing with it but I suspect this will be a blocker for non-ubnt folks to implement this. There also appears to be references in ubnt-util.

My suggestion would be to check the interface name prefix instead looking for "pppoes".

by
on ‎08-13-2014 11:42 PM

For reference the files

/opt/vyatta/etc/pppoe-server/ppp-ip-up

/opt/vyatta/etc/pppoe-server/ppp-ip-down

are not used by the router during operation

 

the files used at runtime are

/etc/ppp/ip-up.d/pppoe-server-ip-up

/etc/ppp/ip-down.d/pppoe-server-ip-down

 

This had me tearing my hair out for a while when i tried to add a script to the bottom of each file to update the nat with redirect rules for each pppoe connection as they connected and disconnected (routing to an internal web server similar to captive portal)

by
on ‎08-14-2014 03:26 AM

In your case it's probably best to just add the script to the /config/scripts/ppp/ip-up.d/ directory. As long as you don't have to modify existing behaviour (which it sounds like you're not) adding a new script there is the supported way and will persist across firmware upgrades (other changes outside of /config generally are not persisted across firmware upgrades).