scapy
scapy copied to clipboard
support rfc8950 nexthop in Linux routing table
Brief description
An IPv6 only link can transparently transport IPv4 packets (no IPv4 configured on link) using a IPv6 nexthop's MAC
example setup https://ungleich.ch/u/blog/how-to-route-ipv4-via-ipv6/
$ ip route
default via inet6 fe80::21b:21ff:febb:6934 dev wlp0s20f3 src 169.265.0.30
Environment
- Scapy version:
2.4.4 - Python version:
3.8.6 - Operating System:
Centos 8
How to reproduce
send IPv4 packet at L3 with sr()
Actual result
scapy doesn't properly set up L2, packets never got sent (silent failure)
Expected result
based on routing table, scapy automatically sets Ether()
Related resources
https://tools.ietf.org/html/rfc8950 https://ungleich.ch/u/blog/how-to-route-ipv4-via-ipv6/
I was able to make it work using sendp() with correct Ether(). This issue is about having L3 send to automatically populate the correct L2 encapsulation for IPv4 with a IPv6 nexthop.
That's interesting!
Quick question: how would the IPv4 stack chose a source IP address when no route exists? Based on the interfaces's address?
Thanks!
IPv4 addresses are bound to lo interface, and IPv4 default route can include a src like default via inet6 fe80::21b:21ff:febb:6934 dev wlp0s20f3 src 169.265.0.30
Thanks for your answer!
That is something that we could support once #3275 is merged.