パケットはどのパスを使用しますか?

パケットはどのパスを使用しますか?

VirtualBoxでホスト専用のネットワーキングを設定しました。

Windowsホスト:

VirtualBox Host-Only Network
 IPv4 Address. . . . . . . . . . . : 192.168.56.1

Wireless LAN Adapter Wireless Network Connection 2
  IPv4 Address. . . . . . . . . . . : 172.19.156.59
  Subnet Mask . . . . . . . . . . . : 255.255.255.0
  Default Gateway . . . . . . . . . : 172.19.156.1

CentOS 仮想マシン:

eth0      Link encap:Ethernet  HWaddr 08:00:27:AF:A3:28  
          inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:feaf:a328/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:381 errors:0 dropped:0 overruns:0 frame:0
          TX packets:423 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:56181 (54.8 KiB)  TX bytes:50846 (49.6 KiB)

eth1      Link encap:Ethernet  HWaddr 08:00:27:C4:A8:B6  
          inet addr:192.168.56.101  Bcast:192.168.56.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fec4:a8b6/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:8984 errors:0 dropped:0 overruns:0 frame:0
          TX packets:162 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:1155253 (1.1 MiB)  TX bytes:31231 (30.4 KiB)

eth2      Link encap:Ethernet  HWaddr 08:00:27:DB:B6:AB  
          inet addr:10.0.4.15  Bcast:10.0.4.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fedb:b6ab/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:220 errors:0 dropped:0 overruns:0 frame:0
          TX packets:487 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:87762 (85.7 KiB)  TX bytes:37818 (36.9 KiB)

CentOS VMがインターネットに接続している場合、パケットがgoogle.comに到達するためにどのパスを使用しているかを確認し、Windowsホストのデフォルトゲートウェイをpingすることができます。 。

[root@localhost network-scripts]# traceroute -I 172.19.156.1
traceroute to 172.19.156.1 (172.19.156.1), 30 hops max, 60 byte packets
 1  172.19.156.1 (172.19.156.1)  1.182 ms  3.395 ms  0.825 ms
[root@localhost network-scripts]# traceroute -T 172.19.156.1
traceroute to 172.19.156.1 (172.19.156.1), 30 hops max, 60 byte packets
 1  172.19.156.1 (172.19.156.1)  14.336 ms  13.957 ms  19.046 ms
[root@localhost network-scripts]# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         10.0.2.2        0.0.0.0         UG    0      0        0 eth0
10.0.2.0        *               255.255.255.0   U     0      0        0 eth0
10.0.4.0        *               255.255.255.0   U     0      0        0 eth2
link-local      *               255.255.0.0     U     1002   0        0 eth0
link-local      *               255.255.0.0     U     1003   0        0 eth1
link-local      *               255.255.0.0     U     1004   0        0 eth2
192.168.56.0    *               255.255.255.0   U     0      0        0 eth1

UDPを介して返されるデフォルトのトレースパスとして-Iおよび-Tハンドルを使用しました。*上記の出力は、パケットが10.0.2.2から172.19.156.1に直接送信されることを意味しますか?

また、Traceroute -T 172.16.156.59(Windowsホスト)を試みると、*が複数表示されます。

ベストアンサー1

これバーチャルボックスマニュアルNATネットワークについては、次のような言葉があります。

VirtualBoxのNATエンジンはゲストオペレーティングシステムからネットワークフレームを受信し、TCP / IPデータを抽出してホストオペレーティングシステムを使用して再送信します。ホスト上のアプリケーションまたはホストと同じネットワーク上の別のコンピュータに、データはそのホストに属するIPアドレスを使用してホスト上のVirtualBoxアプリケーションによって送信されるようです。

したがって、NATインターフェイスを介した仮想マシンのすべてのトレースパスは、ホストで実行されているトレースパスと同じ一連のゲートウェイを報告すると信じています。これは、トレースパスがVirtualBox NATゲートウェイまたはホストのインターフェイスが使用されるリストを一覧表示しないことを意味します。ホストからトラフィックを送信します。

おすすめ記事