{"id":6212,"date":"2022-03-06T12:17:42","date_gmt":"2022-03-06T11:17:42","guid":{"rendered":"https:\/\/nil.uniza.sk\/?p=6212"},"modified":"2022-03-06T17:15:42","modified_gmt":"2022-03-06T16:15:42","slug":"how-to-configure-multiple-ipv6-dhcp-pools-on-remote-cisco-router","status":"publish","type":"post","link":"https:\/\/nil.uniza.sk\/en\/how-to-configure-multiple-ipv6-dhcp-pools-on-remote-cisco-router\/","title":{"rendered":"CCNA study &#8211; How to configure multiple IPv6 DHCP pools on a remote Cisco router"},"content":{"rendered":"<p>This config example shows how to configure three DHCPv6 pools for a network setup, where the DHCP server is running on a remote router.  This situation had emerged during my remote CCNA lesson and it found me unprepared. The main problem is with the <strong>ipv6 dhcp server <em>POOL <\/em><\/strong>command, that can be executed only once, all others rewrite the previous one. The solution is to use i<strong>pv6 dhcp server automatic <\/strong>or just <strong>pv6 dhcp server<\/strong> command with some additional pool command.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Topology<\/h2>\n\n\n\n<p>Configuration runs on GNS3 emulator. The Switch runs IOSv and is primarily used for the VLAN segmentation. In R1\/R2 I\u2019m using the older ISR platform (7200 15.4 IOS). CSR-1000v is also fine. Problems are with older 12.x IOSs, that do not support ipv6 dhcp server command. DHCPv6 servers\/pools are configured on R2. DHCPv6 relay and nd config flags on R1 fa0\/0 subinterfaces.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img alt=\"\" decoding=\"async\" width=\"684\" height=\"479\" src=\"https:\/\/nil.uniza.sk\/wp-content\/uploads\/2022\/03\/image.png\" class=\"wp-image-6213\" srcset=\"https:\/\/nil.uniza.sk\/wp-content\/uploads\/2022\/03\/image.png 684w, https:\/\/nil.uniza.sk\/wp-content\/uploads\/2022\/03\/image-300x210.png 300w\" sizes=\"(max-width: 684px) 100vw, 684px\" \/><\/figure>\n\n\n\n<p> <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Initial configuration<\/h2>\n\n\n\n<p>Initial configuration includes the setting of three VLANs, the trunk, subinterfaces, the basic IPv6 addressing and static routing.<\/p>\n\n\n\n<figure class=\"wp-block-table is-style-regular\"><table><tbody><tr><td><strong>TheSwitch<\/strong><\/td><td><strong>R1<\/strong><\/td><td><strong>R2<\/strong><\/td><\/tr><tr><td>ena<br>conf t<br>hostname TheSwitch<br>vlan 10,20,30<br>span mode rapid<br>int gi 0\/1<br>switchport mode access<br>switchport access vlan 10<br>int gi 0\/2<br>switchport mode access<br>switchport access vlan 20<br>int gi 0\/3<br>switchport mode access<br>switchport access vlan 30<br>int gi 0\/0<br>switchport trunk encapsulation dot1q<br>switchport mode trunk<br>end<br>wr mem<\/td><td>ena<br>conf t<br>ipv6 unicast-routing<br>int f0\/0<br>no shut<br>int f0\/0.10<br>encapsulation dot1q 10<br>ipv6 add 2001:10::1\/64<br>ipv6 add fe80::1 link-local<br>int f0\/0.20<br>encapsulation dot1q 20<br>ipv6 add 2001:20::1\/64<br>ipv6 add fe80::1 link-local<br>int f0\/0.30<br>encapsulation dot1q 30<br>ipv6 add 2001:30::1\/64<br>ipv6 add fe80::1 link-local<br>int fa0\/1<br>ipv6 add 2001:bad:cafe::1\/64<br>ipv6 add fe80::1 link-local<br>no shut<br>end<br>wr mem<\/td><td>ena<br>conf t<br>ipv6 unicast-routing<br>int f0\/1<br>ipv6 add 2001:bad:cafe::2\/64<br>ipv6 add fe80::2 link-local<br>no shut<br>exit<br>ipv6 route ::\/0 fa0\/1 2001:bad:cafe::1<br>end<br>wr mem<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Configuration of DHCPv6 server funcions <\/h2>\n\n\n\n<p>In this example I will configure on R2 router three dhcpv6 pools, one for each VLAN. <\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>For VLAN 10 it will be Stateless DHCPv6 config, where the server will assign the DNS IPv6 address only<\/li><li>for VLAN 20 and 30 there will be two Statefull DHCPv6 servers with their own configuration, i.e. address pools and own DNS servers<\/li><\/ul>\n\n\n\n<p>The configuration can be broken down into the following three steps:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Create the IPV6 DHCP Pool (R2)<\/li><li>Configure \\ Apply the pool to an interface (R2 fa0\/0 interface)<\/li><li>Configure relay agent and ND config flags (on R1&#8217;s subinterfaces)<\/li><li>Configure the clients for DHCP<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Configuring&nbsp;Stateless DHCPv6 server<\/h3>\n\n\n\n<p>In this case the client uses SLACC process (for default-gateway IPv6 address, subnet mask, subnet prefix) and the statelless DHCPv6 server on R2 that will provides the additional configuration (DNS and domain name):<\/p>\n\n\n\n<p>Create a pool on the R2 router<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>ipv6 dhcp pool VLAN10-pool<\/strong>\n  dns-server 2001:db8:AAAA:AAAA::1\n  domain-name example-1.com<\/pre>\n\n\n\n<p>The on R2 go to interface fa0\/1 and start the DHCP server:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">R2(config)# int fa0\/1\nR2(config-if)#ipv6 dhcp server ?\n  WORD       Name of IPv6 DHCP pool\n  <strong>automatic  <\/strong>Automatically find pool\n  &lt;cr&gt;\n\nR2(config-if)# <strong>ipv6 dhcp server <span style=\"background-color:#fcb900\" class=\"background-color\">automatic<\/span><\/strong><\/pre>\n\n\n\n<p>Finally, we need to go on R1 VLAN 10 subinterface and configure the relay agent to forward DHCPv6 messages and other-config-flag that will inform hosts that they should use DHCPv6 for non-address configurations. <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">R1(config)#int fa 0\/0.10\nR1(config-subif)#<strong>ipv6 dhcp relay destination<\/strong> 2001:bad:cafe::2\n\nR1(config-subif)#<strong>ipv6 nd other-config-flag<\/strong>\n<\/pre>\n\n\n\n<p>Nice. Now i&#8217;m going to my host (AplineLinux &#8211; 1) and I will start DHCPv6 process<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">gns:~# udhcpc6<br>udhcpc6: started, v1.32.1<br>udhcpc6: sending discover<br>udhcpc6: sending discover<br>udhcpc6: sending discover<br>udhcpc failed to get a DHCP lease<\/pre>\n\n\n\n<p>So, the main problem with this configuration is, that it does not work. This we may see when we start the debugging on R2. We may see, the DHCP requests are coming, however the R2 router is not able to select correct pool (see yellow highlighted text). We may see, that the request has arrived from the R1&#8217;s fa0\/1 interface (comparing to DHCPv4 this is different), not from the Vlan 10 subinterface.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">R2#debug ipv6 dhcp detail\nIPv6 DHCP debugging is on (detailed)\nR2#\n<strong>*Mar 6 12:11:18.575: IPv6 DHCP: <span style=\"background-color:#fcb900\" class=\"background-color\">Received RELAY-FORWARD from 2001:BAD:CAFE::1 <\/span>on<\/strong> FastEthernet0\/1\n*Mar 6 12:11:18.579: IPv6 DHCP: detailed packet contents\n*Mar 6 12:11:18.579: src 2001:BAD:CAFE::1 (FastEthernet0\/1)\n*Mar 6 12:11:18.579: dst 2001:BAD:CAFE::2 (FastEthernet0\/1)\n*Mar 6 12:11:18.583: type RELAY-FORWARD(12), hop 0\n*Mar 6 12:11:18.583: <span style=\"background-color:#7bdcb5\" class=\"background-color\"><strong>link 2001:10::1<\/strong><\/span>\n*Mar 6 12:11:18.583: peer FE80::E33:68FF:FE45:0\n*Mar 6 12:11:18.583: option RELAY-MSG(9), len 54\n*Mar 6 12:11:18.587: type SOLICIT(1), xid 11902521\n*Mar 6 12:11:18.587: option ELAPSED-TIME(8), len 2\n*Mar 6 12:11:18.587: elapsed-time 148\n*Mar 6 12:11:18.587: option CLIENTID(1), len 10\n*Mar 6 12:11:18.591: 000300010C3368450000\n*Mar 6 12:11:18.591: option IA-NA(3), len 12\n*Mar 6 12:11:18.591: IAID 0x3B2F3949, T1 0, T2 0\n*Mar 6 12:11:18.591: option ORO(6), len 4\n*Mar 6 12:11:18.595: DNS-SERVERS,DOMAIN-LIST\n*Mar 6 12:11:18.595: option UNKNO\nR2#WN(39), len 2\n*Mar 6 12:11:18.595: option INTERFACE-ID(18), len 4\n*Mar 6 12:11:18.595: 0x0000000A\n*Mar 6 12:11:18.595: option REMOTEID(37), len 22\n*Mar 6 12:11:18.595: 0x0000000902000000000A000A00030001CA018FBC0008\n<span style=\"background-color:#fcb900\" class=\"background-color\"><strong>*Mar 6 12:11:18.595: IPv6 DHCP: Option UNKNOWN(39) is not processed\n*Mar 6 12:11:18.595: IPv6 DHCP: Matching pool cannot be found<\/strong><\/span><\/pre>\n\n\n\n<p>Good message is, that the request contains the link address of R1 subinterface, that received the DHCP request (green highlight). This information we will use on R2 as the pointer to the correct pool from which the DHCP server should  assign information. So, configure<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">R2(config)#ipv6 dhcp pool VLAN10-pool\nR2(config-dhcpv6)# <strong>link-address 2001:10::1\/64<\/strong>\n<\/pre>\n\n\n\n<p>Now it should work:. When I re-initiate DHCPv6 process on the host, I may see promising output on R2<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">*Mar 6 12:25:50.131: IPv6 DHCP: detailed packet contents\n*Mar 6 12:25:50.131: src 2001:BAD:CAFE::2\n*Mar 6 12:25:50.131: dst 2001:BAD:CAFE::1 (FastEthernet0\/1)\n*Mar 6 12:25:50.131: type RELAY-REPLY(13), hop 0\n*Mar 6 12:25:50.131: link 2001:10::1\n*Mar 6 12:25:50.131: peer FE80::E33:68FF:FE45:0\n*Mar 6 12:25:50.131: option RELAY-MSG(9), len 51\n*Mar 6 12:25:50.131: type ADVERTISE(2), xid 11975709\n*Mar 6 12:25:50.131: option SERVERID(2), len 10\n*Mar 6 12:25:50.131: 00030001CA028FE30008\n*Mar 6 12:25:50.131: option CLIENTID(1), len 10\n*Mar 6 12:25:50.131: 000300010C3368450000\n*Mar 6 12:25:50.131: option STATUS-CODE(13), len 15\n*Mar 6 12:25:50.131: status code NOADDRS-AVAIL(2)\n*Mar 6 12:25:50.131: status message: NOADDRS-AVAIL\n*Mar 6 12:25:50.131: option INTERFACE-ID(18), len 4\n*Mar 6 12:25:50.135: 0x0000000A\n*Mar 6 12:25:50.135: <strong><span style=\"background-color:#fcb900\" class=\"background-color\">IPv6 DHCP: Sending RELAY-REPLY to 2001:BAD<\/span><\/strong>\n<strong><span style=\"background-color:#fcb900\" class=\"background-color\">R2#:CAFE::1<\/span><\/strong><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Verification&nbsp;<\/h4>\n\n\n\n<p>On AlpineLinux host number 1 I will initiate dhcpv6 process<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">gns:~# udhcpc6\nudhcpc6: started, v1.32.1\nudhcpc6: sending discover\nudhcpc6: received DHCP NAK (65)\nudhcpc received DHCP NAK\n<\/pre>\n\n\n\n<p>NAK message is not a problem, as it is regarding of address initiation, that is not performed with Stateless DHCP.<\/p>\n\n\n\n<p> IP address command<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">gns:~# <strong>ip a show dev eth0<\/strong>\n2: eth0: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 qdisc pfifo_fast state UP qlen 1000\n    link\/ether 0c:33:68:45:00:00 brd ff:ff:ff:ff:ff:ff\n    i<strong>net6 2001:10::e33:68ff:fe45:0\/64 scope global dynamic<\/strong>\n       valid_lft 2591975sec preferred_lft 604775sec\n    inet6 fe80::e33:68ff:fe45:0\/64 scope link\n       valid_lft forever preferred_lft forever\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Configuring&nbsp;Statefull DHCPv6 server<\/h3>\n\n\n\n<p>Now, respecting mentioned, I will configure statefull DHCPv6 server on R2 with two pools, For VLAN 20 first <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">! for VLAN 20\nipv6 dhcp pool VLAN20-pool\n  address prefix 2001:20::\/64\n  <strong>link-address 2001:20::1\/64<\/strong>\n  dns-server 2001:DB8:BBBB:BBBB::1\n  domain-name example-2.com<\/pre>\n\n\n\n<p>and the pool for VLAN 30 then<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">! for VLAN 30\nipv6 dhcp pool VLAN30-pool\n  address prefix 2001:30::\/64\n  <strong>link-address 2001:30::1\/64<\/strong>\n  dns-server 2001:DB8:CCCC:CCCC::1\n  domain-name example-3.com<\/pre>\n\n\n\n<p>Finally, we need to go on R1 and configure the relay agent that will forward DHCPv6 messages, and manage-config-flag that will inform hosts that they should use DHCPv6 for all configurations. <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">! VLAN 20\nR1(config)#int fa 0\/0.20\nR1(config-subif)#<strong>ipv6 dhcp relay destination<\/strong> 2001:bad:cafe::2\nR1(config-subif)#<strong>ipv6 nd managed-config-flag<\/strong>\n\n! and \n! VLAN 30\nR1(config)#int fa 0\/0.30\nR1(config-subif)#<strong>ipv6 dhcp relay destination<\/strong> 2001:bad:cafe::2\nR1(config-subif)#<strong>ipv6 nd managed-config-flag<\/strong><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Verification&nbsp;<\/h4>\n\n\n\n<p>For AlpineLinux host number 2:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">gns:~# udhcpc6\nudhcpc6: started, v1.32.1\nudhcpc6: sending discover\nudhcpc6: sending select\nudhcpc6: <strong>IPv6 obtained,<\/strong> lease time 172800<\/pre>\n\n\n\n<p>the IP address command<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">gns:~# <strong>ip a show dev eth0<\/strong>\n2: eth0: mtu 1500 qdisc pfifo_fast state UP qlen 1000\nlink\/ether 0c:b4:e4:e9:00:00 brd ff:ff:ff:ff:ff:ff\n<strong>inet6 2001:20::eb4:e4ff:fee9:0\/64 scope global dynamic<\/strong>\nvalid_lft 2591835sec preferred_lft 604635sec\ninet6 fe80::eb4:e4ff:fee9:0\/64 scope link\nvalid_lft forever preferred_lft forever<\/pre>\n\n\n\n<p>and finally DNS and domain information:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>gns:~# less \/etc\/resolv.conf<\/strong><\/pre>\n\n\n\n<p>where we may see<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>search example-2.com\nnameserver 2001:0db8:bbbb:bbbb:0000:0000:0000:0001<\/strong><\/pre>\n\n\n\n<p>If the output is incorrect restart the hostname service<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\/etc\/init.d\/hostname.sh stop\n\/etc\/init.d\/hostname.sh start<\/pre>\n\n\n\n<p>The same we should see for the third Linux host.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Verification on DHCP server<\/h4>\n\n\n\n<pre class=\"wp-block-preformatted\">R2#<strong>sh ipv dhcp pool<\/strong>\nDHCPv6 pool: VLAN10-pool\nLink-address prefix: 2001:10::1\/64\nDNS server: 2001:DB8:AAAA:AAAA::1\nDomain name: example-1.com\n<strong>Active clients: 0<\/strong>\nDHCPv6 pool: VLAN20-pool\nAddress allocation prefix: 2001:20::\/64 valid 172800 preferred 86400 (1 in use, 0 conflicts)\nLink-address prefix: 2001:20::1\/64\nDNS server: 2001:DB8:BBBB:BBBB::1\nDomain name: example-2.com\n<strong>Active clients: 1<\/strong>\nDHCPv6 pool: VLAN30-pool\nAddress allocation prefix: 2001:30::\/64 valid 172800 preferred 86400 (1 in use, 0 conflicts)\nLink-address prefix: 2001:30::1\/64\nDNS server: 2001:DB8:CCCC:CCCC::1\nDomain name: example-3.com\n<strong>Active clients: 1<\/strong><\/pre>","protected":false},"excerpt":{"rendered":"<p>This config example shows how to configure three DHCPv6 pools for a network setup, where the DHCP server is running on a remote router. This situation had emerged during my remote CCNA lesson and it found me unprepared. The main problem is with the ipv6 dhcp server POOL command, that can be executed only once,&#8230;<\/p>","protected":false},"author":9,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_seopress_robots_primary_cat":"","_seopress_titles_title":"","_seopress_titles_desc":"","_seopress_robots_index":"","_kad_blocks_custom_css":"","_kad_blocks_head_custom_js":"","_kad_blocks_body_custom_js":"","_kad_blocks_footer_custom_js":"","_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"footnotes":""},"categories":[747],"tags":[],"class_list":["post-6212","post","type-post","status-publish","format-standard","hentry","category-practical_-_cisco-en"],"taxonomy_info":{"category":[{"value":747,"label":"Practical - Cisco"}]},"featured_image_src_large":false,"author_info":{"display_name":"palo73","author_link":"https:\/\/nil.uniza.sk\/en\/author\/palo73\/"},"comment_info":10,"category_info":[{"term_id":747,"name":"Practical - Cisco","slug":"practical_-_cisco-en","term_group":0,"term_taxonomy_id":745,"taxonomy":"category","description":"","parent":0,"count":17,"filter":"raw","cat_ID":747,"category_count":17,"category_description":"","cat_name":"Practical - Cisco","category_nicename":"practical_-_cisco-en","category_parent":0}],"tag_info":false,"_links":{"self":[{"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/posts\/6212","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/comments?post=6212"}],"version-history":[{"count":0,"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/posts\/6212\/revisions"}],"wp:attachment":[{"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/media?parent=6212"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/categories?post=6212"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/tags?post=6212"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}