我按照以下教程在Ubuntu 16.04服务器上设置OPENVPN: https : //www.digitalocean.com/community/tutorials/how-to-set-up-an-openvpn-server-on-ubuntu-16- 04
然后,我使用步骤6和从11到13创build了另一个客户端(client2)。有两件事让我感到困惑: – 尽pipe我在服务器configuration文件中添加了推送指令,但两台计算机上的stream量都不通过VPN路由。 – 面具看起来很奇怪(我可能会误认为我是新来的)在ifconfig中的相对输出:
tun0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 inet addr:10.8.0.6 PtP:10.8.0.5 Mask:255.255.255.255 UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1 RX packets:13 errors:0 dropped:0 overruns:0 frame:0 TX packets:209 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:100 RX bytes:1092 (1.0 KB) TX bytes:39180 (39.1 KB)
我可以ping服务器(IP:10.8.0.1),但不是其他机器。 客户端1:Ubuntu16.04,IP:10.8.0.5客户端2:Windows 7,IP:10.8.0.10
我的目标是让其中一台机器使用另一台机器的LAN IP地址来使用服务。 编辑:我解决了路由所有stream量的第一个问题,并取消注释该行
client-to-client
这样客户端就可以看到对方,但不能ping其他客户端
编辑:server.conf
port 1194 proto udp dev tun ca ca.crt cert server.crt key server.key dh dh2048.pem server 10.8.0.0 255.255.255.0 ifconfig-pool-persist ipp.txt push "redirect-gateway def1 bypass-dhcp" push "dhcp-option DNS 208.67.222.222" push "dhcp-option DNS 208.67.220.220" client-to-client keepalive 10 120 tls-auth ta.key 0 # This file is secret key-direction 0 cipher AES-128-CBC # AES auth SHA256 comp-lzo user nobody group nogroup persist-key persist-tun status openvpn-status.log verb 3
路线-n:
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 0.0.0.0 80.211.10.1 0.0.0.0 UG 0 0 0 eth0 10.8.0.0 10.8.0.2 255.255.255.0 UG 0 0 0 tun0 10.8.0.2 0.0.0.0 255.255.255.255 UH 0 0 0 tun0 80.211.10.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0