在我的办公室,我正尝试将 Raspberry Pi 作为客户端连接到 OpenVPN 服务器(Ubuntu 14.04.3)。
我的 Raspberry Pi(客户端)的 IP 是 10.1.2.14,服务器的 IP 是 10.1.2.12
当我从 Raspberry Pi 执行以下命令时
openvpn --config pi2.ovpn
我在控制台上收到以下日志
OpenVPN 2.3.4 arm-unknown-linux-gnueabihf [SSL (OpenSSL)] [LZO] [EPOLL] [PKCS11] [MH] [IPv6] built on Jan 23 2016
library versions: OpenSSL 1.0.1t 3 May 2016, LZO 2.08
Socket Buffers: R=[163840->131072] S=[163840->131072]
UDPv4 link local: [undef]
UDPv4 link remote: [AF_INET]10.1.2.12:1194
TLS: Initial packet from [AF_INET]10.1.2.12:1194, sid=e6eaaa4e 99903945
VERIFY OK: depth=1, C=IN, ST=MH, L=NaviMumbai, O=mycompany, OU=Java, CN=mycompany CA, name=server, [email protected]
VERIFY OK: nsCertType=SERVER
VERIFY OK: depth=0, C=IN, ST=MH, L=NaviMumbai, O=mycompany, OU=Java, CN=server, name=server, [email protected]
Data Channel Encrypt: Cipher 'BF-CBC' initialized with 128 bit key
Data Channel Encrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Data Channel Decrypt: Cipher 'BF-CBC' initialized with 128 bit key
Data Channel Decrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Control Channel: TLSv1, cipher TLSv1/SSLv3 DHE-RSA-AES256-SHA, 2048 bit RSA
[server] Peer Connection Initiated with [AF_INET]10.1.2.12:1194
SENT CONTROL [server]: 'PUSH_REQUEST' (status=1)
PUSH: Received control message: 'PUSH_REPLY,redirect-gateway def1 bypass-dhcp,dhcp-option DNS 208.67.222.222,dhcp-option DNS 208.67.220.220,route 10.8.0.1,topology net30,ping 10,ping-restart 120,ifconfig 10.8.0.6 10.8.0.5'
OPTIONS IMPORT: timers and/or timeouts modified
OPTIONS IMPORT: --ifconfig/up options modified
OPTIONS IMPORT: route options modified
OPTIONS IMPORT: --ip-win32 and/or --dhcp-option options modified
ROUTE_GATEWAY 10.1.1.253/255.255.252.0 IFACE=eth0 HWADDR=b8:27:eb:6d:4b:d6
TUN/TAP device tun0 opened
TUN/TAP TX queue length set to 100
do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=0
/sbin/ip link set dev tun0 up mtu 1500
/sbin/ip addr add dev tun0 local 10.8.0.6 peer 10.8.0.5
/sbin/ip route add 10.1.2.12/32 via 10.1.1.253
/sbin/ip route add 0.0.0.0/1 via 10.8.0.5
/sbin/ip route add 128.0.0.0/1 via 10.8.0.5
/sbin/ip route add 10.8.0.1/32 via 10.8.0.5
Initialization Sequence Completed
但在此之后,当我 ping 到 OpenVPN 服务器(ping 10.8.0.1)时,我没有收到回复。
两个系统上的 /etc/network/interfaces 配置相同(除了它们自己的 IP)
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo eth0
iface lo inet loopback
iface eth0 inet static
address 10.1.2.12 #and 10.1.2.14 on pi
netmask 255.255.252.0
gateway 10.1.1.253
dns-nameservers 10.1.1.211 10.1.1.212
search domain mycompany.co.in
我怀疑这个问题与我公司的网络有关,因为当我在家里执行同样的程序时,它正常工作。有什么建议吗?
编辑:过了一段时间,我在控制台上收到了这条消息
Inactivity timeout (--ping-restart), restarting
SIGUSR1[soft,ping-restart] received, process restarting
Restart pause, 2 second(s)
编辑:如果我将协议从 UDP 更改为 TCP,那么我可以 ping 通。我不知道为什么它不能与 UDP 配合使用。