簡介
本檔案介紹如何在無線LAN控制器(WLC)上設定虛擬LAN(VLAN)。
必要條件
需求
此程式假設存在一個功能良好的DHCP伺服器,用於向註冊到控制器的接入點(AP)提供IP地址。
採用元件
本文中的資訊是根據特定實驗室環境內的裝置所建立。文中使用到的所有裝置皆從已清除(預設)的組態來啟動。如果您的網路運作中,請確保您瞭解任何指令可能造成的影響。
慣例
如需文件慣例的詳細資訊,請參閱思科技術提示慣例。
WLC上的動態介面
動態介面(也稱為VLAN介面)由使用者建立,設計為類似於無線LAN客戶端的VLAN。
一個控制器最多可以支援512個動態介面(VLAN)。 每個動態介面都單獨配置,並允許控制器的任何或全部分佈系統埠上存在單獨的通訊流。 每個動態介面控制控制器和所有其他網路裝置之間的VLAN和其他通訊,並且每個動態介面充當與對映到介面的無線LAN(WLAN)關聯的無線客戶端的DHCP中繼。
可以將動態介面分配給分佈系統埠、WLAN、第2層管理介面和第3層ap-manager介面。 也可以將動態介面對映到備份埠。
在分佈系統埠上配置零、一個或多個動態介面。 但是,所有動態介面必須與埠上配置的所有其他介面位於不同的VLAN或IP子網中。 如果埠未標籤,則所有動態介面必須與埠上配置的任何其他介面位於不同的IP子網上。
有關Cisco WLC平台支援的最大VLAN數的資訊,請參閱各自的Cisco WLC平台資料表。 思科建議對動態介面使用標籤的VLAN。
具有WLAN控制器的VLAN使用以下型號:
配置動態介面的先決條件
要配置控制器的動態介面,請對動態介面使用標籤的VLAN。
配置動態介面的限制
以下限制適用於控制器上動態介面的組態:
- 有線客戶端無法使用AP管理器介面的IP地址訪問Cisco 2504 WLC的管理介面。
- 對於來自配置為動態介面的子網的SNMP請求,控制器會響應,但響應不會到達發起會話的裝置。
- 如果使用DHCP代理和/或RADIUS源介面,請確保動態介面具有有效的可路由地址。不支援跨控制器介面複製或重疊的地址。
- 請勿使用ap-manager作為介面名稱來配置動態介面,因為ap-manager是保留名稱。
設定
本節提供用於設定本檔案中所述功能的資訊。
註:使用命令查詢工具(僅限已註冊客戶)查詢有關本文檔中所用命令的更多資訊。
執行Cisco IOS軟體的Catalyst交換器
w-backbone-6#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
w-backbone-6(config)#interface gigabitethernet 8/25
w-backbone-6(config-if)#switchport
w-backbone-6(config-if)#switchport trunk encapsulation dot1q
w-backbone-6(config-if)#switchport trunk native vlan 999
w-backbone-6(config-if)#switchport trunk allowed vlan 1,81,82,171,999
w-backbone-6(config-if)#switchport mode trunk
w-backbone-6(config-if)#end
w-backbone-6#
註:此處將VLAN編號999用作本徵VLAN。這表示到達WLC連線埠的未標籤流量來自VLAN 999。在本檔案中,WLC的管理連線埠具有已標籤的VLAN 1,這表示到WLC管理介面的流量會進入VLAN 1,而WLC不會使用VLAN 999。
GUI中的WLAN控制器VLAN配置
在WLAN控制器上完成以下步驟。
-
在WLC GUI中,導覽至Controller > Interfaces.
列Interfaces
在WLC上設定的所有介面的頁面。要建立新的動態介面,請按一下 New.
-
輸入Interface Name
和 VLAN Identifier,
and clickApply.
-
輸入此VLAN特定的引數。某些引數包括、IP Address
、Netmask
和Gateway
IP地址,Primary DHCP Server
然後按一下 Apply.
注意:分配給此介面的IP地址將充當DHCP中繼,客戶端可以從DHCP伺服器獲取IP地址。例如,當客戶端嘗試與對映到此動態介面的WLAN/SSID(此配置中的步驟5)關聯時,它會執行本地子網廣播以標識DHCP伺服器。控制器向DHCP伺服器傳送請求(如果它是網段的DHCP伺服器,則向自身傳送請求),並將此動態介面的IP地址作為中繼IP傳送到為此介面配置的DHCP伺服器。DHCP伺服器從配置的DHCP作用域向客戶端分配IP地址。
注意:出於技術原因,必須擁有有效的IP地址,但除非啟用DHCP代理或radius介面覆蓋(在WLAN配置下),否則不使用此IP地址。
註:介面名稱或VLAN名稱用作radius屬性(airespace-interface-name),以返回VLAN名稱而非編號。
-
驗證介面組態。按一下Controller
視窗頂部選單中的頁籤,然後從左Interfaces
側的選單中選擇。
-
按一下WLANs
視窗頂部選單中的頁籤,然後按一下Create New.
-
輸入服務集識別符號(SSID),然Profile Name
後單Apply.
擊此示例使用VLAN 81以便於理解。
-
從視窗底部的下拉選單中選擇Interface Name
VLAN 81,然後按一下Apply.
「This case, SSID Students is limited to Interface Name VLAN 81(在這種情況下,SSID學生連線到介面名稱VLAN 81)」。
CLI中的WLAN控制器VLAN組態
使用本節內容,透過指令行介面(CLI)設定VLAN。
- 建立介面和關聯的VLAN標籤。命令是
config interface create
interface_name vlan_id。
(W-8540-1) >config interface create "VLAN 81" 81
註:如果VLAN/WLAN名稱中有空格(如本例所示),請確保該名稱用引號表示。
- 定義IP地址和預設網關。命令是
config interface
interface_nameIP_addressnetmaskgateway。
(W-8540-1) >config interface address dynamic-interface "VLAN 81" 192.168.81.46 255.255.255.0 192.168.81.1
- 定義DHCP伺服器。命令是
config interface dhcp dynamic-interface
<interface-name>primary
<primary-server>[secondary]
<secondary-server>。
(W-8540-1) >config interface dhcp dynamic-interface "VLAN 81" primary 10.48.39.5
- 發出此命令,將介面對應到實體連線埠:
config interface port
operator_defined_interface_name physical_ds_port_number。
(W-8540-1) >config interface port "VLAN 81" 1
- 驗證介面組態。命令如下
show interface summary.
(W-8540-1) >show interface summary
Number of Interfaces.......................... 8
Interface Name Port Vlan Id IP Address Type Ap Mgr Guest
-------------------------------- ---- -------- --------------- ------- ------ -----
171 1 171 192.168.171.30 Dynamic No No
management 1 1 10.48.39.46 Static Yes No
redundancy-management 1 1 10.48.39.52 Static No No
redundancy-port - untagged 172.16.39.52 Static No No
service-port N/A N/A 0.0.0.0 DHCP No No
virtual N/A N/A 10.2.3.4 Static No No
vlan 81 1 81 192.168.81.46 Dynamic No No
vlan 82 1 82 192.168.82.46 Dynamic No No
- 定義WLAN。命令是
config wlan create
wlan_idname。
(W-8540-1) >config wlan create 2 Students Students
- 定義WLAN的介面。命令是
config wlan interface
wlan_idinterface_name。
(W-8540-1) >config wlan interface 2 "vlan 81"
- 驗證WLAN和關聯的介面。命令如下
show wlan summary.
(W-8540-1) >show wlan summary
.
Number of WLANs.................................. 2
WLAN ID WLAN Profile Name / SSID Status Interface Name PMIPv6 Mobility
------- ------------------------------------- -------- -------------------- ---------------
1 self-anchor / self-anchor Disabled management none
2 Students / Students Enabled vlan 81 none
(W-8540-1) >
驗證
使用本節內容,確認您的組態是否正常運作。
Catalyst交換器驗證
-
執行Cisco IOS軟體的Catalyst交換器show running-config interface
: interface_type interface_number。
w-backbone-6k#show running-config interface gigabitethernet 2/1
Building configuration...
Current configuration : 190 bytes
!
interface GigabitEthernet2/1
no ip address
switchport
switchport trunk encapsulation dot1q
switchport trunk native vlan 999
switchport trunk allowed vlan 1,81,82,171,999
switchport mode trunk
end
WLAN控制器VLAN驗證
- 驗證介面組態。命令如下
show interface summary.
(W-8540-1) >show interface summary
Number of Interfaces.......................... 8
Interface Name Port Vlan Id IP Address Type Ap Mgr Guest
-------------------------------- ---- -------- --------------- ------- ------ -----
171 1 171 192.168.171.30 Dynamic No No
management 1 1 10.48.39.46 Static Yes No
redundancy-management 1 1 10.48.39.52 Static No No
redundancy-port - untagged 172.16.39.52 Static No No
service-port N/A N/A 0.0.0.0 DHCP No No
virtual N/A N/A 10.2.3.4 Static No No
vlan 81 1 81 192.168.81.46 Dynamic No No
vlan 82 1 82 192.168.82.46 Dynamic No No
- 驗證WLAN和關聯的介面。命令如下
show wlan summary.
(W-8540-1) >show wlan summary
Number of WLANs.................................. 2
WLAN ID WLAN Profile Name / SSID Status Interface Name PMIPv6 Mobility
------- ------------------------------------- -------- -------------------- ---------------
1 self-anchor / self-anchor Disabled management none
2 Students / Students Enabled vlan 81 none
(W-8540-1) >
疑難排解
使用本節內容,對組態進行疑難排解。
疑難排解程式
完成以下說明以對您的配置進行故障排除。
-
從WLAN控制器Ping VLAN路由介面上設定的預設閘道,然後反向執行Ping。
-
WLAN控制器:
(W-8540-1) >ping 192.168.81.1
Send count=3, Receive count=3 from 192.168.81.1
(W-8540-1) >
-
VLAN路由介面:
w-backbone-6k#ping 192.168.81.46
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.81.46, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms
w-backbone-6k#
-
如果ping不成功,請在交換器上部署封包擷取/監聽器並進行檢查,以驗證是否具有正確的VLAN標籤。
註:從控制器向第3層網關(與動態介面位於同一子網上)發起ping時,控制器似乎會從動態介面發出ping。