2022年配置VLAN与SSID关联 .pdf
VLANs on Aironet Access Points ConfigurationExampleDocument ID: 69773IntroductionPrerequisites Requirements Components Used Conventions Network DiagramConfigure Configure the Native VLAN on the AP Configure VLANs for Guest Users and Admin Users on the AP Configure the Catalyst Switch Configure the RouterVerifyTroubleshoot Troubleshooting Procedure Troubleshooting CommandsNetPro Discussion Forums - Featured ConversationsRelated InformationIntroductionThis document provides a configuration example that shows how to configure VLANs on Cisco AironetAccess Points (APs) with use of the command-line interface (CLI).PrerequisitesRequirementsEnsure that you meet these requirements before you attempt this configuration:Knowledge of the basic configuration of Aironet APs? Knowledge of the configuration of the Aironet 802.11a/b/g Client Adapter with the Aironet DesktopUtility? Basic knowledge of the configuration of Cisco Catalyst switches and Cisco routers? Components UsedThe information in this document is based on these software and hardware versions:Aironet 1240AG Series AP that runs Cisco IOS? Software Release 12.4(3g)JA1? Aironet 802.11a/b/g Client Adapter? Aironet Desktop Utility that runs firmware version 2.5? Catalyst 2950 switch that runs Cisco IOS Software Release 12.1(19)EA1? 2800 ISR Router that runs Cisco IOS Software Release 12.4(11)T? The information in this document was created from the devices in a specific lab environment. All of the名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 1 页,共 11 页 - - - - - - - - - devices used in this document started with a cleared (default) configuration. If your network is live, make surethat you understand the potential impact of any command.ConventionsRefer to the Cisco Technical Tips Conventions for more information on document conventions.Network DiagramThis document uses this network setup.An Aironet 1200 Series AP has three VLANs VLAN 2, VLAN 20, and VLAN 30. The setup in thisdocument uses VLAN 2 as the native VLAN, VLAN 20 for the administrative (admin) department, andVLAN 30 for guest users. Wireless users who belong to the admin department must connect to the AP andshould be able to connect to the admin department users on the wired network (on VLAN 20). The wirelessguest users must be able to connect to a web server that is on the wired segment on VLAN 30. A Catalyst2950 switch connects the AP to the wired network. A 2800 ISR router connects to the same switch and acts asa DHCP server for wireless clients that belong to VLAN 20 and VLAN 30. The router needs to assign IPaddresses to clients from their respective subnet. You must configure the AP, Catalyst switch, and the routerfor an implementation of this setup.Below is the list of IP addresses used for the devices in the document. All the IP addresses use /24 subnetmask名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 2 页,共 11 页 - - - - - - - - - AP Bridge-Group Virtual Interface (BVI) IP address (VLAN 2)?72.16.1.20? Wireless client (SSID Admin) that connects to VLAN 20 gets an IP address from the DHCP server ofthe router from the subnet 172.16.2.0? Wireless client (SSID Guest) that connects to VLAN 30 gets an IP address from the DHCP server ofthe router from the subnet 172.16.3.0? Admin user on the wired network on VLAN 20?72.16.2.60 (Static IP)? Web server on VLAN 30?72.16.3.60 (Static IP)? Sub-interface of the router in VLAN 2?72.16.1.1? Sub-interface of the router in VLAN 20?72.16.2.1? Sub-interface of the router in VLAN 30?72.16.3.1? ConfigureIn this section, you are presented with the information to configure the features described in this document.Note: Use the Command Lookup Tool ( registered customers only) to find more information on the commandsused in this document.In order to configure the AP to connect to a specific VLAN, you must configure the service set identifier(SSID) to recognize the VLAN. Either a VLAN ID or a name identifies a VLAN. Therefore, if you configurethe SSID on an AP to recognize a specific VLAN ID or name, you can establish a connection to the VLAN.After establishment of the connection, the wireless clients that connect to the AP with use of the specific SSIDare assigned to that VLAN. Because you can configure up to 16 SSIDs on an AP, you can create 16 VLANson an AP. In order to configure VLANs on APs and establish connectivity, you must complete these steps:Configure the native VLAN on the AP.1. Configure VLANs for the guest users and the admin users on the AP.2. Configure the Catalyst switch.3. Configure the router4. Configure the Native VLAN on the APThe VLAN, to which the Access Point itself and other infrastructure devices such as the switch, to which theaccess point connects, is called native VLAN. Native VLAN of the Access Point is usually different fromother VLANs configured on the Access Point. It is BVI interface , which is used for the management of theAccess Point that is assigned an IP address in the native VLAN subnet. The traffic, for example, managementtraffic, sent to and by the Access Point itself assumes the native VLAN, and it is untagged. All untaggedtraffic that is received on an IEEE 802.1Q (dot1q) trunk port is forwarded with the native VLAN that isconfigured for the port. If a packet has a VLAN ID that is the same as the native VLAN ID of the sendingport, the switch sends the packet without a tag. Otherwise, the switch sends the packet with a tag.In order to configure a native VLAN on an AP, issue these commands in global configuration mode on theAP:AccessPoint#interface fastethernet 0.2AccessPoint#encapsulation dot1q 2 native!- Configure the encapsulation as dot1q and assign VLAN 2 as the native VLAN !- on the Fast Ethernet interface.AccessPoint#exitAccessPoint#interface dot11radio 0.2AccessPoint#encapsulation dot1q 2 native!- Configure the encapsulation as dot1q and assign VLAN 2 as the native VLAN !- on the radio interface.名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 3 页,共 11 页 - - - - - - - - - AccessPoint#endConfigure VLANs for Guest Users and Admin Users on the APHere, you need to configure two VLANs, one for the guest users and the other for the admin department users.You also need to associate the SSID to the specific VLANs. This example configures:VLAN 20 for the admin department and uses the SSID Admin? VLAN 30 for guest users and uses the SSID Guest? In order to configure these VLANs, enter these commands in global configuration mode:AccessPoint#configure terminal!- Enter global configuration mode.AccessPoint(config)#interface dot11radio 0!- Enter radio interface configuration mode.AccessPoint(config-if)#ssid Admin!- Configure the SSID Admin.AccessPoint(config-if-ssid)#vlan 20!- Assign VLAN 20 to the SSID.AccessPoint(config-if-ssid)#authentication open!- Configure open authentication for the SSID.AccessPoint(config-if-ssid)#endAccessPoint(config) interface fastethernet 0.20!- Enter subinterface mode on the Fast Ethernet interface.AccessPoint(config-subif) encapsulation dot1Q 20!- Set the encapsulation as dot1q for VLAN 20.AccessPoint(config-subif) bridge-group 20!- Assign the subinterface to bridge group 20.AccessPoint(config-subif) exitAccessPoint(config) interface dot11radio 0.20!- Enter subinterface mode on the radio interface.AccessPoint(config-subif) encapsulation dot1Q 20!- Set the encapsulation as dot1q for VLAN 20.AccessPoint(config-subif) bridge-group 20!- Assign the subinterface to bridge group 20.AccessPoint(config-subif) exit名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 4 页,共 11 页 - - - - - - - - - Repeat the same procedure in order to configure VLAN 30 for the admin users:AccessPoint#configure terminalAccessPoint(config)#interface dot11radio 0AccessPoint(config-if)#ssid GuestAccessPoint(config-if-ssid)#vlan 30AccessPoint(config-if-ssid)#authentication openAccessPoint(config-if-ssid)#endAccessPoint(config) interface fastethernet 0.30AccessPoint(config-subif) encapsulation dot1Q 30AccessPoint(config-subif) bridge-group 30AccessPoint(config-subif) exitAccessPoint(config) interface dot11radio 0.30AccessPoint(config-subif) encapsulation dot1Q 30AccessPoint(config-subif) bridge-group 30AccessPoint(config-subif) exitNote: This document uses open authentication for both SSIDs Admin and Guest. The authentication types aretied to the SSIDs that you configure for the AP. For information on how to configure different authenticationtypes on the AP, refer to Configuring Authentication Types.Configure the Catalyst SwitchThe next step is to configure the switch ports which will connect the APs and the router to the wired network.You should configure the switch port which connects to the AP and the router as a trunk port because this portcarries traffic from all VLANs on the wireless network. In this example, the VLANs are VLAN 20, VLAN30, and the native VLAN 2. When you configure the switch port, which connects to the AP and the router,ensure that the native VLANs that you configure match the native VLAN on the AP and the router.Otherwise, frames are dropped. In order to configure the trunk port on the switch, issue these commands fromthe CLI on the switch:Note: This document uses the Catalyst 2950 switch. The configurations on the switch port can vary, whichdepends on the switch model that you use. As shown in the diagram, interface fastethernet 0/5 connects to theRouter , and interface fastethernet 0/10 connects to the Access Point.Switch#configure terminalSwitch#interface fastethernet 0/5!- Enter the interface mode for Fast Ethernet 0/5.Switch#switchport mode trunk!- Configure the switch port mode to trunk mode.Switch#switchport trunk encapsulation dot1q!- Configure the encapsulation on the switch port to dot1q.Switch#switchport trunk native vlan 2!- Configure the native VLAN as VLAN 2.Switch#switchport trunk allowed vlan add 2,20,30!- Configure the list of VLANs that are allowed on the trunk port.Switch#switchport nonegotiate名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 5 页,共 11 页 - - - - - - - - - Switch#configure terminalSwitch#interface fastethernet 0/10!- Enter the interface mode for Fast Ethernet 0/10Switch#switchport mode trunk!- Configure the switch port mode to trunk mode.Switch#switchport trunk encapsulation dot1q!- Configure the encapsulation on the switch port to dot1q.Switch#switchport trunk native vlan 2!- Configure the native VLAN as VLAN 2.Switch#switchport trunk allowed vlan add 2,20,30!- Configure the list of VLANs that are allowed on the trunk port.Switch#switchport nonegotiateNote: Cisco IOS Software-based Aironet wireless equipment does not support Dynamic Trunking Protocol(DTP). Therefore, the switch must not try to negotiate DTP.Configure the RouterThe router is configured as the DHCP server for the wireless clients in VLAN 20 and VLAN 30. The routerhas three sub-interfaces, one for each VLAN 2, 20, and 30 so that it can assign IP addresses to clients in thesubnet of their respective VLAN and perform inter-VLAN routing.Router#configure terminalRouter#interface fastethernet 0/0.2!- Configures a Sub-interface .2 on fastethernet 0/0Router#encapsulation dot1q 2 native !- configures the encapsulation as dot1q and assigns VLAN 2 to the sub-interface This command also makes VLAN 2 as the Native VLAN. Here number 2 is the VLAN-id.Router#ip address 172.16.1.1 255.255.255.0!- Assign ip address from Native VLAN 2 subnet - 172.16.1.0 /24 to the sub-interfaceRouter#exitRouter#interface fastethernet 0/0.20!- Configures a Sub-interface .20 on fastethernet 0/0Router#encapsulation dot1q 20 !- configures the encapsulation as dot1q and assigns VLAN 20 to the sub-interface Here number 20 is the VLAN-id.Router#ip address 172.16.2.1 255.255.255.0!- Assign ip address from VLAN 20 subnet - 172.16.2.0 /24 to the sub-interface Router#exitRouter#interface fastethernet 0/0.30!- Configures a Sub-interface .30 on fastethernet 0/0名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 6 页,共 11 页 - - - - - - - - - Router#encapsulation dot1q 30 !- configures the encapsulation as dot1q and assigns VLAN 30 to the sub-interface Here number 30 is the VLAN-id.Router#ip address 172.16.3.1 255.255.255.0!- Assign ip address from VLAN 30 subnet - 172.16.3.0 /24Router#exitDHCP Configuration starts hereRouter#ip dhcp excluded-address 172.16.2.1Router#ip dhcp excluded-address 172.16.3.1!- excluded-address command is used to exclude the specified ip addresses from the DHCP pool. In this case routers sub-interface addresses are excluded.Router#ip dhcp pool pool1!- Creates a DHCP pool with a name pool1 and enters the DHCP config moderouter#network 172.16.2.0 /24!- From this pool Clients are assigned ip addresses from 172.16.2.0 /24 Subnet i.e. fromrouter#default-router 172.16.2.1!- Default-gateway assigned to the client from this pool is 172.16.2.1 . Default-router iRouter#ip dhcp pool pool2!- Creates a DHCP pool with a name pool2 and enters the DHCP config moderouter#network 172.16.3.0 /24!- From this pool Clients are assigned ip addresses from 172.16.3.0 /24 Subnet i.e. fromrouter#default-router 172.16.3.1!- Default-gateway assigned to the client from this pool is 172.16.3.1 . VerifyUse this section to confirm that your configuration works properly.You can check if the configuration works as expected. The wireless client (admin user) who is configuredwith SSID Admin must get connected to VLAN 20. The same user should be able to connect to the adminuser on the wired network, which is also on the same VLAN. In order to verify, activate the wireless clientprofile for the Admin user.Note: This document does not explain how to configure the wireless client in order to set up profiles. Forinformation on how to configure the wireless client adapter, refer to Configuring the Client Adapter.名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 7 页,共 11 页 - - - - - - - - - This example window shows that the wireless client is associated to the AP:The show dot11 associations command on the AP also verifies that the client gets connected to VLAN 10:Note: The Output Interpreter Tool ( registered customers only) (OIT) supports certain show commands. Use theOIT to view an analysis of show command output.AccessPoint#show dot11 associations802.11 Client Stations on Dot11Radio0:SSID Admin :MAC Address IP address Device Name Parent State0040.96ac.e657 172.16.2.50 CB21AG/PI21AG Admin User self AssocYou can issue the show vlans command on the AP in order to display the VLANs that are configured on theAP. Here is an example:AccessPoint#show vlansVirtual LAN ID: 2 (IEEE 802.1Q Encapsulation) vLAN Trunk Interfaces: Dot11Radio0.2FastEthernet0.2This is configured as native Vlan for the following interface(s) :Dot11Radio0FastEthernet0 Protocols Configured: Address: Received: Transmitted: Bridging Bridge Group 1 1380 712 Other 0 63 0 packets, 0 bytes input 733 packets, 50641 bytes out