华为ensp的Wlan无线配置(基于实际项目)

拓扑图如下,如果有什么不懂的或者是配置出错的话请评论,也有可能是我复制命令行漏了或者是错了。

补充1:AC中配置的WiFi密码一定要记住,不然忘记了的只能重新改了的,我也不知道怎么知道那个WiFi密码,图形化界面试了也找不到可以直接看出WiFi密码,命令行的也是。比如给你管理一个园区网,你没有连接过的设备,也不知道密码,更不能改密码,你只能有权限登录AC,所以怎么知道密码呢?欢迎大神们评论区回复。

补充2:我的这个是用静态路由弄通的网络,如果能够用OSPF动态路由来实现互通那就很好了,项目中的都是用的OSPF的。

补充3:可以的话,再在汇聚交换机上做个ACL让连接guest的无线用户无法访问服务器或者是内网的资源,只可以访问外网,work只能够访问内网或者是既可以访问外网和内网,但是不能访问服务器或者是相关的安全相关的。

补充4:这次的实验拓扑的AP和无线用户太少了我没有用到地址池来,正常来说一个园区网的话可能有几百个AP,所以你一个段是不可能实现的,要多个网段给AP分配管理的IP地址才可以,其次无线用户的地址池也是一样,应该要多个地址池才行,比如一个段容纳500个用户,要5个这样子的用户地址池或者是更多才可以,具体看你管的园区有多少的无线用户,还有无线用户的IP地址的租约为1个小时就可以了的,还要限制用户的网速,无线用户的外网的网速为200兆,内网的不限速。另外可以做认证的话最好不过了,输入用户名和密码进行上网,会这样子的话更好,你可以不用,但是你得会。

核心配置为AC无线控制器的配置,要点如图所示:

弄清楚这个基本上就没有问题的了,我之前也是懵,但是弄清楚了才发现也不难的。

注意!注意!注意!你们不要照抄我的AP的Mac地址,Mac地址都是不一样的,所以你们不注意的话,可能会出错的。查看设备的Mac地址,在AP上输入dis interface Vlanif 1,即可看到AP的Mac地址了。最好是你建好拓扑图了就把AP的Mac地址写在旁边,就像和我的一样。

拓扑图中的设备配置脚本如下,设备开启之后直接复制粘贴即可,但是一定要和我的拓扑图一样,特别是设备的接口。

AR4:

sys
sysname AR4
undo info-center enable
interface GigabitEthernet0/0/0
ip address 200.1.1.2 255.255.255.0 
quit
interface LoopBack0
ip address 9.9.9.9 255.255.255.255 
quit


AR2:

sys
sysname AR2
undo info-center enable
acl number 2000  
rule 201 permit source 192.168.201.0 0.0.0.255 
rule 202 permit source 192.168.202.0 0.0.0.255 
interface LoopBack0
ip address 8.8.8.8 255.255.255.255 
quit
interface GigabitEthernet0/0/1
ip address 100.1.1.2 255.255.255.252 
quit
interface GigabitEthernet0/0/0
ip address 200.1.1.1 255.255.255.252 
nat outbound 2000
quit
ip route-static 0.0.0.0 0.0.0.0 200.1.1.2
ip route-static 192.168.201.0 255.255.255.0 100.1.1.1
ip route-static 192.168.202.0 255.255.255.0 100.1.1.1
quit

核心交换机:

sys
sysname HX
undo info-center enable
dhcp enable
vlan batch 99 to 100
interface Vlanif99
ip address 172.16.99.2 255.255.255.252
quit
interface Vlanif100
ip address 100.1.1.1 255.255.255.252
quit
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 4094
quit
interface GigabitEthernet0/0/2
port link-type access
port default vlan 100
quit
ip route-static 0.0.0.0 0.0.0.0 100.1.1.2
ip route-static 192.168.201.0 255.255.255.0 172.16.99.1
ip route-static 192.168.202.0 255.255.255.0 172.16.99.1
quit


汇聚交换机:

sys
sysname HJ
undo info-center enable
dhcp enable
vlan batch 70 80 99 200 to 203
interface Vlanif70
 ip address 172.16.70.2 255.255.255.0
quit
interface Vlanif80
 ip address 172.16.80.254 255.255.255.0
 dhcp select relay
 dhcp relay server-ip 172.16.70.1
quit
interface Vlanif99
 ip address 172.16.99.1 255.255.255.252
quit
interface Vlanif200
ip address 192.168.200.253 255.255.255.0
quit
interface Vlanif201
ip address 192.168.201.254 255.255.255.0
dhcp select relay
dhcp relay server-ip 172.16.70.1
quit
interface Vlanif202
ip address 192.168.202.254  255.255.255.0
dhcp select relay
dhcp relay server-ip 172.16.70.1
quit
interface GigabitEthernet0/0/1
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
quit
interface GigabitEthernet0/0/2
 port link-type trunk
 port trunk allow-pass vlan 200 to 201
quit
interface GigabitEthernet0/0/3
 port link-type trunk
 port trunk allow-pass vlan 80 200 202
quit
interface GigabitEthernet0/0/4
 port link-type trunk
 port trunk allow-pass vlan 200 to 201
quit
interface GigabitEthernet0/0/5
 port link-type access
 port default vlan 70
