我执行了 pppd 命令并得到了以下输出:
local IP address 172.16.4.128
remote IP address 172.16.1.200
Committed PPP store
Committed PPP store
pptp_wait_input: Address added. previous interface setting (name: en0, address: 192.168.1.84), current interface setting (name: ppp0, family: PPP, address: 172.16.4.128, subnet: 255.255.0.0, destination: 172.16.1.200).
我尝试添加规则,但route add -net 172.16.1.200
没有成功。我想将所有流量路由到 VPN。
答案1
你至少需要这两条路线:
DEFAULT via dev PPP_DEVICE
VPN_SERVER via LOCAL_NETWORK_GATEWAY
你可以用以下命令获得这两条路线:
ip route add VPN_SERVER via LOCAL_NETWORK_GATEWAY
ip route add default via PPP_DEVICE(ex: ppp0)
可能需要删除本地默认网关路由:
ip route del default via LOCAL_NETWORK_GATEWAY