Static IPv6 on a PC
| OS | Address | Default gateway |
|---|---|---|
| Windows | netsh interface ipv6 add address "Ethernet" 2001:db8:acad:10::10/64 | netsh interface ipv6 add route ::/0 "Ethernet" fe80::1 |
| Linux | sudo ip -6 addr add 2001:db8:acad:20::10/64 dev eth0 | sudo ip -6 route add default via fe80::1 |
| macOS | System Settings (or networksetup) | System Settings |
A static address is added next to any SLAAC address: an IPv6 interface happily has several.
In NetLab
▶ PC2 student@PC2:~$ sudo ip -6 addr add 2001:db8:acad:20::10/64 dev eth0 student@PC2:~$ ip -6 addr show 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 inet6 ::1/128 scope host noprefixroute valid_lft forever preferred_lft forever 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000 inet6 2001:db8:acad:20::10/64 scope global valid_lft forever preferred_lft forever inet6 2001:db8:acad:20:21a:f2ff:fe3a:a4ee/64 scope global dynamic mngtmpaddr valid_lft 2591998sec preferred_lft 604798sec inet6 fe80::21a:f2ff:fe3a:a4ee/64 scope link valid_lft forever preferred_lft forever ▶ PC1 NetLab Windows-style command prompt. Type help to see the commands. C:\Users\student>ping 2001:db8:acad:20::10 Pinging 2001:db8:acad:20::10 with 32 bytes of data: Reply from 2001:db8:acad:20::10: time<1ms Reply from 2001:db8:acad:20::10: time<1ms Reply from 2001:db8:acad:20::10: time<1ms Reply from 2001:db8:acad:20::10: time<1ms Ping statistics for 2001:db8:acad:20::10: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 0ms, Maximum = 0ms, Average = 0ms C:\Users\student>tracert 2001:db8:acad:20::10 Tracing route to 2001:db8:acad:20::10 over a maximum of 30 hops 1 <1 ms <1 ms <1 ms 2001:db8:acad:10::1 2 2 ms 2 ms 2 ms 2001:db8:acad:20::10 Trace complete.
When it doesn't work
In this network the router has addresses but nobody turned on ipv6 unicast-routing. Look at what the PC has:
In NetLab
▶ PC1 NetLab Windows-style command prompt. Type help to see the commands. C:\Users\student>ipconfig Windows IP Configuration Ethernet adapter Ethernet: Connection-specific DNS Suffix . : Link-local IPv6 Address . . . . . : fe80::11db:99de:fbce:36d1%12 Default Gateway . . . . . . . . . : C:\Users\student>ping 2001:db8:acad:10::1 Pinging 2001:db8:acad:10::1 with 32 bytes of data: PING: transmit failed. General failure. PING: transmit failed. General failure. PING: transmit failed. General failure. PING: transmit failed. General failure. Ping statistics for 2001:db8:acad:10::1: Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),
Only a link-local address and no gateway: no RA ever came. The PC can't even reach the router's global address, because it has no route to it.
| Symptom | Check |
|---|---|
| PC has only an fe80:: address | ipv6 unicast-routing on the router; the router's interface is up and has a /64 |
| PC has an address but no gateway | The RA: again ipv6 unicast-routing |
| Can reach the gateway, not beyond | The far side: its prefix, its gateway, the router's routes |
| Static address doesn't work | The prefix must match the router's /64 on that LAN; the gateway must be the router's link-local (or global) address on that LAN |
Tip:
show ipv6 interface briefon the router andipconfig/ip -6 addron the PC answer most IPv6 questions in seconds.