Linux Boxをゲートウェイとして使用してVPNを共有するときの接続タイムアウト

Linux Boxをゲートウェイとして使用してVPNを共有するときの接続タイムアウト

他のコンピュータ(192.168.1.12)とVPN接続を共有できるように、Linuxコンピュータ(192.168.1.47)をゲートウェイに設定しようとしています。どちらのシステムも、異なるシステム(ブリッジ接続)に設定されたUbuntu VirtualBox VMです。次のように設定しましたが、ほとんどのウェブサイトにアクセスできません。

ゲートウェイマシン:

root@pi:~# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination
ACCEPT     all  --  unn-89-187-175-12.cdn77.com  anywhere
ACCEPT     all  --  192.168.1.0/24       anywhere

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination
NFLOG      all  --  anywhere             anywhere             nflog-group 6
ACCEPT     all  --  anywhere             anywhere             state RELATED,ESTABLISHED
ACCEPT     all  --  anywhere             anywhere

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
ACCEPT     all  --  anywhere             unn-89-187-175-12.cdn77.com
ACCEPT     all  --  anywhere             192.168.1.0/24

root@pi:~# iptables -L -t nat
Chain PREROUTING (policy ACCEPT)
target     prot opt source               destination

Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

Chain POSTROUTING (policy ACCEPT)
target     prot opt source               destination
MASQUERADE  all  --  anywhere             anywhere

root@pi:~# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         10.5.0.2        128.0.0.0       UG    0      0        0 nordlynx
0.0.0.0         192.168.1.1     0.0.0.0         UG    100    0        0 enp0s3
128.0.0.0       10.5.0.2        128.0.0.0       UG    0      0        0 nordlynx
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 enp0s3
192.168.1.1     0.0.0.0         255.255.255.255 UH    100    0        0 enp0s3

顧客:

root@piclient:~# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.1.47    0.0.0.0         UG    0      0        0 enp0s3
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 enp0s3

クライアントコンピュータでexample.comとicanhazip.comにはアクセスできますが、google.comや他のサイトにはアクセスできません。(カール:ipv4接続がタイムアウトしました。)8.8.8.8にpingしても問題ありません。 nflogを使用すると、ゲートウェイシステムを介して正常に送信されたトラフィック(主にDNS / ping)を表示できます。以下に示すように、クライアントは google.com を確認できますが、example.com などの後続の TCP 要求は表示されません。

root@pi:~# tcpdump -s 0 -n -i nflog:6
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on nflog:6, link-type NFLOG (Linux netfilter log messages), capture size 262144 bytes
16:26:51.578039 IP 192.168.1.12.50342 > 8.8.8.8.53: 56494+ A? google.com. (28)
16:26:51.578135 IP 8.8.8.8.53 > 192.168.1.12.50342: 56494 6/13/10 A 173.194.199.101, A 173.194.199.102, A 173.194.199.113, A 173.194.199.139, A 173.194.199.138, A 173.194.199.100 (508)
  • さらにデバッグするにはどうすればよいですか?
  • ルータ(192.168.1.1)または仮想マシンのホストが干渉を引き起こす可能性がありますか?それでは、example.comを邪魔しないのはなぜですか?

ベストアンサー1

おすすめ記事