我试图在我们的服务器上安装OpenVPN。 服务器正在运行Centos 7.安装和configurationOpenVPN后,我可以成功地从Windows 10客户端连接。 但一旦连接,我无法访问互联网。 我也无法ping主机服务器。 与OpenVPN无关,我的服务器也使用KVM在虚拟networking上运行多个虚拟机。 连接时,我也无法ping通虚拟机。
主机连接:192.168.1.10
VPNnetworking:10.8.0.0
虚拟networking:10.8.8.0
我确认IP转发已启用。 我也更新了iptables:
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE
我列出了OpenVPN server.conf和Ifconfig信息。
我一直在为此挣扎一个星期。 在这一点上,我卡住了,不知道接下来要看什么。 有任何想法吗?
OpenVPN server.conf:
port 1194 proto udp dev tun ca ca.crt cert server.crt key server.key # This file should be kept secret dh dh2048.pem ifconfig-pool-persist ipp.txt server 10.8.0.0 255.255.255.0 push "route 192.168.1.10 255.255.255.255" push "route 10.8.8.0 255.255.255.0" push "redirect-gateway def1" push "dhcp-option DNS 8.8.8.8" push "dhcp-option DNS 8.8.4.4" keepalive 10 120 user nobody group nobody persist-key persist-tun status openvpn-status.log verb 3 client-to-client explicit-exit-notify 1
IFCONFIG:
eno1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.1.10 netmask 255.255.255.0 broadcast 192.168.1.255 inet6 fe80::3bcd:ddd4:4650:6087 prefixlen 64 scopeid 0x20<link> ether ac:1f:6b:05:cc:96 txqueuelen 1000 (Ethernet) RX packets 454678 bytes 136137391 (129.8 MiB) RX errors 36 dropped 37074 overruns 0 frame 36 TX packets 213347 bytes 80743075 (77.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 inet6 ::1 prefixlen 128 scopeid 0x10<host> loop txqueuelen 1 (Local Loopback) RX packets 91899 bytes 50703642 (48.3 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 91899 bytes 50703642 (48.3 MiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 tun0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1500 inet 10.8.0.1 netmask 255.255.255.255 destination 10.8.0.2 unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 100 (UNSPEC) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 virbr1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 10.8.8.1 netmask 255.255.255.0 broadcast 10.8.8.255 ether 52:54:00:34:2a:4d txqueuelen 1000 (Ethernet) RX packets 2663 bytes 193301 (188.7 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 2582 bytes 226983 (221.6 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 vnet0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet6 fe80::fc54:ff:fe6e:e2f prefixlen 64 scopeid 0x20<link> ether fe:54:00:6e:0e:2f txqueuelen 1000 (Ethernet) RX packets 2663 bytes 230583 (225.1 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 141674 bytes 7459999 (7.1 MiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
我在我的客户端configuration中指定了LZO压缩(comp-lzo),但没有在服务器configuration中指定。 一旦我纠正了这个问题,我现在可以访问互联网和networking的其余部分。