스위치를 통해 통신하는 동일한 시스템에서 두 개의 NIC를 얻는 데 도움

스위치를 통해 통신하는 동일한 시스템에서 두 개의 NIC를 얻는 데 도움

3개의 NIC가 있는 Hyper-V 호스트에 가상 Ubuntu Server(14.04) VM이 있습니다.
eth0은 외부 네트워크에 브리지됩니다
. eth1 및 eth2는 개인 가상 스위치에 연결됩니다.

목표는 트래픽이 스위치를 통해 계속 전송되는 동안 VM이 eth1 및 eth2를 사용하여 자체적으로 통신하도록 하는 것입니다. 그러면 트래픽이 전달/스니핑될 수 있습니다.

나는 각 인터페이스에 대해 올바른 설정을 설정했으며 여기 게시물도 따랐다고 생각합니다.하나의 게이트웨이로 두 개의 IP 주소를 설정하시겠습니까?

한 인터페이스에서 다른 인터페이스로 ping을 시도하면 tcpdump에서 다른 인터페이스로 오는 ARP 요청이 표시되지만 응답이 없습니다.

$ ping -b -I eth1 10.0.0.6

PING 10.0.0.6 (10.0.0.6) from 10.0.0.5 eth1: 56(84) bytes of data.
From 10.0.0.5 icmp_seq=1 Destination Host Unreachable
From 10.0.0.5 icmp_seq=2 Destination Host Unreachable
From 10.0.0.5 icmp_seq=3 Destination Host Unreachable
From 10.0.0.5 icmp_seq=4 Destination Host Unreachable
From 10.0.0.5 icmp_seq=5 Destination Host Unreachable
From 10.0.0.5 icmp_seq=6 Destination Host Unreachable
^C
--- 10.0.0.6 ping statistics ---
7 packets transmitted, 0 received, +6 errors, 100% packet loss, time 6018ms
pipe 4

$ tcpdump -i eth2

21:27:19.666738 ARP, Request who-has 10.0.0.6 tell 10.0.0.5, length 28
21:27:20.666636 ARP, Request who-has 10.0.0.6 tell 10.0.0.5, length 28
...

가상 스위치의 다른 장치와 ping을 할 수 있습니다...

더욱 특이한 점은 다른 인터페이스 중 하나에 SSH로 연결할 수 있다는 것인데, 그 트래픽은 tcpdump에 표시되지 않습니다.

$ ssh -i eth1[이메일 보호됨]

내가 하려는 일이 가능할까요?

추가 정보:

$ ifconfig

eth0      Link encap:Ethernet  HWaddr 00:15:5d:0e:f9:09
          inet addr:172.16.33.225  Bcast:172.16.39.255  Mask:255.255.248.0
          inet6 addr: fe80::215:5dff:fe0e:f909/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:480545 errors:0 dropped:7810 overruns:0 frame:0
          TX packets:10662 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:50354580 (50.3 MB)  TX bytes:1754707 (1.7 MB)

eth1      Link encap:Ethernet  HWaddr 00:15:5d:0e:f9:0a
          inet addr:10.0.0.5  Bcast:10.255.255.255  Mask:255.0.0.0
          inet6 addr: fe80::215:5dff:fe0e:f90a/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:107 errors:0 dropped:0 overruns:0 frame:0
          TX packets:506 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:9293 (9.2 KB)  TX bytes:100827 (100.8 KB)

eth2      Link encap:Ethernet  HWaddr 00:15:5d:0e:f9:0b
          inet addr:10.0.0.6  Bcast:10.255.255.255  Mask:255.0.0.0
          inet6 addr: fe80::215:5dff:fe0e:f90b/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:347 errors:0 dropped:0 overruns:0 frame:0
          TX packets:88 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:20373 (20.3 KB)  TX bytes:6448 (6.4 KB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:5523 errors:0 dropped:0 overruns:0 frame:0
          TX packets:5523 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:2173284 (2.1 MB)  TX bytes:2173284 (2.1 MB)

$ 고양이 /etc/네트워크/인터페이스

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
        address 172.16.33.225
        netmask 255.255.248.0
        ...

auto eth1
iface eth1 inet static
        address 10.0.0.5
        network 10.0.0.0
        netmask 255.0.0.0
        broadcast 10.255.255.255
        up ip route add 10.0.0.0/8 dev eth1 src 10.0.0.5 table eth1table
        up ip route add default via 0.0.0.0 dev eth1 table eth1table
        up ip rule add from 10.0.0.5 table eth1table
        up ip route add 10.0.0.0/8 dev eth1 src 10.0.0.5

auto eth2
iface eth2 inet static
        address 10.0.0.6
        network 10.0.0.0
        netmask 255.0.0.0
        broadcast 10.255.255.255
        up ip route add 10.0.0.0/8 dev eth2 src 10.0.0.6 table eth2table
        up ip route add default via 0.0.0.0 dev eth2 table eth2table
        up ip rule add from 10.0.0.6 table eth2table
        up ip route add default via 0.0.0.0 dev eth2
        up ip route add 10.0.0.0/8 dev eth2 src 10.0.0.6

도움을 주시면 감사하겠습니다 !!

답변1

아니요, 불가능합니다. 로컬 시스템으로 향하는 패킷은 전달되지 않고 로컬 시스템에 의해 처리됩니다.

관련 정보