C:\Users\李大鹏>route print =========================================================================== 接口列表 4...2c fd a1 ae 29 29 ......Realtek PCIe GbE Family Controller 22...d4 6d 6d f4 b9 b5 ......Intel(R) Wireless-AC 9560 160MHz 18...d4 6d 6d f4 b9 b6 ......Microsoft Wi-Fi Direct Virtual Adapter 15...d6 6d 6d f4 b9 b5 ......Microsoft Wi-Fi Direct Virtual Adapter #2 7...d4 6d 6d f4 b9 b9 ......Bluetooth Device (Personal Area Network) 1...........................Software Loopback Interface 1 =========================================================================== IPv4 路由表 =========================================================================== 活动路由: 网络目标 网络掩码 网关 接口 跃点数 0.0.0.0 0.0.0.0 192.168.15.254 192.168.11.131 25 59.41.253.168 255.255.255.248 192.168.15.254 192.168.11.131 26 127.0.0.0 255.0.0.0 在链路上 127.0.0.1 331 127.0.0.1 255.255.255.255 在链路上 127.0.0.1 331 127.255.255.255 255.255.255.255 在链路上 127.0.0.1 331 192.168.0.0 255.255.240.0 在链路上 192.168.11.131 281 192.168.11.131 255.255.255.255 在链路上 192.168.11.131 281 192.168.15.255 255.255.255.255 在链路上 192.168.11.131 281 224.0.0.0 240.0.0.0 在链路上 127.0.0.1 331 224.0.0.0 240.0.0.0 在链路上 192.168.11.131 281 255.255.255.255 255.255.255.255 在链路上 127.0.0.1 331 255.255.255.255 255.255.255.255 在链路上 192.168.11.131 281 =========================================================================== 永久路由: 无 IPv6 路由表 =========================================================================== 活动路由: 接口跃点数网络目标 网关 1 331 ::1/128 在链路上 1 331 ff00::/8 在链路上 =========================================================================== 永久路由: 无
C:\Users\李大鹏>route print =========================================================================== 接口列表 41...........................vpntest 22...d4 6d 6d f4 b9 b5 ......Intel(R) Wireless-AC 9560 160MHz 18...d4 6d 6d f4 b9 b6 ......Microsoft Wi-Fi Direct Virtual Adapter 15...d6 6d 6d f4 b9 b5 ......Microsoft Wi-Fi Direct Virtual Adapter #2 7...d4 6d 6d f4 b9 b9 ......Bluetooth Device (Personal Area Network) 1...........................Software Loopback Interface 1 4...2c fd a1 ae 29 29 ......Realtek PCIe GbE Family Controller =========================================================================== IPv4 路由表 =========================================================================== 活动路由: 网络目标 网络掩码 网关 接口 跃点数 0.0.0.0 0.0.0.0 192.168.15.254 192.168.11.131 4250 0.0.0.0 0.0.0.0 在链路上 192.168.25.3 26 59.41.253.168 255.255.255.248 192.168.15.254 192.168.11.131 4251 113.65.22.4 255.255.255.255 192.168.15.254 192.168.11.131 4251 127.0.0.0 255.0.0.0 在链路上 127.0.0.1 4556 127.0.0.1 255.255.255.255 在链路上 127.0.0.1 4556 127.255.255.255 255.255.255.255 在链路上 127.0.0.1 4556 192.168.0.0 255.255.240.0 在链路上 192.168.11.131 4506 192.168.11.131 255.255.255.255 在链路上 192.168.11.131 4506 192.168.15.255 255.255.255.255 在链路上 192.168.11.131 4506 192.168.25.3 255.255.255.255 在链路上 192.168.25.3 281 224.0.0.0 240.0.0.0 在链路上 127.0.0.1 4556 224.0.0.0 240.0.0.0 在链路上 192.168.11.131 4506 224.0.0.0 240.0.0.0 在链路上 192.168.25.3 26 255.255.255.255 255.255.255.255 在链路上 127.0.0.1 4556 255.255.255.255 255.255.255.255 在链路上 192.168.11.131 4506 255.255.255.255 255.255.255.255 在链路上 192.168.25.3 281 =========================================================================== 永久路由: 无 IPv6 路由表 =========================================================================== 活动路由: 接口跃点数网络目标 网关 1 331 ::1/128 在链路上 1 331 ff00::/8 在链路上 =========================================================================== 永久路由: 无
0.0.0.0 0.0.0.0 在链路上 192.168.25.3 26 113.65.22.4 255.255.255.255 192.168.15.254 192.168.11.131 4251 192.168.25.3 255.255.255.255 在链路上 192.168.25.3 281 224.0.0.0 240.0.0.0 在链路上 192.168.25.3 26 255.255.255.255 255.255.255.255 在链路上 192.168.25.3 281
root@X61s:/etc/ppp# pptpsetup --create nas --server路由器IP或域名 --usernamevpn账号 --passwordvpn密码 --encrypt --start Using interface ppp0 Connect: ppp0 <--> /dev/pts/1 CHAP authentication succeeded MPPE 128-bit stateless compression enabled local IP address 192.168.25.2 remote IP address 192.168.0.1 root@X61s:/etc/ppp# ip add 1: lo:mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 ...... 5: ppp0: mtu 1446 qdisc pfifo_fast state UNKNOWN group default qlen 3 link/ppp inet 192.168.25.2 peer 192.168.0.1/32 scope global ppp0 valid_lft forever preferred_lft forever
# added by pptpsetup for nas用户名 nas "密码 " *
# written by pptpsetup pty "/usr/sbin/pptp路由器IP或域名 --nolaunchpppd" lock noauth nobsdcomp nodeflate name lidapeng remotename nas ipparam nas require-mppe-128
# vpn auto ppp0 iface ppp0 inet ppp provider nas
root@X61s:~# ip route default via 192.168.15.254 dev enp0s25 onlink 113.65.22.4 via 192.168.15.254 dev enp0s25 src 192.168.5.169 169.254.0.0/16 dev enp0s25 scope link metric 1000 192.168.0.0/20 dev enp0s25 proto kernel scope link src 192.168.5.169 192.168.0.1 dev ppp0 proto kernel scope link src 192.168.25.2
root@X61s:~# traceroute www.163.com traceroute to www.163.com (113.106.97.216), 30 hops max, 60 byte packets 1 192.168.15.254 (192.168.15.254) 0.267 ms 0.191 ms 0.193 ms 2 1.208.140.61.broad.gz.gd.dynamic.163data.com.cn (61.140.208.1) 3.126 ms 3.196 ms 3.232 ms 3 183.57.162.29 (183.57.162.29) 6.464 ms 121.33.240.125 (121.33.240.125) 4.114 ms 113.98.79.153 (113.98.79.153) 11.629 ms 4 * 245.32.63.58.broad.gz.gd.dynamic.163data.com.cn (58.63.32.245) 6.635 ms * 5 78.110.36.59.broad.dg.gd.dynamic.163data.com.cn (59.36.110.78) 7.483 ms 66.110.36.59.broad.dg.gd.dynamic.163data.com.cn (59.36.110.66) 8.082 ms 183.61.221.234 (183.61.221.234) 7.578 ms 6 119.146.185.66 (119.146.185.66) 7.517 ms 113.107.218.146 (113.107.218.146) 11.612 ms 183.6.200.138 (183.6.200.138) 8.937 ms ......
defaultroute replacedefaultroute
root@X61s:~# traceroute www.163.com traceroute to www.163.com (113.106.97.216), 30 hops max, 60 byte packets 1 192.168.0.1 (192.168.0.1) 4.991 ms 5.742 ms 5.840 ms 2 113.65.22.1 (113.65.22.1) 50.592 ms 50.521 ms 50.484 ms 3 218.19.217.225 (218.19.217.225) 9.552 ms 113.98.79.129 (113.98.79.129) 10.680 ms 14.147.8.246 (14.147.8.246) 11.135 ms 4 14.147.4.229 (14.147.4.229) 10.792 ms * * ......
root@X61s:~# ip route default dev ppp0 scope link 113.65.22.4 via 192.168.15.254 dev enp0s25 src 192.168.5.169 169.254.0.0/16 dev enp0s25 scope link metric 1000 192.168.0.0/20 dev enp0s25 proto kernel scope link src 192.168.5.169 192.168.0.1 dev ppp0 proto kernel scope link src 192.168.25.2
# cp /home/lidapeng/openvpn/client.ovpn /lib/systemd/system/ # cp /home/lidapeng/openvpn/pass.txt /lib/systemd/system/
# cd /lib/systemd/system # cp openvpn-client@.service ovc2home.service # vi ovc2home.service (修改ExecStart=行 ) ExecStart=/usr/sbin/openvpn --suppress-timestamps --nobind --config /lib/systemd/system/client.ovpn
root@X61s:~# systemctl enable ovc2home Created symlink /etc/systemd/system/multi-user.target.wants/ovc2home.service → /lib/systemd/system/ovc2home.service.
以下示例,使用FreeBSD14.1通过OpenVPN连接爱快路由器。
首先在FreeBSD上安装openvpn:
openvpn_enable="yes" openvpn_if="tun" openvpn_configfile="/usr/local/etc/openvpn/client.conf"