ensp配置旁挂三层组网示例【OSPF+两个无线网络WPAPSK认证+DHCP】一、业务需求1、路由使用OSPF，Vlan的网关配置在LSW1上。2、WLan采用三层组网、AC旁挂模式。3、创建两个无线网络，分别为ycu和guest，其中ycu网络的密码为“username”，业务数据采用直接转发模式；guest网络的密码为guest，业务数据采用隧道转发模式。4、DHCP配置在AC上，给AP使用的DHCP名为ap，给ycu使用的DHCP名为ycu，给guest使用的DHCP名为guest。5、配置AP1的2.4G频段使用信道1,5G频段使用信道149；配置AP2的2.4G频段使用信道6,5G频段使用信道36.6、无线终端STA1连接ycu网络，无线终端STA2连接guest网络，和PC1之间可以互相ping通。二、组网规划1、AC组网方式：旁挂三层组网。2、业务数据转发方式：ycu为直接转发，guest为隧道转发。3、DHCP部署方式：AC作为DHCP服务器为AP和STA分配IP地址。4、AP管理：VLAN 50，网段为10.10.25.0/24。5、ycu网络：VLAN 51，SSID为“ycu”，密码为“username”。6、guest网络：VLAN 52，SSID为“guest”，密码为“guest”。AC与AP建立管理隧道的源接口：AC上的VLANIF2。AC与汇聚交换机三层互联的接口：VLANIF2。LSW1交换机与出口网关（AR1）互联的接口：VLANIF三、地址规划四、拓扑图五、基本配置1、AC基本属性：型号：AC6005组网方式：三层组网旁挂业务数据转发方式：ycu为直接转发，guest为隧道转发DHCP部署：VLAN51网段给ycu分配地址，VLAN52网段给guest分配地址两个无线网络：SSID：ycu 密码：username2021 SSID：guest 密码：guest2021管理源接口：VLAN50管理模板：domain12、AP认证配置：AP认证方式为mac地址认证3、AP组：创建了一个AP组：ap-group14、SSID模板：SSID：ycu 密码：username2021 SSID：guest 密码：guest20215、VAP模板：vap-profile name ycu 与 vap-profile name guest六、操作步骤1、配置流程说明（1）配置LSW2和LSW3两个二层交换机：配置好vlan和接口。（2）配置LSW1汇聚三层交换机：配置vlan、接口、vlanif、ospf（3）配置ACL：配置vlan、接口、vlanif、dhcp、ap组、domain管理模板、源接口、ap的mac认证、创建ssid模板，创建vap模板、创建安全模板、将安全模板应用到vap模板上、关闭自动调频，手动配置ap频段信道、配置AP组引用域管理模板和vap模板。（4）配置AR1：配置端口IP，开启ospf。（5）配置AR2：配置端口IP，开启ospf。（6）配置PC1：配置IP地址和网关。2、配置LSW1<Huawei>sys 关闭提示 [Huawei]undo info enable 改名字 [Huawei]sys LSW1 创建vlan50到53 [LSW1]vlan batch 50 to 53 进入接口0/0/4 [LSW1]inter g 0/0/4 配置trunk以及允许通过vlan [LSW1-GigabitEthernet0/0/4]port link-type trunk [LSW1-GigabitEthernet0/0/4]port trunk allow-pass vlan 50 to 52 [LSW1]inter g 0/0/3 配置trunk以及允许通过vlan [LSW1-GigabitEthernet0/0/4]inter g 0/0/3 [LSW1-GigabitEthernet0/0/3]port link-type trunk [LSW1-GigabitEthernet0/0/3]port trunk allow-pass vlan 50 to 52 [LSW1]inter g 0/0/2 配置trunk以及允许通过vlan [LSW1-GigabitEthernet0/0/3]inter g 0/0/2 [LSW1-GigabitEthernet0/0/2]port link-type trunk [LSW1-GigabitEthernet0/0/2]port trunk allow-pass vlan 50 to 52 [LSW1-GigabitEthernet0/0/2]q 配置vlanif地址 [LSW1]inter vlan50 [LSW1-Vlanif50]ip add 10.10.25.1 24 [LSW1-Vlanif50]inter vlan51 [LSW1-Vlanif51]ip add 10.10.26.1 24 [LSW1-Vlanif51]inter vlan52 [LSW1-Vlanif52]ip add 10.10.27.1 24 [LSW1]inter vlan 53 [LSW1-Vlanif53]ip add 10.10.28.1 24 [LSW1-Vlanif53]q [LSW1]inter g 0/0/0 配置access以及允许通过vlan [LSW1]inter g 0/0/1 [LSW1-GigabitEthernet0/0/1]port link-type access [LSW1-GigabitEthernet0/0/1]port default vlan 53 配置ospf [LSW1]ospf [LSW1-ospf-1]area 0 [LSW1-ospf-1-area-0.0.0.0]network 10.10.25.0 0.0.0.255 [LSW1-ospf-1-area-0.0.0.0]network 10.10.26.0 0.0.0.255 [LSW1-ospf-1-area-0.0.0.0]network 10.10.27.0 0.0.0.255 [LSW1-ospf-1-area-0.0.0.0]network 10.10.28.0 0.0.0.2553、配置交换机LSW2进入系统视图 <Huawei>sys 改名字 [Huawei]sys LSW2 关闭提示 [LSW2]undo info enable 创建vlan50到52 [LSW2]vlan batch 50 to 52 进入接口e 0/0/2 配置trunk和允许通过的vlan [LSW2]inter e0/0/2 [LSW2-Ethernet0/0/2]port link-type trunk [LSW2-Ethernet0/0/2]port trunk allow-pass vlan 50 to 52 [LSW2-Ethernet0/0/2]port trunk pvid vlan 50 进入接口e 0/0/1 配置trunk和允许通过的vlan [LSW2]inter e 0/0/1 [LSW2-Ethernet0/0/1]port link-type trunk [LSW2-Ethernet0/0/1]port trunk allow-pass vlan 50 to 524、配置交换机LSW3进入系统视图 <Huawei>sys 关闭提示 [Huawei]undo info enable 改名字 [Huawei]sys LSW3 创建vlan50到52 [LSW3]vlan batch 50 to 52 进入接口e 0/0/2 配置trunk和允许通过的vlan [LSW3]inter e 0/0/2 [LSW3-Ethernet0/0/2]port link-type trunk [LSW3-Ethernet0/0/2]port trunk allow-pass vlan 50 to 54 [LSW3-Ethernet0/0/2]port trunk pvid vlan 50 进入接口e 0/0/1 配置trunk和允许通过的vlan [LSW3-Ethernet0/0/2]inter e 0/0/1 [LSW3-Ethernet0/0/1]port link-type trunk [LSW3-Ethernet0/0/1]port trunk allow-pass vlan 50 to 54 [LSW3-Ethernet0/0/1]q5、配置交换机LSW4无配置6、配置路由器AR1进入系统视图 <Huawei>sys 关闭提示 [Huawei]undo info enable 改名字 [Huawei]sys AR1 进入g 0/0/0端口，配置网关 [AR1]inter g 0/0/0 [AR1-GigabitEthernet0/0/0]ip add 10.10.29.1 24 [AR1]inter g0/0/1 进入g 0/0/1端口，配置网关 [AR1-GigabitEthernet0/0/1]ip add 10.10.28.2 24 [AR1-GigabitEthernet0/0/1]q 配置ospf [AR1]ospf [AR1-ospf-1]area 0 [AR1-ospf-1-area-0.0.0.0]network 10.10.28.0 0.0.0.255 [AR1-ospf-1-area-0.0.0.0]network 10.10.29.0 0.0.0.2557、配置路由器AR2进入系统视图 <Huawei>sys 关闭提示 [Huawei]undo info enable 改名字 [Huawei]sys AR2 进入g 0/0/0端口，配置网关 [AR2]inter g 0/0/0 [AR2-GigabitEthernet0/0/0]ip add 10.10.29.2 24 进入g 0/0/1端口，配置网关 [AR2-GigabitEthernet0/0/0]inter g 0/0/1 [AR2-GigabitEthernet0/0/1]ip add 10.10.30.1 24 [AR2-GigabitEthernet0/0/1]q 配置ospf [AR2]ospf [AR2-ospf-1]area 0 [AR2-ospf-1-area-0.0.0.0]network 10.10.29.0 0.0.0.255 [AR2-ospf-1-area-0.0.0.0]network 10.10.30.0 0.0.0.2558、配置 AC 基础信息创建vlan50到52 [ACL]vlan batch 50 to 52 进入g 0/0/0 配置trunk和允许通过vlan [ACL]inter g 0/0/1 [ACL-GigabitEthernet0/0/1]port link-type trunk [ACL-GigabitEthernet0/0/1]port trunk allow-pass vlan 50 to 52 [ACL-GigabitEthernet0/0/1]inter vlan50 配置vlanif地址 [ACL-Vlanif50]ip add 10.10.25.2 24 [ACL-Vlanif50]inter vlan 51 [ACL-Vlanif51]ip add 10.10.26.2 24 [ACL-Vlanif51]inter vlan 52 [ACL-Vlanif52]ip add 10.10.27.2 24 [ACL-Vlanif52]q9、创建 AP 组[ACL-wlan-view]ap-group name ap-group110、配置AC的DHCP开启dhcp [ACL]dhcp enable 创建地址池ap [ACL]ip pool ap [ACL-ip-pool-ap]network 10.10.25.0 mask 24 [ACL-ip-pool-ap]gateway-list 10.10.25.1 [ACL-ip-pool-ap]q 创建地址池ycu [ACL]ip pool ycu [ACL-ip-pool-ycu]network 10.10.26.0 mask 24 [ACL-ip-pool-ycu]gateway-list 10.10.26.1 [ACL-ip-pool-ycu]q 创建地址池guest [ACL]ip pool guest [ACL-ip-pool-guest]network 10.10.27.0 mask 24 [ACL-ip-pool-guest]gateway-list 10.10.27.1 [ACL-ip-pool-guest]q 进入vlanif，开启dhcp [ACL]inter vlan50 [ACL-Vlanif50]dhcp select global [ACL-Vlanif50]inter vlan51 [ACL-Vlanif51]dhcp select global [ACL-Vlanif51]inter vlan 52 [ACL-Vlanif52]dhcp select global11、配置AC domain管理模板[ACL]wlan [ACL-wlan-view]regulatory-domain-profile name domain1 [ACL-wlan-regulate-domain-domain1]country-code CN 12、配置AC源接口[ACL]capwap source interface Vlanif 5013、配置AC ap的mac认证[ACL]wlan [ACL-wlan-view]ap auth-mode mac-auth 配置ap的mac地址认证，命名ap-id [ACL-wlan-view]ap-mac 00E0-FC11-33A0 ap-id 1 分组到ap-group1 [ACL-wlan-ap-1]ap-group ap-group1 命名ap1 [ACL-wlan-ap-1]ap-name ap1 [ACL-wlan-ap-1]q 配置ap的mac地址认证，命名ap-id [ACL-wlan-view]ap-mac 00E0-FC41-3ED0 ap-id 2 分组到ap-group1 [ACL-wlan-ap-2]ap-group ap-group1 命名ap1 [ACL-wlan-ap-2]ap-name ap2 [ACL-wlan-ap-2]q14、创建AC的ssid模板[ACL-wlan-view]ssid-profile name ycu [ACL-wlan-ssid-prof-ycu]ssid ycu [ACL-wlan-ssid-prof-ycu]q [ACL-wlan-view]ssid-profile name guest [ACL-wlan-ssid-prof-guest]ssid guest [ACL-wlan-ssid-prof-guest]q15、创建AC的vap模板[ACL-wlan-view]vap-profile name ycu 配置ycu为直接转发 [ACL-wlan-vap-prof-ycu]forward-mode direct-forward [ACL-wlan-vap-prof-ycu]service-vlan vlan-id 51 [ACL-wlan-vap-prof-ycu]ssid-profile ycu [ACL-wlan-view]vap-profile name guest 配置guest为隧道转发 [ACL-wlan-vap-prof-guest]forward-mode tunnel [ACL-wlan-vap-prof-guest]service-vlan vlan-id 52 [ACL-wlan-vap-prof-guest]q [ACL-wlan-view]vap-profile name guest [ACL-wlan-vap-prof-guest]ssid-profile guest16、创建AC安全模板[ACL-wlan-view]security-profile name ycu [ACL-wlan-sec-prof-ycu]security wpa psk pass-phrase username2021 tkip [ACL-wlan-sec-prof-ycu]q [ACL-wlan-view]security-profile name guest [ACL-wlan-sec-prof-guest]security wpa psk pass-phrase guest2021 tkip [ACL-wlan-sec-prof-guest]q17、将安全模板应用到vap模板上ACL-wlan-view]vap-profile name ycu [ACL-wlan-vap-prof-ycu]security-profile ycu [ACL-wlan-vap-prof-ycu]q [ACL-wlan-view]vap-profile name guest [ACL-wlan-vap-prof-guest]security-profile guest18、关闭自动调频[ACL-wlan-view]rrm-profile name default [ACL-wlan-rrm-prof-default]calibrate auto-channel-select disable [ACL-wlan-rrm-prof-default]calibrate auto-txpower-select disable 19、手动配置ap频段信道[ACL]wlan [ACL-wlan-view]ap-id 1 [ACL-wlan-ap-1]radio 0 [ACL-wlan-radio-1/0]channel 20mhz 1 [ACL-wlan-radio-1/0]radio 1 [ACL-wlan-radio-1/1]channel 20mhz 149 [ACL-wlan-radio-1/1]q [ACL-wlan-ap-1]q [ACL-wlan-view]ap-id 2 [ACL-wlan-ap-2]radio 0 [ACL-wlan-radio-2/0]channel 20mhz 6 [ACL-wlan-radio-2/0]radio 1 [ACL-wlan-radio-2/1]channel 20mhz 3620、配置AP组引用域管理模板和vap模板[ACL-wlan-view]ap-group name ap-group1 [ACL-wlan-ap-group-ap-group1]vap-profile ycu wlan 1 radio all [ACL-wlan-ap-group-ap-group1]vap-profile guest wlan 2 radio all [ACL-wlan-ap-group-ap-group1]regulatory-domain-profile domain121、开启AC的ospf[ACL-ospf-1]area 0 [ACL-ospf-1-area-0.0.0.0]network 10.10.25.0 0.0.0.255 [ACL-ospf-1-area-0.0.0.0]network 10.10.26.0 0.0.0.255 [ACL-ospf-1-area-0.0.0.0]network 10.10.27.0 0.0.0.255七、结果验证1、查看 VAP 状态2、display station all3、display radio ap-id 14、display radio ap-id 25、dis ap all6、dis ip pool name ycu7、dis ip pool name guest8、dis ip routing-table9、STA1 ping PC1PC1 ping STA110、STA2 ping PC1PC1 ping STA2八、后记这个实验是很久之前做的了，当时肝了好久，也遇到很多问题，请各位看客海涵，有问题建议可以留下宝贵的评论。