Linux
OpenVPN 查看網路上的其他使用者
我有 2 台機器連接到 OpenVPN 網路,但我似乎無法相互 ping 或 RDP。
編輯:
嘗試添加客戶端到客戶端並重新啟動伺服器和客戶端,無法 ping 或訪問它們。
伺服器配置文件:
dev tun tun-mtu 1500 tun-mtu-extra 32 mssfix 1450 reneg-sec 0 ca /etc/openvpn/easy-rsa/2.0/keys/ca.crt cert /etc/openvpn/easy-rsa/2.0/keys/server.crt key /etc/openvpn/easy-rsa/2.0/keys/server.key dh /etc/openvpn/easy-rsa/2.0/keys/dh1024.pem plugin /etc/openvpn/openvpn-auth-pam.so /etc/pam.d/login #plugin /usr/share/openvpn/plugin/lib/openvpn-auth-pam.so /etc/pam.d/login #- Comment this line if you are using FreeRADIUS #plugin /etc/openvpn/radiusplugin.so /etc/openvpn/radiusplugin.cnf #- Uncomment this line if you are using FreeRADIUS client-cert-not-required username-as-common-name server 10.8.0.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 5 30 comp-lzo persist-key persist-tun status 119 4.log verb 3
網路資訊(筆記型電腦):
Ethernet adapter OPENVPN CONNECTION: Connection-specific DNS Suffix . : Link-local IPv6 Address . . . . . : CLEANED IPv4 Address. . . . . . . . . . . : 10.8.0.6 Subnet Mask . . . . . . . . . . . : 255.255.255.252 Default Gateway . . . . . . . . . : Wireless LAN adapter Wireless Network Connection: Media State . . . . . . . . . . . : Media disconnected Connection-specific DNS Suffix . : Ethernet adapter Local Area Connection: Connection-specific DNS Suffix . : local.domain Link-local IPv6 Address . . . . . : CLEANED IPv4 Address. . . . . . . . . . . : 10.35.52.167 Subnet Mask . . . . . . . . . . . : 255.255.0.0 Default Gateway . . . . . . . . . : 10.35.0.1 Tunnel adapter isatap.local.domain: Media State . . . . . . . . . . . : Media disconnected Connection-specific DNS Suffix . : local.domain
其他機器:
Ethernet adapter Local Area Connection 2: Connection-specific DNS Suffix . : Link-local IPv6 Address . . . . . : CLEANED IPv4 Address. . . . . . . . . . . : 10.8.0.10 Subnet Mask . . . . . . . . . . . : 255.255.255.252 Default Gateway . . . . . . . . . : Ethernet adapter Local Area Connection: Connection-specific DNS Suffix . : Link-local IPv6 Address . . . . . : CLEANED IPv4 Address. . . . . . . . . . . : 192.168.2.39 Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : 192.168.2.254
客戶端的 OpenVPN 子網是錯誤的,對吧?
嘗試添加
client-to-client
到您的server.conf
:# Uncomment this directive to allow different # clients to be able to "see" each other. # By default, clients will only see the server. # To force clients to only see the server, you # will also need to appropriately firewall the # server's TUN/TAP interface. ;client-to-client
http://openvpn.net/index.php/open-source/documentation/howto.html#server