华为旁挂二层组网-隧道转发
来源:原创
时间:2024-04-12
作者:脚本小站
分类:网络
R1:
<Huawei>system-view [Huawei]sysname R1 [R1]interface GigabitEthernet 0/0/0 [R1-GigabitEthernet0/0/0]ip address 192.168.111.1 24 [R1-GigabitEthernet0/0/0]quit [R1]ip route-static 192.168.0.0 16 192.168.111.2
S1:
[S1]sysname S1 [S1]vlan batch 100 111 110 [S1]interface Vlanif 111 [S1-Vlanif111]ip address 192.168.111.2 24 [S1]interface Vlanif 110 [S1-Vlanif110]ip address 192.168.110.1 24 [S1]int GigabitEthernet 0/0/1 [S1-GigabitEthernet0/0/1]port link-type access [S1-GigabitEthernet0/0/1]port default vlan 111 [S1-GigabitEthernet0/0/1]int GigabitEthernet 0/0/3 [S1-GigabitEthernet0/0/3]port link-type trunk [S1-GigabitEthernet0/0/3]port trunk pvid vlan 100 [S1-GigabitEthernet0/0/3]port trunk allow-pass vlan 100 110 [S1]interface GigabitEthernet 0/0/2 [S1-GigabitEthernet0/0/2]port link-type access [S1-GigabitEthernet0/0/2]port default vlan 100 [S1]ip route-static 0.0.0.0 0 192.168.111.1 [S1]ip route-static 192.168.0.0 16 192.168.110.2
AC1:
[AC6005]sysname AC1 [AC1]vlan batch 100 110 101 102 [AC1]interface GigabitEthernet 0/0/1 [AC1-GigabitEthernet0/0/1]port link-type trunk [AC1-GigabitEthernet0/0/1]port trunk pvid vlan 100 [AC1-GigabitEthernet0/0/1]port trunk allow-pass vlan 100 110 [AC1]int Vlanif 100 [AC1-Vlanif100]ip address 192.168.100.1 24 [AC1]int Vlanif 101 [AC1-Vlanif101]ip address 192.168.101.1 24 [AC1]int Vlanif 102 [AC1-Vlanif102]ip address 192.168.102.1 24 [AC1]int Vlanif 110 [AC1-Vlanif110]ip address 192.168.110.2 24 [AC1]ip route-static 0.0.0.0 0 192.168.110.1
开启dhcp:
[AC1]dhcp enable [AC1]ip pool vlan100 [AC1-ip-pool-vlan100]network 192.168.100.0 ma [AC1-ip-pool-vlan100]network 192.168.100.0 mask 24 [AC1-ip-pool-vlan100]gateway-list 192.168.100.1 [AC1]ip pool vlan101 [AC1-ip-pool-vlan101]network 192.168.101.0 mask 24 [AC1-ip-pool-vlan101]gateway-list 192.168.101.1 [AC1-ip-pool-vlan101]dns-list 114.114.114.114 [AC1]ip pool vlan102 [AC1-ip-pool-vlan102]network 192.168.102.0 mask 24 [AC1-ip-pool-vlan102]gateway-list 192.168.102.1 [AC1-ip-pool-vlan102]dns-list 114.114.114.114 [AC1]interface Vlanif 100 [AC1-Vlanif100]dhcp select global [AC1]interface Vlanif 101 [AC1-Vlanif101]dhcp select global [AC1]interface Vlanif 102 [AC1-Vlanif102]dhcp select global
AP上查看获取到的地址:
[Huawei]display ip in brief Interface IP Address/Mask Physical Protocol NULL0 unassigned up up(s) Vlanif1 192.168.100.155/24 up up
AC1:
[AC1]capwap source interface Vlanif 100 [AC1-wlan-view] [AC1-wlan-view]regulatory-domain-profile name default [AC1-wlan-regulate-domain-default]country-code cn
创建ap组:
[AC1-wlan-view]ap-group name ap-office1 [AC1-wlan-ap-group-ap-office1]regulatory-domain-profile default onfigurations of the radio and reset the AP. Continue?[Y/N]:y [AC1-wlan-view]ap-group name ap-office2 [AC1-wlan-ap-group-ap-office2]regulatory-domain-profile default onfigurations of the radio and reset the AP. Continue?[Y/N]:y [AC1-wlan-view]ap-id 1 ap-mac 00e0-fc11-5890 [AC1-wlan-ap-1]ap-name ap1 [AC1-wlan-ap-1]ap-group ap-office1 ontinue? [Y/N]:y [AC1-wlan-ap-1]ap-id 2 ap-mac 00ec-fcee-5f10 [AC1-wlan-ap-2]ap-name ap2 [AC1-wlan-ap-2]ap-group ap-office1 ontinue? [Y/N]:y [AC1-wlan-ap-2]ap-id 3 ap-mac 00ec-fc34-1ad0 [AC1-wlan-ap-3]ap-name ap3 [AC1-wlan-ap-3]ap-group ap-office2 ontinue? [Y/N]:y [AC1-wlan-ap-3]ap-id 4 ap-mac 00e0-fcae-6a60 [AC1-wlan-ap-4]ap-name ap4 [AC1-wlan-ap-4]ap-group ap-office2 ontinue? [Y/N]:y
SSID模版:
[AC1-wlan-view]ssid-profile name ssid-office1 [AC1-wlan-ssid-prof-ssid-office1]ssid ap-office1 [AC1-wlan-view] [AC1-wlan-view]ssid-profile name ssid-office2 [AC1-wlan-ssid-prof-ssid-office2]ssid ap-office2 查看SSID模版: [AC1-wlan-view]display ssid-profile all ------------------------------------------------------------------- Profile name Reference ------------------------------------------------------------------- default 1 ssid-office1 0 ssid-office2 0 -------------------------------------------------------------------
安全模版:
[AC1]wlan [AC1-wlan-view]security-profile name sec-office1 [AC1-wlan-sec-prof-sec-office1]security wpa-wpa2 psk pass-phrase a1234567 aes [AC1-wlan-view]security-profile name sec-office2 [AC1-wlan-sec-prof-sec-office2]security wpa-wpa2 psk pass-phrase b1234567 aes 查看安全模版: [AC1-wlan-view]display security-profile all ------------------------------------------------------------ Profile name Reference ------------------------------------------------------------ default 1 default-wds 1 default-mesh 1 sec-office1 0 sec-office2 0 ------------------------------------------------------------ Total: 5
配置VAP模版:
[AC1-wlan-view] [AC1-wlan-view]vap-profile name vap-office1 [AC1-wlan-vap-prof-vap-office1]forward-mode tunnel [AC1-wlan-vap-prof-vap-office1]service-vlan vlan-id 101 [AC1-wlan-vap-prof-vap-office1]ssid-profile ssid-office1 [AC1-wlan-vap-prof-vap-office1]security-profile sec-office1 [AC1-wlan-view]vap-profile name vap-office2 [AC1-wlan-vap-prof-vap-office2]forward-mode tunnel [AC1-wlan-vap-prof-vap-office2]service-vlan vlan-id 102 [AC1-wlan-vap-prof-vap-office2]ssid-profile ssid-office2 [AC1-wlan-vap-prof-vap-office2]security-profile sec-office2 [AC1-wlan-view]display vap-profile all -------------------------------------------------------------------------------- Profile name Reference -------------------------------------------------------------------------------- default 0 vap-office1 0 vap-office2 0 -------------------------------------------------------------------------------- Total: 3
AP中应用VAP模版:
[AC1-wlan-view]ap-group name ap-office1 [AC1-wlan-ap-group-ap-office1]vap-profile vap-office1 wlan 1 radio 0 [AC1-wlan-ap-group-ap-office1]vap-profile vap-office1 wlan 1 radio 1 [AC1-wlan-ap-group-ap-office1]ap-group name ap-office2 [AC1-wlan-ap-group-ap-office2]vap-profile vap-office2 wlan 1 radio 0 [AC1-wlan-ap-group-ap-office2]vap-profile vap-office2 wlan 1 radio 1 [AC1-wlan-view]display ap-group all -------------------------------------------------------------------------------- Name APs -------------------------------------------------------------------------------- ap-office1 2 ap-office2 2 default 0 -------------------------------------------------------------------------------- Total: 3
AP不生效undo再加一次:
[AC1-wlan-view]undo ap ap-id 3 Warning: Deleting the AP will interrupt user services. Continue?[Y/N]:y Info: Now starting to delete AP(s).done. 将AP设备加入到ap-group中 [AC1-wlan-view]ap-id 2 ap-mac 00e0-fcee-5f10 [AC1-wlan-ap-2]ap-group ap-office1 ontinue? [Y/N]:y [AC1-wlan-ap-2]ap-name ap2 # 起个名字
查看AP:
[AC1-wlan-view]display ap all Info: This operation may take a few seconds. Please wait for a moment.done. Total AP information: nor : normal [4] --------------------------------------------------------------------------------------------------- ID MAC Name Group IP Type State STA Uptime --------------------------------------------------------------------------------------------------- 1 00e0-fc11-5890 ap1 ap-office1 192.168.100.155 AP2050DN nor 1 3H:58M:36S 2 00e0-fcee-5f10 ap2 ap-office1 192.168.100.195 AP2050DN nor 0 20M:0S 3 00e0-fc34-1ad0 ap3 ap-office2 192.168.100.236 AP2050DN nor 0 2M:32S 4 00e0-fcae-6a60 ap4 ap-office2 192.168.100.36 AP2050DN nor 1 3H:46M:22S --------------------------------------------------------------------------------------------------- Total: 4
查看连接的设备:
[AC1-wlan-view]display station all Rf/WLAN: Radio ID/WLAN ID Rx/Tx: link receive rate/link transmit rate(Mbps) ------------------------------------------------------------------------------------------------------- STA MAC AP ID Ap name Rf/WLAN Band Type Rx/Tx RSSI VLAN IP address SSID ------------------------------------------------------------------------------------------------------- 5489-9841-5b2d 4 ap4 1/1 5G 11a 0/0 - 102 192.168.102.177 ap-office2 5489-9883-42c7 1 ap1 1/1 5G 11a 0/0 - 101 192.168.101.130 ap-office1 ------------------------------------------------------------------------------------------------------- Total: 2 2.4G: 0 5G: 2