Community discussions

 
2dfx
just joined
Topic Author
Posts: 22
Joined: Tue Mar 05, 2013 6:30 pm

Route bug with PPP-DOWN script

Wed Dec 27, 2017 12:41 pm

Hi!

I have trouble with PPP-Down script.
I want to use PPP-UP and PPP-Down scripts for add route to additional routing table.
In PPP-DOWN I remove only one route, but I see bug in route list. In log – route removed, but I see it in route list. If I try to delete ghost route - OSPF instance go to restart.
Software 6.41; 6.40.5; 6.40.1
PPP-UP script:
:local localAddr $"local-address"
:local remoteAddr $"remote-address"
:local interfaceName [/interface get $interface name]
:log warning "$user  connected: was given $remoteAddr IP (GW $localAddr) and assigned to $interfaceName interface"; /ip route add dst-address=$remoteAddr routing-mark=OSPF pref-src=$localAddr gateway=$interfaceName
PPP-Down script:
:local localAddr $"local-address"; \
:local remoteAddr $"remote-address"; \
:local interfaceName [/interface get $interface name]; \
:local remoteAddrMask "$remoteAddr/32"; \
:log warning "$user  Disconnected: IP $remoteAddrMask (GW $localAddr) interface $interfaceName ($"interface")"; /ip route remove [find dst-address=$remoteAddrMask ];
Video https://youtu.be/2vreFioVmIg

How to repeat:
Remove def.conf
On Mik2 router create SSTP-CERT certificate
Use cfg from attachement
Wire scheme Mik1(eth1) <--> (eth1)Mik2(eth2) <--> (eth1)Mik3
lan_scheme.jpg
After connect Mik3 by SSTP – on Mik2 kill sstp connection 2 or more times.
On Mik2, after disconnects, in terminal you can see:
01:36:07 echo: sstp,ppp,info <sstp-test>: terminating...
01:36:07 echo: sstp,ppp,info,account test logged out, 832 9273 9302 123 124
01:36:07 echo: sstp,ppp,info <sstp-test>: disconnected
01:36:07 echo: route,ospf,info OSPFv2 neighbor 10.0.0.1: state change from Full to Down
01:36:07 echo: system,info route removed
01:36:07 echo: sstp,ppp,info,account test logged in, 10.50.0.20
01:36:07 echo: sstp,ppp,info <sstp-test>: authenticated
01:36:07 echo: sstp,ppp,info <sstp-test>: connected
01:36:07 echo: system,info route added

Ghost route in this screenshot:
ghost.jpg
After try to delete this – nothing changed.
Close window with route list and open again – all OSPF routes deleted, this additional route deleted too.
OSPF.jpg
After few second – OSPF routes come back.

Some times I have more stranges in route list
some-bug.jpg
You do not have the required permissions to view the files attached to this post.
 
2dfx
just joined
Topic Author
Posts: 22
Joined: Tue Mar 05, 2013 6:30 pm

Re: Route bug with PPP-DOWN script  [SOLVED]

Sat Dec 30, 2017 1:59 pm

I was able to solve it:
PPP-UP script:
:local localAddr $"local-address"; \
:local remoteAddr $"remote-address"; \
:local interfaceName [/interface get $interface name]; \

:log warning "$user  connected: was given $remoteAddr IP (GW $localAddr) and assigned to $interfaceName interface"; \
/ip route add dst-address=$remoteAddr routing-mark=OSPF pref-src=$localAddr gateway=$interfaceName distance=5;
PPP-DOWN script:
:local localAddr $"local-address"; \
:local remoteAddr $"remote-address"; \
:local remoteAddrMask "$remoteAddr/32"; \
:local interfce $"interface""; \
:log warning "$user  Disconnected: IP $remoteAddrMask (GW $localAddr) interface $interfce"; \
/ip route set disable=yes [find dst-address=$remoteAddrMask routing-mark=OSPF ];
/delay 3;  \
/ip route remove [find disabled=yes routing-mark=OSPF distance=5 ]; \
Added tags "disabled=yes" and "distance=5". After delay 3 sec - remove tagged route.

Who is online

Users browsing this forum: No registered users and 98 guests