scapy.route6
Routing and network interface handling for IPv6.
- class scapy.route6.Route6
Bases:
object
- add(*args, **kargs)
Ex: add(dst=”2001:db8:cafe:f000::/56”) add(dst=”2001:db8:cafe:f000::/56”, gw=”2001:db8:cafe::1”) add(dst=”2001:db8:cafe:f000::/64”, gw=”2001:db8:cafe::1”, dev=”eth0”)
- delt(dst, gw=None)
Ex: delt(dst=”::/0”) delt(dst=”2001:db8:cafe:f000::/56”) delt(dst=”2001:db8:cafe:f000::/56”, gw=”2001:db8:deca::1”)
- flush()
- ifadd(iff, addr)
Add an interface ‘iff’ with provided address into routing table.
- Ex: ifadd(‘eth0’, ‘2001:bd8:cafe:1::1/64’) will add following entry into # noqa: E501
Scapy6 internal routing table:
Destination Next Hop iface Def src @ Metric 2001:bd8:cafe:1::/64 :: eth0 2001:bd8:cafe:1::1 1
prefix length value can be omitted. In that case, a value of 128 will be used.
- ifchange(iff, addr)
- ifdel(iff)
removes all route entries that uses ‘iff’ interface.
- invalidate_cache()
- make_route(dst, gw=None, dev=None)
Internal function : create a route for ‘dst’ via ‘gw’.
- remove_ipv6_iface(iface)
Remove the network interface ‘iface’ from the list of interfaces supporting IPv6.
- resync()
- route(dst=None, dev=None, verbose=2)
Provide best route to IPv6 destination address, based on Scapy internal routing table content.
When a set of address is passed (e.g.
2001:db8:cafe:*::1-5
) an address of the set is used. Be aware of that behavior when using wildcards in upper parts of addresses !If ‘dst’ parameter is a FQDN, name resolution is performed and result is used.
if optional ‘dev’ parameter is provided a specific interface, filtering is performed to limit search to route associated to that interface.