OpenVPNは接続されていますが、トラフィックは依然としてデフォルトルータを通過します。

OpenVPNは接続されていますが、トラフィックは依然としてデフォルトルータを通過します。

奇妙な問題があります。 Archlinuxの最後のアップデートまで、すべてがうまくいきました。

私のufwファイアウォールは、ton0とデフォルトのopenvpn IP(openvpnの最初の接続に使用されます)を除くすべてをブロックするように設定されています!完璧です。 VPNをオフにしても漏れはありません...

しかし、更新後、openvpnは何の進展もありませんでした。すべての設定(ネットワーク/openvpn/ufw)をリセットしようとしましたが、何も起こりませんでした。これでufwを無効にする必要がありますが、本当に面倒です。

OpenVPNはすべてが大丈夫だと言っていますが、私のIPはまだデフォルトのISPルーターです。すべてのトラフィックが tun0 ではなく enp3s0 を通過するようです。

[root@user ~]# sudo systemctl status openvpn@Netherlands[email protected] - OpenVPN connection to Netherlands
  Loaded: loaded (/usr/lib/systemd/system/[email protected]; enabled)
  Drop-In: /etc/systemd/system/[email protected]
       └─restart.conf
  Active: active (running) since dim. 2014-08-03 00:50:10 CEST; 8s ago
  Process: 7401 ExecStart=/usr/bin/openvpn --cd /etc/openvpn --config /etc/openvpn/%i.conf --daemon openvpn@%i --writepid /run/openvpn@%i.pid (code=exited, status=0/SUCCESS)
  Main PID: 7402 (openvpn)
  CGroup: /system.slice/system-openvpn.slice/[email protected]
       └─7402 /usr/bin/openvpn --cd /etc/openvpn --config /etc/openvpn/Netherlands.conf --daemon openvpn@Netherlands --writepid /run/[email protected]

août 03 00:50:10 user openvpn@Netherlands[7402]: UDPv4 link local: [undef]
août 03 00:50:10 user openvpn@Netherlands[7402]: UDPv4 link remote: [AF_INET]109.xx.xx.xx:1194
août 03 00:50:10 user openvpn@Netherlands[7402]: WARNING: this configuration may cache passwords in memory -- use the auth-nocache option to prevent this
août 03 00:50:10 user openvpn@Netherlands[7402]: [VPN] Peer Connection Initiated with [AF_INET]109.xx.xx.xx:1194
août 03 00:50:12 user openvpn@Netherlands[7402]: TUN/TAP device tun0 opened
août 03 00:50:12 user openvpn@Netherlands[7402]: do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=0
août 03 00:50:12 user openvpn@Netherlands[7402]: /usr/bin/ip link set dev tun0 up mtu 1500
août 03 00:50:12 user openvpn@Netherlands[7402]: /usr/bin/ip addr add dev tun0 local 10.192.1.6 peer 10.192.1.5
août 03 00:50:12 user openvpn@Netherlands[7402]: Initialization Sequence Completed

[root@user ~]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.1.1     0.0.0.0         UG    1024   0        0 enp3s0
10.192.1.1      10.192.1.5      255.255.255.255 UGH   20     0        0 tun0
10.192.1.5      0.0.0.0         255.255.255.255 UH    0      0        0 tun0
109.xx.xx.xx    192.168.1.1     255.255.255.255 UGH   0      0        0 enp3s0
128.0.0.0       10.192.1.5      128.0.0.0       UG    20     0        0 tun0
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 enp3s0

[root@user ~]# ifconfig
enp3s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 9000
    inet 192.168.1.111  netmask 255.255.255.0  broadcast 192.168.1.255
    inet6 fe80::12bf:48ff:fe7d:a5cc  prefixlen 64  scopeid 0x20<link>
    ether 10:bf:48:7d:a5:cc  txqueuelen 1000  (Ethernet)
    RX packets 13226  bytes 7955537 (7.5 MiB)
    RX errors 0  dropped 0  overruns 0  frame 0
    TX packets 12985  bytes 2539362 (2.4 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 0  (Local Loopback)
    RX packets 8581  bytes 34060996 (32.4 MiB)
    RX errors 0  dropped 0  overruns 0  frame 0
    TX packets 8581  bytes 34060996 (32.4 MiB)
    TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

tun0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST>  mtu 1500
    inet 10.192.1.6  netmask 255.255.255.255  destination 10.192.1.5
    unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  txqueuelen 100  (UNSPEC)
    RX packets 42  bytes 27761 (27.1 KiB)
    RX errors 0  dropped 0  overruns 0  frame 0
    TX packets 61  bytes 7072 (6.9 KiB)
    TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0user

ベストアンサー1

最後にネットワーク設定をリセットすることにしました。

  1. openvpn/dhclient/networkmanager/iptables/ufw(および関連するすべてのパッケージ)を削除し、設定を削除しました。
  2. dhcpcdがインストールされました
  3. 再起動
  4. openvpn/iptables/ufwのインストール
  5. 再起動

すべてが再び正常に戻った! :)

おすすめ記事