Benutzer-Werkzeuge

Webseiten-Werkzeuge


ne:scapy:ipv6_ra

IPv6 Router Advertisements

https://tools.ietf.org/html/rfc4861

head = IPv6()                      # IPv6-Header
head.dst = "ff02::1"               # Destination-Adresse ist die All Nodes Multicast Address
icmp6 = ICMPv6ND_RA()              # ICMPv6-Header für Neighbor Discovery Router Advertisement
 
o_pref = ICMPv6NDOptPrefixInfo()   # ICMPv6-Option: Prefix Information
o_pref.prefix = '2001:db8:1::'     # Präfix wie in RA vom regulären Router
o_pref.prefixlen = 64              # Präfix-Länge (in Bit) setzen
o_pref.validlifetime = 7200        # Valid-Lifetime 2h
o_pref.preferredlifetime = 1800    # Prefered-Lifetime 30min
 
o_route = ICMPv6NDOptRouteInfo()   # ICMPv6-Option: Route Information
o_route.prefix ='::'               # Default Route
o_route.plen = 0                   # Präfix-Länge (in Bit) setzen
o_route.rtlifetime = 1800          # Same value as the Prefered-Lifetime of the Router
 
o_rdns = ICMPv6NDOptRDNSS()        # ICMPv6-Option: Recursive DNS Server
o_rdns.dns = ['2001:db8:1::1']     # List of DNS Server Addresses
o_rdns.lifetime = 1800             # Same value as the Prefered-Lifetime of the Router
 
o_mac = ICMPv6NDOptSrcLLAddr()     # ICMPv6-Option: Source Link Layer Address
o_mac.lladdr = '01:02:03:04:05:06' # MAC address
 
# Zusammensetzen des Pakets
pkt = (head/icmp6/o_pref/o_route/o_rdns/o_mac)
 
send(pkt)			   # Einmaliges Senden des Pakets

weitere mögliche Optionen:

o_mtu = ICMPv6NDOptMTU()          # ICMPv6-Option MTU (kann entfallen)
ne/scapy/ipv6_ra.txt · Zuletzt geändert: 2018/11/23 07:44 von admin