RouterOS即使手工添加了VPN server的用户binding interface,也有可能出现连接被切断导致的原来的端口还没掉线,新的VPN连接已经进来了的情况,这时候系统里面就会多出一个动态的VPN server端口,一些针对端口的设定就有可能失效。这个脚本配合定时器自动删除动态生成的VPN server binding端口。
1 2 3 4 5 6 7 8 |
/system script add dont-require-permissions=no name=remove-dynamic-vpn-interfaces owner=admin policy=read,write source="/interface ovpn-server remove [ find\ \_where dynamic=yes ]\r\ \n/interface pptp-server remove [ find where dynamic=yes ]\r\ \n/interface l2tp-server remove [ find where dynamic=yes ]\r\ \n/interface sstp-server remove [ find where dynamic=yes ]" /system scheduler add interval=10s name=schedule1 on-event=remove-dynamic-vpn-interfaces policy=read,write start-date=jan/01/1970 start-time=00:00:00 |