0

I am using 3 network cards on my ubuntu 14.04 machine. I am trying to simultaneously communicate to 3 different networks using three different network cards. I want to use IPv6 Global addresses. Below is the network structure.

Interface_A (8003::2) <-----> Get0 (8003::1)
Interface_B (8001::2) <-----> Get1 (8001::1)
Interface_C (8002::2) <-----> Get2 (8002::1)

When I work with IPv6 link layer addresses, simultaneous communication is working. i.e. below code is working successfully.

dst_a="FE80::C1:4160" # get0
dst_c="FE80::3617:EBFF:FEAE:DEB4" # get2
src_a="FE80::3617:EBFF:FEAE:DEB5" # my_pc_interfac_A 
src_c="FE80::523E:AAFF:FE08:8AAF" # my_pc_interface_C
IFACE_A = "eth0"
IFACE_C = "eth2"
echo_a = IPv6(src=src_a, dst=dst_a, nh=58) / ICMPv6EchoRequest(data='aaaa')
echo_c = IPv6(src=src_c, dst=dst_c, nh=58) / ICMPv6EchoRequest(data='cccc')

conf.iface = IFACE_A
a = sr1(echo_a)
a.display()

conf.iface = IFACE_C
c = sr1(echo_C)
c.display()

While below code is not working, only 1st ping is successful (echo_a). For the next one I am not getting any response. When I am working with only interface_C (echo_c) with global ipv6 addresses, echo_c is also working.

dst_a_global="8003::1" # get0
dst_c_global="8002::1" # get2
src_a_global="8003::2" # my_pc_interfac_A 
src_c_global="8002::2" # my_pc_interface_C
IFACE_A = "eth0"
IFACE_C = "eth2"
echo_a = IPv6(src=src_a_global, dst=dst_a_global, nh=58) / ICMPv6EchoRequest(data='aaaa')
echo_c = IPv6(src=src_c_global, dst=dst_c_global, nh=58) / ICMPv6EchoRequest(data='cccc')

conf.iface = IFACE_A
a = sr1(echo_a)
a.display()

conf.iface = IFACE_C
c = sr1(echo_C)
c.display()

I am getting only echo_a output, for echo_c there is no response. If I run echo_c first, I am not getting response for echo_a.

I expect that, for both the echo request there should be an echo reply. I am able to ping6 on all the interfaces.

MSS
  • 101
  • 3
  • 8
  • Did you sniff the interfaces using Wireshark to check which packet is sent in which interface? maybe edit your question with this information – Shir Jul 09 '19 at 07:13
  • I am using wireshark, for each interface, and I am able to see that, both the packets are traveling through correct interface only. – MSS Jul 09 '19 at 07:18
  • It doesn't make so much sense. If you are doing everything in the same way, and same packets are sent, each on the correct interface, there is no reason there will be a difference. Are you sure they are sent in the correct interface in all cases? is there any other difference between the sniffed packets? – Shir Jul 09 '19 at 07:21
  • Yes, It is not making sense to me also :( This is the scenario. Requests are being sent correctly, I am struggling with this. :( – MSS Jul 09 '19 at 07:31
  • Do you see the Ping responses in Wireshark for both requests? (meaning- is it a problem with scapy that doesn't read them right, or the other side doesn't answer) – Shir Jul 09 '19 at 07:45
  • I don't see any ping response (only for multiple interface, Ipv6 global add) in wireshark, when I am using scapy to send packets. But when I am pinging through CLI it's working. – MSS Jul 09 '19 at 09:03
  • and no difference between the packets from the CLI and Scapy? take a look carefully, there should be some difference, maybe in the addresses – Shir Jul 09 '19 at 09:07
  • No difference except data field, which can't be responsible for such behavior. – MSS Jul 09 '19 at 10:29
  • can you post some images? of the ip protocol fields on the packet that get a response specifically? – Shir Jul 09 '19 at 11:28
  • Please, never use invalid IPv6 addresses. If you do not have Global IPv6 addresses, then use ULA addresses. Also, you do not detail what mask length you are using. – Ron Maupin Jul 09 '19 at 13:41
  • Prefix length is 64. Does it make any difference ? – MSS Jul 10 '19 at 05:19

1 Answers1

1

Try to configure also the Ethernet layer yourself and see if it is working-

echo_a = Ether(src=YOUR_MAC, dst=33:33:00:01:00:03) / IPv6(src=src_a_global, dst=dst_a_global, nh=58) / ICMPv6EchoRequest(data='aaaa')
a = srp1(echo_a, iface=IFACE_A)

Also- I had some problems myself using IPv6 with multiple interfaces (using regular socket instead of Scapy, and Windows), take a look to see if you can find something relevant (I couldn't think of anything particular, but maybe it will help anyway)-

Shir
  • 1,157
  • 13
  • 35
  • HI Shir, I already tried srp1 method. The situation is same. I think there may be some problem with system ethernet layer. – MSS Jul 09 '19 at 12:02