Community discussions

 
Wolfraider
newbie
Topic Author
Posts: 49
Joined: Wed Jul 15, 2015 8:06 pm

ppp and BGP script

Fri Jan 18, 2019 10:56 pm

I am trying to create a script that when a client connects through PPPoE, their remote address is added to BGP networks. I created a ppp profile and added the following scripts to it but they never seem to get called.

On Up
/routing bgp network add network=$remote-address/32 synchronize=no

On Down
routing bgp network remove [:find where network=$remote-address/32]

Export of config sanatized
/ip pool
add name="PPPoE Pool" ranges=192.168.0.20-192.168.0.254
/ppp profile
add dns-server=8.8.8.8,8.8.4.4 local-address=192.168.0.1 name=profile1 on-down="local remoteAddr \$\"remote-address\"\r\
    \n/routing bgp network remove [:find where network=\$remoteAddr/32]\r\
    \n" on-up="/routing bgp network add network=\$remote-address/32 synchronize=no\r\
    \n" remote-address="PPPoE Pool" session-timeout=1d
/interface pppoe-server server
add default-profile=profile1 disabled=no interface=ether1 one-session-per-host=yes service-name=PPPoE
 
User avatar
sebastia
Forum Guru
Forum Guru
Posts: 1777
Joined: Tue Oct 12, 2010 3:23 am
Location: Antwerp, BE

Re: ppp and BGP script

Fri Jan 18, 2019 11:10 pm

Be careful with that, see slide 16+ https://mum.mikrotik.com/presentations/ ... 948376.pdf
 
Wolfraider
newbie
Topic Author
Posts: 49
Joined: Wed Jul 15, 2015 8:06 pm

Re: ppp and BGP script

Sat Jan 19, 2019 12:13 am

Thanks for that link. That is something we are watching. We will have rough 20 PPPoE connections max per edge router. With over 100 edge routers, this is why we dont want to dedicate a subnet per site. Instead we want to use the /32. It would be nice if the Mikrotiks had PPPoE Relay like the Ubiquiti CPEs. We would then bring it back to a central router. We have it designed as a client can plug into our network and pull a NATed address or pay a couple dollars extra for a public static served through PPPoE. This is all automated through our billing software.
 
User avatar
sebastia
Forum Guru
Forum Guru
Posts: 1777
Joined: Tue Oct 12, 2010 3:23 am
Location: Antwerp, BE

Re: ppp and BGP script

Sat Jan 19, 2019 12:20 am

Wouldn't using a /27 be a compromise?

Who is online

Users browsing this forum: Baidu [Spider] and 2 guests