quit
ip route-static 0.0.0.0 0.0.0.0 172.16.99.2
quit


DHCP服务器:

sys
sysname DHCP
undo info-center enable
dhcp enable
ip pool vlan201
 gateway-list 192.168.201.254 
 network 192.168.201.0 mask 255.255.255.0 
 excluded-ip-address 192.168.201.250 192.168.201.253 
 dns-list 223.5.5.5 
quit
ip pool vlan202
 gateway-list 192.168.202.254 
 network 192.168.202.0 mask 255.255.255.0 
 excluded-ip-address 192.168.202.250 192.168.202.253 
 dns-list 180.76.76.76 
quit
ip pool vlan80
 gateway-list 172.16.80.254 
 network 172.16.80.0 mask 255.255.255.0 
 excluded-ip-address 172.16.80.250 172.16.80.253 
 dns-list 114.114.114.114 
quit
interface GigabitEthernet0/0/1
 ip address 172.16.70.1 255.255.255.0 
 dhcp select global
quit
ip route-static 0.0.0.0 0.0.0.0 172.16.70.2

POE接入交换机1:

sys
sysname JR1
undo info-center enable
dhcp enable
vlan batch 200 to 201
interface Ethernet0/0/1
 port link-type trunk
 port trunk pvid vlan 200
 port trunk allow-pass vlan 200 to 201
quit
interface GigabitEthernet0/0/1
 port link-type trunk
 port trunk pvid vlan 200
 port trunk allow-pass vlan 200 to 201
quit
interface GigabitEthernet0/0/2
 port link-type trunk
 port trunk allow-pass vlan 200 to 201
quit

POE接入交换机2:

sys
sysname JR2
undo info-center enable
dhcp enable
vlan batch 80 200 202
interface GigabitEthernet0/0/1
 port link-type trunk
 port trunk pvid vlan 200
 port trunk allow-pass vlan 80 200 202
quit
interface GigabitEthernet0/0/2
 port link-type trunk
 port trunk allow-pass vlan 80 200 202
quit


AC无线控制器:

sys
undo info-center enable
dhcp enable
vlan batch 200 to 201
interface Vlanif200
 ip address 192.168.200.254 255.255.255.0
 dhcp select interface
quit
interface GigabitEthernet0/0/1
 port link-type trunk
 port trunk allow-pass vlan 200 to 201
quit
ip route-static 0.0.0.0 0.0.0.0 192.168.200.253
capwap source interface vlanif200
wlan
security-profile name sec-work
  security wpa-wpa2 psk pass-phrase  Aa12345678   aes
quit
security-profile name sec-guest
  security wpa-wpa2 psk pass-phrase  Aa12345678   aes
quit
ssid-profile name ss-work
  ssid work
quit
ssid-profile name ss-guest
  ssid guest
quit
vap-profile name vap-work
  forward-mode tunnel
  service-vlan vlan-id 201
  ssid-profile ss-work
  security-profile sec-work
quit
vap-profile name vap-guest
  service-vlan vlan-id 202
  ssid-profile ss-guest
  security-profile sec-guest
quit
 ap-group name work
 vap-profile vap-work wlan 1 radio all
quit
 ap-group name guest
   vap-profile vap-guest wlan 1  radio all
quit
ap auth-mode mac-auth 
ap-id 1 ap-mac  00e0-fc7e-56b0
ap-name work001
ap-group work
y
quit
ap auth-mode mac-auth 
ap-id 1 ap-mac  00e0-fc81-1670
ap-name work002
ap-group work
y
ap auth-mode mac-auth 
ap-id 1 ap-mac  00e0-fccb-1a80
ap-name guest001
ap-group guest
y

配置输入完成之后,过个几分钟就可以看到AP发射的无线信号了。

测试环节:

work走的是“隧道转发模式”所以流量要经过AC再出去。通过在AC上抓取流量包即可发现。这是没有ping之前的AC的流量包。

这是ping之后在AC上抓取的流量包,发现有STA1的icmp的数据包,所以即可知道该转发模式为“隧道模式”

同理分析可得 

怕有些人不懂得抓包,前提是你要安装Wireshark这个软件才行

同理分析可得STA2的转发模式为“直接转发”

关于VAP的说法和理解,就是一个AP可以释放多个WiFi的信号出来,最多为16个。以我的拓扑的AP2为例,目前只有一个guest的WiFi信号,所以我要再增加一个“隧道模式”转发的ensp的WiFi出来。步骤如下。

配置命令如下所示:

WLAN
security-profile name sec-ensp
  security wpa-wpa2 psk pass-phrase  Aa@123456   aes
quit
ssid-profile name ss-ensp
  ssid ensp
quit
vap-profile name vap-ensp
  service-vlan vlan-id 201
  ssid-profile ss-ensp
  security-profile sec-ensp
  forward-mode tunnel
quit
ap-group name guest
vap-profile vap-ensp wlan 2 radio all
quit

考虑到现实生活中后期要增加AP的操作,所以也给你们写出来了,增加了AP3在work组里面。操作如图所示;

命令如下

WLAN

ap auth-mode mac-auth 
ap-id 1 ap-mac  00e0-fc81-1670
ap-name work002
ap-group work
y

在AC上输入dis ap all 即可看到上线的AP了。那么步骤就到这里了,有什么疑问大家评论吧。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值