Give a LAN SLAAC addresses with DNS from stateless DHCPv6
Cisco IOSWorking
Tasks
- Make sure R1 routes IPv6 and advertises the LAN prefix for SLAAC.
- Create a DHCPv6 pool that carries only the DNS server and domain name.
- Set the O flag in R1's RAs so hosts ask for those options.
- Attach the pool to the LAN interface.
- Verify on R1 and on both hosts.
Solution
1Routing and the LAN prefixR1
R1 on Cisco IOS ipv6 unicast-routing ! interface GigabitEthernet0/0/0 ipv6 address fe80::1 link-local ipv6 address 2001:db8:acad:10::1/64 no shutdownThe /64 is advertised with A=1 by default, so SLAAC works as soon as routing is on.
2Stateless DHCPv6 poolR1
R1 on Cisco IOS ipv6 dhcp pool LAN10-INFO dns-server 2001:db8:acad:100::53 domain-name corp.example.comNo
address prefixline. That is what makes the pool stateless.3Set the O flag and attach the poolR1
R1 on Cisco IOS interface GigabitEthernet0/0/0 ipv6 nd other-config-flag ipv6 dhcp server LAN10-INFOother-config-flagsets O=1. M stays 0 and A stays 1, so hosts keep using SLAAC for addresses and send a DHCPv6 Information-Request for the options only.
Verify
R1# show ipv6 interface GigabitEthernet0/0/0 | include Hosts use
Hosts use stateless autoconfig for addresses.
Hosts use DHCP to obtain other configuration.SLAAC for addresses, DHCPv6 for the rest. Exactly the M=0, O=1 combination.
R1# show ipv6 dhcp pool
DHCPv6 pool: LAN10-INFO
DNS server: 2001:DB8:ACAD:100::53
Domain name: corp.example.com
Active clients: 0The options are in the pool. Zero active clients is correct for a stateless pool, which keeps no bindings.
R1# show ipv6 dhcp interface GigabitEthernet0/0/0
GigabitEthernet0/0/0 is in server mode
Using pool: LAN10-INFO
Preference value: 0
Hint from client: ignored
Rapid-Commit: disabledThe interface serves the right pool.
R1# debug ipv6 dhcp
IPv6 DHCP: Received INFORMATION-REQUEST from FE80::8D2C:4E1F:3B6A:91D0 on GigabitEthernet0/0/0
IPv6 DHCP: Sending REPLY to FE80::8D2C:4E1F:3B6A:91D0 on GigabitEthernet0/0/0The host asks with Information-Request, not Solicit, which proves it is doing stateless DHCPv6. Turn the debug off with undebug all.
PC1# ipconfig /all
Ethernet adapter Ethernet:
Connection-specific DNS Suffix . : corp.example.com
IPv6 Address. . . . . . . . . . . : 2001:db8:acad:10:8d2c:4e1f:3b6a:91d0(Preferred)
Temporary IPv6 Address. . . . . . : 2001:db8:acad:10:5d1:9a3e:c27f:4b18(Preferred)
Link-local IPv6 Address . . . . . : fe80::8d2c:4e1f:3b6a:91d0%12(Preferred)
Default Gateway . . . . . . . . . : fe80::1%12
DNS Servers . . . . . . . . . . . : 2001:db8:acad:100::53Two SLAAC addresses (stable and temporary, both random on Windows), the gateway from the RA, and the DNS server and suffix from DHCPv6. Output trimmed to the IPv6 lines.
PC2# resolvectl dns eth0
Link 2 (eth0): 2001:db8:acad:100::53The Linux host learned the same DNS server.
Mistakes people make
- Forgetting
ipv6 nd other-config-flag. The pool is fine but hosts never ask for it. - Forgetting
ipv6 dhcp serveron the interface. Hosts ask and nobody answers. - Expecting DHCPv6 to provide the default gateway. It never does; the RA does.
- Testing only with Android phones. They ignore DHCPv6 completely, so they get addresses but not these options.
- A host firewall or ACL blocking UDP 546 and 547, the DHCPv6 client and server ports.
On other platforms
radvd on a Linux router. RDNSS and DNSSL put DNS straight into the RA, which also reaches Android.
interface eth1 {
AdvSendAdvert on;
AdvOtherConfigFlag on;
prefix 2001:db8:acad:10::/64 {
AdvOnLink on;
AdvAutonomous on;
};
RDNSS 2001:db8:acad:100::53 {
};
DNSSL corp.example.com {
};
};Setting the O flag in Junos RAs. The DHCPv6 server itself is configured separately under system services or access.
set protocols router-advertisement interface ge-0/0/0.0 other-stateful-configuration
set protocols router-advertisement interface ge-0/0/0.0 prefix 2001:db8:acad:10::/64Say it in the interview
"Addresses come from SLAAC, so the prefix keeps A=1 and M stays off. I set the O flag so hosts send an
Information-Request, and I give R1 a pool with only DNS and domain name, no address prefix. I verify with
show ipv6 interface for the flags, the pool showing zero clients because it is stateless, and the host showing
the DNS server. For Android I would add RDNSS to the RA, because it ignores DHCPv6."