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