VPN 已正常连接,但不知道怎么设置路由,将所有流量转到 vpn。
ip route add 108.61.126.150 dev ppp0
curl
http://y1.511401.com/IP.php这样设置后,访问
y1.511401.com 是通过 vpn。
# route -n
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 172.31.255.253 0.0.0.0 UG 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 1002 0 0 eth0
172.31.240.0 0.0.0.0 255.255.240.0 U 0 0 0 eth0
# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.31.255.162 netmask 255.255.240.0 broadcast 172.31.255.255
ether 00:16:3e:02:e4:a4 txqueuelen 1000 (Ethernet)
RX packets 209209 bytes 310576203 (296.1 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 33972 bytes 3240741 (3.0 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
loop txqueuelen 1 (Local Loopback)
RX packets 107 bytes 23412 (22.8 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 107 bytes 23412 (22.8 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
ppp0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1496
inet 10.253.217.1 netmask 255.255.255.255 destination 43.249.37.11
ppp txqueuelen 3 (Point-to-Point Protocol)
RX packets 10 bytes 550 (550.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 235 bytes 44644 (43.5 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
https://www.v2ex.com/t/465781
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.