Reputation: 21
I'm trying to send IPv6 packet to subnet where IPv6 NDP(ARP counterpart) is disabled on destination host:
2007::1 dev enp0s8 lladdr 08:00:27:a1:cd:f0 PERMANENT
#!/bin/python3
from scapy.all import *
from scapy.contrib.gtp import *
ipv6 = IPv6(src="2007::2",dst="2007::1")
udp = UDP(sport=2152, dport=2152)
while True:
sendp(Ether()/ipv6/udp/"Hello World!")
Expected Result:
Hello-world packet is sent with specific dst MAC-address (08:00:27:a1:cd:f0
) according to static ip neighbour entry.
Actual result:
“Who has” NDP-packets are sent. After having no answer - broadcast dst MAC-address (ff:ff:ff:ff:ff:ff
) is set in Hello-world packet. When sending ping packets who has are not sent.
Seem that there is a bug in Scapy.
Upvotes: 1
Views: 132
Reputation: 5055
For some reason Scapy doesn't read the NDP cache from the OS. You can specify MAC within Scapy with:
conf.netcache.in6_neighbor['2007::1'] = '08:00:27:a1:cd:f0'
or with
eth = Ether(dst="08:00:27:a1:cd:f0")
Upvotes: 0