Ipv6 Cheat Sheet
Ipv6 Cheat Sheet
Ipv6 Cheat Sheet
by Jens Roesen
/64 – lan segment, 18,446,744,073,709,551,616 v6 IPs
IPv6 quick facts /48 – subscriber site, 65536 /64 lan segments
successor of IPv4 • 128-bit long addresses • that's 296 times the IPv4 address space • that's 2128 or 3.4x1038 or over 340 /32 – minimum allocation size, 65536 /48 subscriber sites, allocated to ISPs
undecillion IPs overall • customer usually gets a /64 subnet, which yields 4 billion times the Ipv4 address space • no
need for network address translation (NAT) any more • no broadcasts any more • no ARP • stateless address 2001:0db8:0f61:a1ff:0000:0000:0000:0080
configuration without DHCP • improved multicast • easy IP renumbering • minimum MTU size 1280 • mobile IPv6 • global routing prefix subnet ID interface ID
mandatory IPsec support • fixed IPv6 header size of 40 bytes • extension headers • jumbograms up to 4 GiB
subnet prefix /64
source IPv6 address the 3rd byte. So the MAC 00:03:ba:24:a9:c6 becomes EUI-64 02 03 ba ff fe 24 a9 6c
0203:baff:fe24:a9c6. See RFC 4291 Appendix A and RFC 4941.
TARGET
2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa.. The shorter
2001:db8::2 → 2001:db8::1, ICMPv6 type 136, Flags: S
target 2001:db8::2, option 2 (target link-layer) 00:03:ba:2e:02:c1 bitstring/bitlabel format (RFC 2672 and 2673) was later discarded but may be still used by older resolvers (BIND > 8.3
and < 9.2.3). The tool ipv6calc helps with the conversion!
In the example above node 2001:db8::1 wants to reach 2001:db8::2 but does not know the link-layer address of The host command will look for both A and AAAA records, using dig you have to explicitly ask for AAAA records (dig
2001:db8::2. So it sends a NS packet to the solicited-node multicast address of 2001:db8::2 host.example.com aaaa). Reverse lookups as usual can be done using host without further switches (host
(ff02::1:ff00:0/104 followed by the last 24 bits of the interface ID) along with its own link-layer address and 2001:db8::1) or with dig using the -x switch (dig -x 2001:db8::1).
receives a NA (ICMPv6 type 136) packet with the targets link-layer address.
Linux IPv6 Interface Configuration examples (Steps might slightly differ between distributions)
Duplicate Address Detection (DAD): To perform DAD the NS message is sent with the unspecified source IP :: and to
the solicited-node multicast address of the IP which should be configured. If there is already a node using this desired Manual configuration: You can temporarily configure an IPv6 address with the ifconfig or ip command:
# ifconfig eth0 inet6 add 2001:db8::2/64 or
IP it will answer with a NA packet sent to the all-node multicast address ff02::1.
# ip addr add 2001:db8::2/64 dev eth0
Neighbor Discovery (ND): Router Solicitation (RS) and Router Advertisement (RA) Add a default route
# route -A inet6 add default 2001:db8::1 or
Router Solicitation (RS) packets are sent in order to receive a Router Advertisement (RA) message independently from # ip -6 route add default via 2001:db8::1
the periodically sent RAs. This is typical during stateless address autoconfiguration after successful DAD. The source IP To check the configuration use ifconfig eth0 or ip -6 addr show eth0 respectively route -A inet6 or ip
used for the RS message can be :: or the link-local IP for this interface.
-6 route show. For making the changes permanent you'll have to edit the config files specific for your distribution.
:: or fe80::203:baff:fe24:a96c → ff02::2, ICMPv6 type 133 (RS)
option 1 (source link-layer) 00:03:ba:24:a9:6c (only when source IP is not ::) Automatic configuration using SLAAC: Just having IPv6 enabled and IPv4 configured on the interface should normally
ROUTER
NODE
CLI # ssh '2001:db8:dead:f00d:203:baff:fe24:a9c6' RFC 4862 IPv6 Stateless Address Configuration RFC 4941 Privacy Extensions for SLAAC in IPv6
RFC 8201 Path MTU Discovery for IPv6 RFC 6147 DNS64 – DNS Extensions for NAT64
# lynx http://[2001:db8:dead:f00d:203:baff:fe24:a9c6]
RFC 3596 DNS Extensions to Support IP Version 6 RFC 6146 Stateful NAT64
# wget ftp://[2001:db8:dead:f00d:203:baff:fe24:a9c6]
RFC 4443 ICMPv6 for IPv6 RFC 6434 IPv6 Node Requirements
Browser http://[2001:db8:dead:f00d:203:baff:fe24:a9c6]
RFC 3587 IPv6 Global Unicast Address Format RFC 6540 IPv6 Support Required for All IP-Capable Nodes