如何让pptp连接/断开后自动添加路由
测试平台:Openwrt
在/etc/hotplug.d/iface/
下添加30-routes
文件,系统将在接口状态发生生变化时执行该脚本。
然后在30-routes
中写入
1 |
|
把pptp-vpn0
修改为自己想要的接口名。
比如我现在需要在pptp-vpn0
断开后自动添加192.168.0.1为默认路由,则设置如下
1 |
|
加入了一行route add default gw 192.168.0.1
如何让pptp连接/断开后自动添加路由
https://xzsk2.github.io/2018/pptp-route/