{"id":956,"date":"2017-09-26T16:22:08","date_gmt":"2017-09-26T08:22:08","guid":{"rendered":"http:\/\/blog.wallaceho.com\/?p=956"},"modified":"2020-05-27T10:45:41","modified_gmt":"2020-05-27T02:45:41","slug":"capwap-controller-discovery-process","status":"publish","type":"post","link":"https:\/\/blog.wallaceho.com\/?p=956","title":{"rendered":"CAPWAP Controller Discovery Process"},"content":{"rendered":"<p>In a controller-based architecture, CAPWAP access points are dependent on a wireless controller to provide the software image, configuration, and centralized control and optionally data forwarding functions. Therefore, it is necessary for the access point to find a list of available controllers with which it can associate.<\/p>\n<p>The following layer 3 CAPWAP discovery options are supported:<\/p>\n<ol>\n<li>Broadcast on the local subnet<\/li>\n<li>Local NVRAM list of the previously joined controller, previous mobility group members, and administrator primed controller through the console port<\/li>\n<li>Over the Air Provisioning (OTAP) (<em>subsequently removed in version 6.0.170.0 code<\/em>)<\/li>\n<li>DHCP Option 43 returned from the DHCP server<\/li>\n<li>DNS lookup for &#8220;CISCO-CAPWAP-CONTROLLER.<em>localdomain<\/em>&#8220;<\/li>\n<\/ol>\n<p><b><strong>Broadcast<\/strong><\/b><!--more--><\/p>\n<p>The CAPWAP AP sends broadcast discovery requests on the local subnet. Controllers with management interfaces on the same subnet receive the discovery request and send a discovery reply back to the CAPWAP AP.<\/p>\n<p>If no controllers are on the local subnet, broadcasts may be forwarded to the controller management interface by the local router using the Cisco \u201cforward-protocol\u201d and \u201cip helper-address\u201d features. Use these commands to configure the router:<\/p>\n<p><b><strong>ip forward-protocol udp 12223<\/strong><\/b><\/p>\n<p><b><strong>ip forward-protocol udp 5246<\/strong><\/b><\/p>\n<p><b><strong>interface\u00a0<\/strong><\/b><em>interface-name<\/em><\/p>\n<p><b><strong>ip helper-address\u00a0<\/strong><\/b><em>wlc-management-ip-address<\/em><\/p>\n<p>When using the forward-protocol, the default gateway modifies the CAPWAP discovery packet that is broadcast on the local subnet by replacing the broadcast destination IP address 255.255.255.255 with the WLC management IP address configured as an IP helper-address, then routes the packet to the controller. The downside to this approach is that the WLC will also receive all other forwarded protocols such as DHCP discovery packets. Also, other configured IP helpers will receive the CAPWAP discovery packets. Since this behavior is likely undesired, be sure to use the forward-protocol method only temporarily.<\/p>\n<p><b><strong>Local NVRAM<\/strong><\/b><\/p>\n<p>The local NVRAM of the access point stores a list of controllers, gathered from the following sources:<\/p>\n<ul>\n<li>Primary, Secondary, and Tertiary controller preferences previously configured for the APIf the access point was previously associated to a controller, the IP addresses of the primary, secondary, and tertiary controllers are stored in the access point\u2019s non-volatile memory. This process of storing controller IP addresses on access points for later deployment is called\u00a0<em>priming the access point<\/em>.To verify locally stored controller preferences:<b><strong>show ap config general\u00a0<\/strong><\/b><em>ap_name<\/em>\n<p>Primary Cisco Switch Name&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230; WLC001<br \/>\nPrimary Cisco Switch IP Address&#8230;&#8230;&#8230;&#8230;&#8230;&#8230; Not Configured<br \/>\nSecondary Cisco Switch Name&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;. WLC002<br \/>\nSecondary Cisco Switch IP Address&#8230;&#8230;&#8230;&#8230;&#8230;. Not Configured<br \/>\nTertiary Cisco Switch Name&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.. BACKUP-WLC<br \/>\nTertiary Cisco Switch IP Address&#8230;&#8230;&#8230;&#8230;&#8230;..\u00a0Not Configured<\/li>\n<\/ul>\n<ul>\n<li>Mobility Group Members from the previous controller connectionThe AP also maintains previously learned WLC IP addresses locally in NVRAM. The AP sends a unicast CAPWAP Discovery Request to each of these WLC IP addresses. These WLC IP addresses are learned by the AP from previously joined controllers. The stored WLC IP addresses include all of the WLCs in previously joined controller mobility groups.To verify locally stored controllers learned through mobility groups, console into the access point and enter the following command:<b><strong>show capwap client config<\/strong><\/b>\n<p>mwarName\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0CCIETEST<br \/>\nmwarName\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0backupwlc<br \/>\nmwarName<br \/>\nnumOfSlots\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a02<br \/>\nspamRebootOnAssert\u00a0\u00a0\u00a0\u00a0\u00a0\u00a01<br \/>\nspamStatTimer\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0180<br \/>\nrandSeed\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a00x9640<br \/>\ntransport\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0SPAM_TRANSPORT_L3(2)<br \/>\ntransportCfg\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0SPAM_TRANSPORT_DEFAULT(0)<br \/>\ninitialisation\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0SPAM_PRODUCTION_DISCOVERY(1)<br \/>\nApMode\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Local<br \/>\nDiscovery Timer\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a010 secs<br \/>\nHeart Beat Timer\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a030 secs<br \/>\nLed State Enabled\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a01<br \/>\nAP ILP Pre-Standard Switch Support Enabled<br \/>\nAP Power Injector Disabled<br \/>\nInfrastructure MFP validation Enabled<br \/>\nConfigured Switch 1 Addr 10.127.78.5<br \/>\nConfigured Switch 2 Addr 10.108.50.20<\/p>\n<p><b><strong><em>Note\u00a0<\/em><\/strong><\/b><em>\u2013 mwarName entries are the controller preference settings (primary, secondary, tertiary). Configured Switch entries are the learned mobility group members.<\/em><\/li>\n<\/ul>\n<ul>\n<li>Manually primed controller IP address through the consoleManual configuration can be used to \u201cprime\u201d the CAPWAP if network services for address assignment and WLC discovery do not exist. If the CAPWAP has previously joined a controller, or is currently joined to a controller, these commands will be disabled.To stage an access point, use the commands:<br \/>\n<b><strong>capwap ap controller ip address\u00a0<\/strong><\/b><em>wlc-mgmt-ip<\/em><b><strong><br \/>\nshow capwap ip config<\/strong><\/b><\/li>\n<\/ul>\n<p><b><strong>OTAP<\/strong><\/b><\/p>\n<p>If this feature is enabled on the controller, all associated access points transmit wireless RRM neighbor messages, and un-joined access points can receive the controller IP address from these messages. This feature is disabled by default and should only be enabled when necessary for AP deployment.<\/p>\n<p><b><strong><em>Note<\/em><\/strong><\/b><em>\u00a0\u2013 OTAP does not work with default APs out of the box or upgraded using the Upgrade Tool because the radios are disabled from the manufacturer.\u00a0<\/em><\/p>\n<p>Configure OTAP:<\/p>\n<p><b><strong>config network otap-mode\u00a0<\/strong><\/b>{ enable | disable }<br \/>\n<b><strong>show network summary<\/strong><\/b><\/p>\n<p><b><strong><em>Note\u00a0<\/em><\/strong><\/b><em>&#8211; OTAP was removed from the wireless controller feature set in code version 6.0.170.0 due to a vulnerability.<\/em><\/p>\n<p><b><strong>DHCP Option 43<\/strong><\/b><\/p>\n<p>The IP address that should be configured as DHCP option 43 is the address of the controller Managament interface.<\/p>\n<p>Cisco 1000 series access points use a string format for option 43.<br \/>\nCisco Aironet access points use the type-length-value (TLV) format for option 43.<\/p>\n<p>DHCP servers must be programmed to return the option based on the access point\u2019s DHCP Vendor Class Identifier (VCI) string (DHCP option 60).<\/p>\n<p>The format of the Option 43 TLV block is:<\/p>\n<p><b><strong>\u00a0\u00a0\u00a0\u00a0\u00a0Type<\/strong><\/b>: 0xf1 (decimal 241)<br \/>\n<b><strong>Length<\/strong><\/b>: Number of controller IP addresses * 4<br \/>\n<b><strong>Value<\/strong><\/b>: List of WLC management interfaces<\/p>\n<p>Configuration of option 43 will vary by DHCP server platform. Here is an example configuration using the built-in Cisco IOS DHCP server:<\/p>\n<p><b><strong>ip dhcp excluded-address\u00a0<\/strong><\/b><em>start-ip end-ip<\/em><b><strong><br \/>\nip dhcp pool\u00a0<\/strong><\/b><em>pool-name<br \/>\n<\/em>\u00a0\u00a0\u00a0\u00a0\u00a0<b><strong>network\u00a0<\/strong><\/b><em>ip-address netmask<br \/>\n<\/em>\u00a0\u00a0\u00a0\u00a0\u00a0<b><strong>default-router\u00a0<\/strong><\/b><em>ip-address<br \/>\n<\/em><b><strong>dns-server\u00a0<\/strong><\/b><em>ip-address \u2026 ip-address<br \/>\n<\/em>\u00a0\u00a0\u00a0\u00a0\u00a0<b><strong>domain-name\u00a0<\/strong><\/b><em>domain<br \/>\n<\/em>\u00a0\u00a0\u00a0\u00a0\u00a0<b><strong>lease\u00a0<\/strong><\/b><em>days hours<\/em><\/p>\n<p><em>\u00a0\u00a0 \u00a0\u00a0<\/em><b><strong>option 60 ascii\u00a0<em>\u201c<\/em><\/strong><\/b><em>VCI string<b><strong>\u201d<\/strong><\/b><\/em><\/p>\n<p><b><strong>option 43 hex\u00a0<\/strong><\/b><em>hex-value<\/em><\/p>\n<p>An example of a finished IOS DHCP server configuration will look similar to this:<\/p>\n<p>interface Vlan192<\/p>\n<p>ip address 192.168.1.1 255.255.255.0<\/p>\n<p>ip dhcp excluded-address 192.168.1.1 192.168.1.10<\/p>\n<p>ip dhcp pool lwapp<\/p>\n<p>network 192.168.1.0 255.255.255.0<\/p>\n<p>default-router 192.168.1.1<\/p>\n<p>dns-server 192.168.1.2<\/p>\n<p>domain-name test.lab<\/p>\n<p>lease 7<\/p>\n<p>option 60 ascii &#8220;Cisco AP c1240&#8221;<\/p>\n<p>option 43 hex f108.0a6c.3214.0a6c.3212<\/p>\n<p>In this example, the hex value is obtained from these TLV values:<\/p>\n<p>Type = 241 (0xf1)<\/p>\n<p>Length = 2 IP addresses * 4 bytes each = 8 bytes (0x08)<\/p>\n<p>Value = 10.108.50.20 (0x0a6c3214) and 10.108.50.18 (0x0a6c3212)<\/p>\n<p><b><strong><em>Note \u2013\u00a0<\/em><\/strong><\/b><em>Periods are added automatically to the hex value by Cisco IOS and should not be entered by the administrator when entering configuration commands.<\/em><\/p>\n<p><b><strong>DNS<\/strong><\/b><\/p>\n<p>The AP will attempt to resolve the DNS name \u201cCISCO-CAPWAP-CONTROLLER.<em>localdomain<\/em>\u201d. When the AP is able to resolve this name to one or more IP addresses, the AP sends a unicast CAPWAP Discovery Request to the resolved IP address(es). The DNS entries can be either an A (address) or CNAME (alias) records.<\/p>\n<p>If the AP received a DHCP address, ensure the DHCP server is configured to return valid DNS servers and a valid domain name suffix to the AP.<\/p>\n<p>If the AP is using a static IP address, configure the domain name and DNS name servers from the controller. WLC version 4.2 requires configuration from the CLI, whereas 6.0 and later allow configuration from the GUI. Once applied, the AP will disconnect and re-join the controller.<\/p>\n<p><b><strong>config ap static-IP\u00a0<\/strong><\/b>{ enable | disable }\u00a0<em>ap_name ip_address netmask gateway<\/em><br \/>\n<b><strong>config ap static-IP\u00a0<\/strong><\/b>{ add | delete }\u00a0<b><strong>domain\u00a0<\/strong><\/b>{ all |\u00a0<em>ap_name\u00a0<\/em>}\u00a0<em>domain_suffix<br \/>\n<\/em><b><strong>config ap static-IP\u00a0<\/strong><\/b>{ add | delete }\u00a0<b><strong>nameserver\u00a0<\/strong><\/b>{ all |\u00a0<em>ap_name\u00a0<\/em>}\u00a0<em>dns_server_ip_address<\/em><\/p>\n<p>Verify the configuration of the AP:<\/p>\n<p>(Cisco Controller) &gt; show ap config general ccielwap<\/p>\n<p>IP Address Configuration&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;. Static IP assigned<\/p>\n<p>IP Address&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230; 10.108.51.54<\/p>\n<p>IP NetMask&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230; 255.255.254.0<\/p>\n<p>Gateway IP Addr&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;. 10.108.50.1<\/p>\n<p>Domain&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;. ccietest.com<\/p>\n<p>Name Server&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.. 10.10.10.25<\/p>\n<p><b><strong>Verification of Method Used<\/strong><\/b><\/p>\n<p>To view the method used by an AP to discover the controller, view the console output of the AP as it searches, or issue the following command from a controller that receives the discovery request and search for IE 58 from the AP which indicates the discovery method used to resolve the controller IP address:<\/p>\n<p><b><strong>debug capwap packet enable<\/strong><\/b><\/p>\n<p>CAPWAP Discovery Packet IE 58 values:<\/p>\n<p>0 = Broadcast<\/p>\n<p>1 = Local NVRAM<\/p>\n<p>2 = OTAP<\/p>\n<p>3 = DHCP<\/p>\n<p>4 = DNS<\/p>\n<p>Example 1 \u2013 AP Console Log indicates DHCP discovery<\/p>\n<p>*Mar\u00a0\u00a01 00:00:30.287: Logging LWAPP message to 255.255.255.255.<\/p>\n<p>%DHCP-6-ADDRESS_ASSIGN: Interface FastEthernet0 assigned DHCP address 192.168.1.20, mask 255.255.255.0, hostname AP0018.7361.e702<\/p>\n<p>Translating &#8220;CISCO-LWAPP-CONTROLLER.test.lab&#8221;&#8230;domain server (10.97.40.216)<\/p>\n<p>%LWAPP-3-CLIENTEVENTLOG: Performing DNS resolution for CISCO-LWAPP-CONTROLLER<\/p>\n<p>%LWAPP-3-CLIENTERRORLOG: DNS Name Lookup: could not resolve CISCO-LWAPP-CONTROLLER<\/p>\n<p><b><strong><u>%LWAPP-3-CLIENTEVENTLOG: Controller address 10.108.50.20 obtained through DHCP<\/u><\/strong><\/b><\/p>\n<p>%LWAPP-5-CHANGED: LWAPP changed state to JOIN<\/p>\n<p>%LWAPP-5-CHANGED: LWAPP changed state to CFG<\/p>\n<p>%LWAPP-5-CHANGED: LWAPP changed state to DOWN<\/p>\n<p>%LWAPP-5-CHANGED: LWAPP changed state to UP<\/p>\n<p>%LWAPP-3-CLIENTEVENTLOG: AP has joined controller CCIETEST<\/p>\n<p>Example 2 \u2013 WLC LWAPP Packet Debug indicates DHCP discovery<\/p>\n<p>(Cisco Controller) &gt; debug lwapp packet enable<\/p>\n<p>Mon Feb 22 09:55:32 2010: Start of Packet<\/p>\n<p>Mon Feb 22 09:55:32 2010: Ethernet Source MAC (LRAD): 00:17:DF:96:9F:90<\/p>\n<p>Mon Feb 22 09:55:32 2010: Msg Type\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0:<\/p>\n<p>Mon Feb 22 09:55:32 2010:\u00a0\u00a0\u00a0\u00a0DISCOVERY_REQUEST<\/p>\n<p>Mon Feb 22 09:55:32 2010: Msg Length\u00a0\u00a0\u00a0\u00a0\u00a0:\u00a0\u00a0\u00a031<\/p>\n<p>Mon Feb 22 09:55:32 2010: Msg SeqNum\u00a0\u00a0\u00a0\u00a0\u00a0:\u00a0\u00a0\u00a00<\/p>\n<p>Mon Feb 22 09:55:32 2010:<\/p>\n<p>IE\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0:\u00a0\u00a0\u00a0<b><strong><u>UNKNOWN IE 58<\/u><\/strong><\/b><\/p>\n<p>Mon Feb 22 09:55:32 2010: IE Length\u00a0\u00a0\u00a0\u00a0\u00a0:\u00a0\u00a0\u00a01<\/p>\n<p>Mon Feb 22 09:55:32 2010: Decode routine not available, Printing Hex Dump<\/p>\n<p>Mon Feb 22 09:55:32 2010: 00000000:\u00a0<b><strong><u>03<\/u><\/strong><\/b>\u00a0\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 Mon Feb 22 09:55:32 2010:<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In a controller-based architecture, CAPWAP access points are dependent on a wireless controller to provide the software image, configuration, and centralized control and optionally data forwarding functions. Therefore, it is necessary for the access point to find a list of &hellip; <a href=\"https:\/\/blog.wallaceho.com\/?p=956\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-956","post","type-post","status-publish","format-standard","hentry","category-computer"],"_links":{"self":[{"href":"https:\/\/blog.wallaceho.com\/index.php?rest_route=\/wp\/v2\/posts\/956","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.wallaceho.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.wallaceho.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.wallaceho.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.wallaceho.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=956"}],"version-history":[{"count":3,"href":"https:\/\/blog.wallaceho.com\/index.php?rest_route=\/wp\/v2\/posts\/956\/revisions"}],"predecessor-version":[{"id":1079,"href":"https:\/\/blog.wallaceho.com\/index.php?rest_route=\/wp\/v2\/posts\/956\/revisions\/1079"}],"wp:attachment":[{"href":"https:\/\/blog.wallaceho.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=956"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.wallaceho.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=956"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.wallaceho.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=956"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}