OpenVPNクライアントがLinuxに接続されないのはなぜですか?

OpenVPNクライアントがLinuxに接続されないのはなぜですか?

このVPNはWindowsではうまく機能しますが、CentOSで起動しようとすると数秒間続き、最終的にエラーログにメッセージなしで停止します。また、Windows システムが稼働している間、サーバーは接続中に Ping への応答を即座に停止します。

client
dev tun
proto udp
remote 151.80.xxx.xxx 1194
resolv-retry infinite
nobind
persist-key
persist-tun
remote-cert-tls server
auth SHA512
cipher AES-256-CBC
ignore-unknown-option block-outside-dns
block-outside-dns
verb 3

VPNを有効にしていないIP r

default via 51.195.234.254 dev eth0 
51.195.234.254 dev eth0 scope link

その活動で

0.0.0.0/1 via 10.8.0.1 dev tun0 
default via 51.195.234.254 dev eth0 
10.8.0.0/24 dev tun0 proto kernel scope link src 10.8.0.2 
51.195.234.254 dev eth0 scope link 
128.0.0.0/1 via 10.8.0.1 dev tun0 
151.80.xxx.xx via 51.195.234.254 dev eth0

丸太

Fri May 21 19:42:19 2021 OpenVPN 2.4.11 x86_64-redhat-linux-gnu [Fedora EPEL patched] [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [PKCS11] [MH/PKTINFO] [AEAD] built on Apr 21 2021
Fri May 21 19:42:19 2021 library versions: OpenSSL 1.0.2k-fips  26 Jan 2017, LZO 2.06
Fri May 21 19:42:19 2021 Outgoing Control Channel Encryption: Cipher 'AES-256-CTR' initialized with 256 bit key
Fri May 21 19:42:19 2021 Outgoing Control Channel Encryption: Using 256 bit message hash 'SHA256' for HMAC authentication
Fri May 21 19:42:19 2021 Incoming Control Channel Encryption: Cipher 'AES-256-CTR' initialized with 256 bit key
Fri May 21 19:42:19 2021 Incoming Control Channel Encryption: Using 256 bit message hash 'SHA256' for HMAC authentication
Fri May 21 19:42:19 2021 TCP/UDP: Preserving recently used remote address: [AF_INET]151.80.xxx.xxx:1194
Fri May 21 19:42:19 2021 Socket Buffers: R=[212992->212992] S=[212992->212992]
Fri May 21 19:42:19 2021 UDP link local: (not bound)
Fri May 21 19:42:19 2021 UDP link remote: [AF_INET]151.80.xxx.xxx:1194
Fri May 21 19:42:19 2021 TLS: Initial packet from [AF_INET]151.80.xxx.xxx:1194, sid=3b917597 2f279e15
Fri May 21 19:42:19 2021 VERIFY OK: depth=1, CN=ChangeMe
Fri May 21 19:42:19 2021 VERIFY KU OK
Fri May 21 19:42:19 2021 Validating certificate extended key usage
Fri May 21 19:42:19 2021 ++ Certificate has EKU (str) TLS Web Server Authentication, expects TLS Web Server Authentication
Fri May 21 19:42:19 2021 VERIFY EKU OK
Fri May 21 19:42:19 2021 VERIFY OK: depth=0, CN=server
Fri May 21 19:42:19 2021 Control Channel: TLSv1.2, cipher TLSv1/SSLv3 ECDHE-RSA-AES256-GCM-SHA384, 2048 bit RSA
Fri May 21 19:42:19 2021 [server] Peer Connection Initiated with [AF_INET]151.80.xxx.xxx:1194
Fri May 21 19:42:20 2021 SENT CONTROL [server]: 'PUSH_REQUEST' (status=1)
Fri May 21 19:42:20 2021 PUSH: Received control message: 'PUSH_REPLY,redirect-gateway def1 bypass-dhcp,dhcp-option DNS 213.186.33.99,dhcp-option DNS 213.186.33.199,route-gateway 10.8.0.1,topology subnet,ping 10,ping-restart 120,ifconfig 10.8.0.2 255.255.255.0,peer-id 0,cipher AES-256-GCM'
Fri May 21 19:42:20 2021 OPTIONS IMPORT: timers and/or timeouts modified
Fri May 21 19:42:20 2021 OPTIONS IMPORT: --ifconfig/up options modified
Fri May 21 19:42:20 2021 OPTIONS IMPORT: route options modified
Fri May 21 19:42:20 2021 OPTIONS IMPORT: route-related options modified
Fri May 21 19:42:20 2021 OPTIONS IMPORT: --ip-win32 and/or --dhcp-option options modified
Fri May 21 19:42:20 2021 OPTIONS IMPORT: peer-id set
Fri May 21 19:42:20 2021 OPTIONS IMPORT: adjusting link_mtu to 1624
Fri May 21 19:42:20 2021 OPTIONS IMPORT: data channel crypto options modified
Fri May 21 19:42:20 2021 Data Channel: using negotiated cipher 'AES-256-GCM'
Fri May 21 19:42:20 2021 Outgoing Data Channel: Cipher 'AES-256-GCM' initialized with 256 bit key
Fri May 21 19:42:20 2021 Incoming Data Channel: Cipher 'AES-256-GCM' initialized with 256 bit key
Fri May 21 19:42:20 2021 ROUTE_GATEWAY 51.195.234.254
Fri May 21 19:42:20 2021 TUN/TAP device tun0 opened
Fri May 21 19:42:20 2021 TUN/TAP TX queue length set to 100
Fri May 21 19:42:20 2021 /sbin/ip link set dev tun0 up mtu 1500
Fri May 21 19:42:20 2021 /sbin/ip addr add dev tun0 10.8.0.2/24 broadcast 10.8.0.255
Fri May 21 19:42:20 2021 /sbin/ip route add 151.80.xxx.xxx/32 via 51.195.234.254
Fri May 21 19:42:20 2021 /sbin/ip route add 0.0.0.0/1 via 10.8.0.1
Fri May 21 19:42:20 2021 /sbin/ip route add 128.0.0.0/1 via 10.8.0.1
Fri May 21 19:42:20 2021 WARNING: this configuration may cache passwords in memory -- use the auth-nocache option to prevent this
Fri May 21 19:42:20 2021 Initialization Sequence Completed

Windows ipconfig/すべて

Unknown adapter OpenVPN TAP-Windows6:

   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : TAP-Windows Adapter V9
   Physical Address. . . . . . . . . : 00-FF-18-08-1B-04
   DHCP Enabled. . . . . . . . . . . : Yes
   Autoconfiguration Enabled . . . . : Yes
   Link-local IPv6 Address . . . . . : fe80::5185:de54:7498:6c08%4(Preferred)
   IPv4 Address. . . . . . . . . . . : 10.8.0.2(Preferred)
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Lease Obtained. . . . . . . . . . : Friday, May 21, 2021 8:55:25 PM
   Lease Expires . . . . . . . . . . : Saturday, May 21, 2022 8:55:25 PM
   Default Gateway . . . . . . . . . :
   DHCP Server . . . . . . . . . . . : 10.8.0.254
   DHCPv6 IAID . . . . . . . . . . . : 184614680
   DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-28-38-63-9A-02-00-00-F8-D9-D4
   DNS Servers . . . . . . . . . . . : 213.186.33.99
                                       213.186.33.199
   NetBIOS over Tcpip. . . . . . . . : Enabled

Debian 10:

0.0.0.0/1 via 10.8.0.1 dev tun0 
default via 51.195.234.254 dev eth0 onlink 
10.8.0.0/24 dev tun0 proto kernel scope link src 10.8.0.2 
128.0.0.0/1 via 10.8.0.1 dev tun0

接続中の Windows ping:

C:\Users\管理者>ping 10.8.0.1

Pinging 10.8.0.1 with 32 bytes of data:
Reply from 10.8.0.1: bytes=32 time=4ms TTL=64
Reply from 10.8.0.1: bytes=32 time=4ms TTL=64
Reply from 10.8.0.1: bytes=32 time=4ms TTL=64
Reply from 10.8.0.1: bytes=32 time=4ms TTL=64

Ping statistics for 10.8.0.1:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 4ms, Maximum = 4ms, Average = 4ms

Linux ping:

ping 10.8.0.1
PING 10.8.0.1 (10.8.0.1) 56(84) bytes of data.

--- 10.8.0.1 ping statistics ---
5 packets transmitted, 0 received, 100% packet loss, time 3999ms

ベストアンサー1

を指定しました。clientこれは意味しますpull。このpull動詞はサーバーからパスを抽出し、サーバーはVPNを介してすべてのクライアントトラフィックを送信するオーバーレイパスを提供します。 (man openvpnさまざまな設定オプションの詳細については、参考資料を参照してください。)

すべてのトラフィックがVPNを通過するように設定されている場合、すべての応答もpingVPNを通過して失われます。これは設定状態なので、ログにエラーはありません。

Windows構成がわずかに異なり、すべてのトラフィックがVPNを介してルーティングされるのを防ぐオプションがあるか、LANにローカルトラフィックを引き続き提供できるメトリックがあると思います。

おすすめ記事