用户名*
邮箱*
密码*
确认密码*
验证码* 点击图片更换验证码
找回密码
忘记密码了?输入你的注册邮箱,并点击重置,稍后,你将会收到一封密码重置邮件。
我是一个学电气工程的,偶然的机会组了几次网络,写一下心得吧也算没白干。
我用的是华为的交换机,顺便说一下华为的服务真的是没的说,我从一个小白到独立组网(当然都相对简单)客服同志可是帮了很大的忙。组的网络都是小型的网络,只供我们公司的内部产品使用,所以没有连接到外网。当然连网网也很简单加个路由就,行配置起来和家里面的路由器有点相似,至于做一些防护就比较麻烦了,可惜的是我还没设过那些东西在这里就不详细叙述了,本着知乎认真的态度我专门下载了个软件画了一个拓扑图。
简单来说我一共分了4个vlan段,vlan100为管理vlan,管理vlan顾名思义就是为了方便对交换机进行管理,例如交换机的静态ip我都分到了管理vlan里边(172.16.0.x 255.255.255.0),还有一个比较特殊的功能我在后边进行详细的叙述。除了管理vlan100,还有数据vlan10,主要是接终端的例如电脑,手持设备等等,还有视频vlan20走无线数据的,因为设备需要无线网络故加了三个无线ap(瘦ap),最后一个是vlan30走视频监控的,共有八个摄像头。划分vlan呢也是为了方便管理,监控流量太大怕占有别的设备流量。
首先是核心交换机5720。
超级终端软件我用的是xshell,这个还是比较好用的,刚登陆的时候应该是华为默认的登录密码admin huawei@123,登陆上之后首先开始配置vlan与vlan信息。
vlan batch 10 20 30 100
vlan 10
description shuju
vlan 20
description wuxian
vlan 30
description jiankong
vlan 100
description guanli
interface Vlanif1
#
interface Vlanif10
ip address 192.168.10.1 255.255.255.0
dhcp select interface
interface Vlanif20
ip address 192.168.20.1 255.255.255.0
interface Vlanif30
ip address 192.168.30.1 255.255.255.0
interface Vlanif100
ip address 172.16.0.2 255.255.255.0
dhcp(自动分配IP地址)可以开启也可以不开启根据现场情况拟定。有了vlan后就该配置用户登录了,用户登录这里我多做了些设置比如可以http登录和telnet登录,Telnet登录方便得很后期配置的差不多后我就可以带个笔记本随便坐在网络覆盖的范围内直接telnet登录就行了,不用挂这个线跑到交换机那傻傻的配置了。
aaa
local-user huawei password cipher %@%@q5K2&nf&RUw]HO@Q2HC9`Q7:%@%@
local-user huawei privilege level 15
local-user huawei service-type telnet http
user-interface vty 0 4
authentication-mode aaa
protocol inbound all
之后就是配置无线网了——ap上线,ap这里就麻烦一些了,开始我的安排版本太低无法与5720匹配后来找的升级文件升级的(说多了都是泪啊)。
wlan
wlan ac source interface vlanif100
ap-auth-mode no-auth
ap id 0 type-id 23 mac 7ca2-3eeb-cc60 sn 210235419510F5001385
ap id 1 type-id 23 mac e4c2-d1e5-3fc0 sn 210235419510F7000230
ap id 2 type-id 23 mac 7ca2-3eeb-c3a0 sn 210235419510F5001315
wmm-profile name wmm id 1
traffic-profile name traffic id 1
security-profile name security id 1
security-policy wpa2
wpa2 authentication-method psk pass-phrase cipher %@%@qdJ;*<i-F7rW!wEG^;(QcgyX
%@%@ encryption-method ccmp
service-set name ZJXT-X id 1
forward-mode tunnel
wlan-ess 1
ssid ZJXT-X
traffic-profile id 1
security-profile id 1
service-vlan 20
radio-profile name radio id 1
wmm-profile id 1
ap 0 radio 0
radio-profile id 1
service-set id 1 wlan 1
ap 1 radio 0
ap 2 radio 0
ap-update update-filename FitAP6X10XN_V200R005C10SPCc00.bin ap-type 23
之后是各个端口的设置,这个本应放在设置vlan那里说明,放在这也没事反正配置也没有个先后顺序。
interface GigabitEthernet0/0/1
description TO :shuju
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 10 20 100
interface GigabitEthernet0/0/2
description TO :jiankong
port trunk allow-pass vlan 30 100
interface GigabitEthernet0/0/3
description TO : shuju
interface GigabitEthernet0/0/4
interface GigabitEthernet0/0/5
interface GigabitEthernet0/0/6
interface GigabitEthernet0/0/7
interface GigabitEthernet0/0/8
interface GigabitEthernet0/0/9
interface GigabitEthernet0/0/10
interface GigabitEthernet0/0/11
port link-type access
port default vlan 10
interface GigabitEthernet0/0/12
interface GigabitEthernet0/0/13
interface GigabitEthernet0/0/14
interface GigabitEthernet0/0/15
interface GigabitEthernet0/0/16
interface GigabitEthernet0/0/17
interface GigabitEthernet0/0/18
interface GigabitEthernet0/0/19
interface GigabitEthernet0/0/20
interface GigabitEthernet0/0/21
interface GigabitEthernet0/0/22
interface GigabitEthernet0/0/23
description TO :guanli
port trunk allow-pass vlan 10 20 30 100
interface GigabitEthernet0/0/24
interface XGigabitEthernet0/0/1
interface XGigabitEthernet0/0/2
interface XGigabitEthernet0/0/3
interface XGigabitEthernet0/0/4
到这里基本上就大功告成了,后期我又做了一些vlan隔离之类的配置之后再说。下面是二层交换机的配置,那里就比较简单了我就拿一个举例吧,走无线与数据的二层交换机,这里说一下因为摄像头需要poe供电所以视频单独配置了一个交换机,无线 与数据公用一个交换机。
vlan batch 10 20 100
authentication-scheme default
authorization-scheme default
accounting-scheme default
domain default
domain default_admin
local-user admin password cipher %@%@5d~9:M^ipCfL\iB)EQd>3Uwe%@%@
local-user admin service-type http
local-user huawei password cipher %@%@up{$XGpgx9h].y9Bp\CYa$D[%@%@
ip address 172.16.0.21 255.255.255.0
interface Ethernet0/0/1
interface Ethernet0/0/2
interface Ethernet0/0/3
interface Ethernet0/0/4
interface Ethernet0/0/5
port trunk pvid vlan 100
port trunk allow-pass vlan 20 100
interface Ethernet0/0/6
interface Ethernet0/0/7
interface Ethernet0/0/8
interface NULL0
ip route-static 0.0.0.0 0.0.0.0 172.16.0.2
user-interface con 0
authentication-mode password
user privilege level 15
set authentication password cipher %@%@`]TeC/Ylv+ChGbL&Avj=.{_,.!J<%_W74Gs_5A0xj=_T{_/.%@%@
这里我先说一下的是接ap端口的设置,1/2/3/4口是连接终端(电脑的),5/6/7/8/口是直接连接ap的,直接ap的那个端口首先要设成trunk口了,如果ap只发射一个ssid的话是可以设成access 口的,为了以后拓展功能方便我就设成trunk口了,还有一个比较不容易明白的是 port trunk pvid vlan 100 这条命令,这条命令的意思是vlan100的数据经过这个口的话会打上vlan标签,而像vlan20的数据经过这里是没有vlan标签的,下边有一个更加明白的解释转子华为官网。如果有不明白的可以看看明白的请直接跳过。
管理报文在CAPWAP隧道中的转发处理流程:
图1 管理报文的转发处理流程图
如图1所示,
直接转发模式下业务数据报文的转发处理流程:
图2 直接转发模式下业务数据报文的转发处理流程图
如图2所示,业务报文不经过CAPWAP封装。
隧道转发模式下业务数据报文的转发处理流程:
图3 隧道转发模式下业务数据报文的转发处理流程图
如图3所示,业务报文经过CAPWAP封装,在CAPWAP数据隧道中传输。
封装后的报文在CAPWAP报文外层使用管理VLAN m,AP与AC之间的网络设备只需配置透传管理VLAN m,而对封装在CAPWAP报文内的业务VLAN s不需配置。
因此,在WLAN的实际组网中,需要合理规划管理VLAN和业务VLAN,以AP与AC间为二层组网为例:
如图4所示,对于直接转发方式,需要确保AP与AC间管理VLAN互通,AP与上层网络业务VLAN互通。
图4 直接转发模式下VLAN部署
如图5所示,对于隧道转发方式,需要确保AP与AC间管理VLAN互通,AC与上层网络业务VLAN互通。
图5 隧道转发模式下VLAN部署
这段讲的还是比较详细的。
下面我在额外说一些,上面提到过设置vlan隔离之类的,设置vlan隔离我用的方法是配置acl因为这个比较灵活随时可以加一些新的东西。配置完成后是下面这个样子的。
acl number 2001
rule 5 permit source 192.168.10.2 0
acl number 3001
rule 5 deny ip source 192.168.10.0 0.0.0.255 destination 192.168.30.0 0.0.0.255
rule 10 deny ip source 192.168.20.0 0.0.0.255 destination 192.168.30.0 0.0.0.25
5
traffic classifier c-1 operator and
if-match acl 3001
traffic classifier c-2 operator and
if-match acl 2001
traffic behavior b-1
deny
traffic behavior b-2
permit
traffic policy p-1 match-order config
classifier c-2 behavior b-2
classifier c-1 behavior b-1
drop-profile default
description jiankong1
traffic-policy p-1 outbound
acl2001的意思是所有的vlan主要是来自192.168.10.2这个ip的都放行,这个的作用是你不想让随便一个人什么都能访问可以通过这里设置单独的权限。
acl3001的作用是让vlan10,与vlan20都不能访问监控vlan,监控怎么能随便让人看呢。后面如果有新东西我会继续更新的^-^
昵称*
E-Mail*
回复内容*
回复 ( 1 )
我是一个学电气工程的,偶然的机会组了几次网络,写一下心得吧也算没白干。
我用的是华为的交换机,顺便说一下华为的服务真的是没的说,我从一个小白到独立组网(当然都相对简单)客服同志可是帮了很大的忙。组的网络都是小型的网络,只供我们公司的内部产品使用,所以没有连接到外网。当然连网网也很简单加个路由就,行配置起来和家里面的路由器有点相似,至于做一些防护就比较麻烦了,可惜的是我还没设过那些东西在这里就不详细叙述了,本着知乎认真的态度我专门下载了个软件画了一个拓扑图。
简单来说我一共分了4个vlan段,vlan100为管理vlan,管理vlan顾名思义就是为了方便对交换机进行管理,例如交换机的静态ip我都分到了管理vlan里边(172.16.0.x 255.255.255.0),还有一个比较特殊的功能我在后边进行详细的叙述。除了管理vlan100,还有数据vlan10,主要是接终端的例如电脑,手持设备等等,还有视频vlan20走无线数据的,因为设备需要无线网络故加了三个无线ap(瘦ap),最后一个是vlan30走视频监控的,共有八个摄像头。划分vlan呢也是为了方便管理,监控流量太大怕占有别的设备流量。
首先是核心交换机5720。
超级终端软件我用的是xshell,这个还是比较好用的,刚登陆的时候应该是华为默认的登录密码admin huawei@123,登陆上之后首先开始配置vlan与vlan信息。
vlan batch 10 20 30 100
vlan 10
description shuju
vlan 20
description wuxian
vlan 30
description jiankong
vlan 100
description guanli
interface Vlanif1
#
interface Vlanif10
ip address 192.168.10.1 255.255.255.0
dhcp select interface
#
interface Vlanif20
ip address 192.168.20.1 255.255.255.0
dhcp select interface
#
interface Vlanif30
ip address 192.168.30.1 255.255.255.0
#
interface Vlanif100
ip address 172.16.0.2 255.255.255.0
#
dhcp(自动分配IP地址)可以开启也可以不开启根据现场情况拟定。有了vlan后就该配置用户登录了,用户登录这里我多做了些设置比如可以http登录和telnet登录,Telnet登录方便得很后期配置的差不多后我就可以带个笔记本随便坐在网络覆盖的范围内直接telnet登录就行了,不用挂这个线跑到交换机那傻傻的配置了。
aaa
local-user huawei password cipher %@%@q5K2&nf&RUw]HO@Q2HC9`Q7:%@%@
local-user huawei privilege level 15
local-user huawei service-type telnet http
user-interface vty 0 4
authentication-mode aaa
protocol inbound all
之后就是配置无线网了——ap上线,ap这里就麻烦一些了,开始我的安排版本太低无法与5720匹配后来找的升级文件升级的(说多了都是泪啊)。
wlan
wlan ac source interface vlanif100
ap-auth-mode no-auth
ap id 0 type-id 23 mac 7ca2-3eeb-cc60 sn 210235419510F5001385
ap id 1 type-id 23 mac e4c2-d1e5-3fc0 sn 210235419510F7000230
ap id 2 type-id 23 mac 7ca2-3eeb-c3a0 sn 210235419510F5001315
wmm-profile name wmm id 1
traffic-profile name traffic id 1
security-profile name security id 1
security-policy wpa2
wpa2 authentication-method psk pass-phrase cipher %@%@qdJ;*<i-F7rW!wEG^;(QcgyX
%@%@ encryption-method ccmp
service-set name ZJXT-X id 1
forward-mode tunnel
wlan-ess 1
ssid ZJXT-X
traffic-profile id 1
security-profile id 1
service-vlan 20
radio-profile name radio id 1
wmm-profile id 1
ap 0 radio 0
radio-profile id 1
service-set id 1 wlan 1
ap 1 radio 0
radio-profile id 1
service-set id 1 wlan 1
ap 2 radio 0
radio-profile id 1
service-set id 1 wlan 1
ap-update update-filename FitAP6X10XN_V200R005C10SPCc00.bin ap-type 23
#
之后是各个端口的设置,这个本应放在设置vlan那里说明,放在这也没事反正配置也没有个先后顺序。
interface GigabitEthernet0/0/1
description TO :shuju
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 10 20 100
#
interface GigabitEthernet0/0/2
description TO :jiankong
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 30 100
#
interface GigabitEthernet0/0/3
description TO : shuju
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 10 20 100
#
interface GigabitEthernet0/0/4
description TO :jiankong
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 30 100
#
interface GigabitEthernet0/0/5
description TO : shuju
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 10 20 100
#
interface GigabitEthernet0/0/6
description TO :jiankong
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 30 100
#
interface GigabitEthernet0/0/7
description TO : shuju
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 10 20 100
#
interface GigabitEthernet0/0/8
description TO :jiankong
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 30 100
#
interface GigabitEthernet0/0/9
description TO : shuju
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 10 20 100
#
interface GigabitEthernet0/0/10
description TO :jiankong
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 30 100
#
interface GigabitEthernet0/0/11
description TO : shuju
port link-type access
port default vlan 10
#
interface GigabitEthernet0/0/12
description TO : shuju
port link-type access
port default vlan 10
#
interface GigabitEthernet0/0/13
description TO :shuju
port link-type access
port default vlan 10
#
interface GigabitEthernet0/0/14
description TO :shuju
port link-type access
port default vlan 10
#
interface GigabitEthernet0/0/15
description TO :shuju
port link-type access
port default vlan 10
#
interface GigabitEthernet0/0/16
description TO :shuju
port link-type access
port default vlan 10
#
interface GigabitEthernet0/0/17
description TO :shuju
port link-type access
port default vlan 10
#
interface GigabitEthernet0/0/18
description TO :shuju
port link-type access
port default vlan 10
#
interface GigabitEthernet0/0/19
description TO :shuju
port link-type access
port default vlan 10
#
interface GigabitEthernet0/0/20
description TO :shuju
port link-type access
port default vlan 10
#
interface GigabitEthernet0/0/21
description TO :shuju
port link-type access
port default vlan 10
#
interface GigabitEthernet0/0/22
description TO :shuju
port link-type access
port default vlan 10
#
interface GigabitEthernet0/0/23
description TO :guanli
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 10 20 30 100
#
interface GigabitEthernet0/0/24
description TO :guanli
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 10 20 30 100
#
interface XGigabitEthernet0/0/1
#
interface XGigabitEthernet0/0/2
#
interface XGigabitEthernet0/0/3
#
interface XGigabitEthernet0/0/4
#
到这里基本上就大功告成了,后期我又做了一些vlan隔离之类的配置之后再说。下面是二层交换机的配置,那里就比较简单了我就拿一个举例吧,走无线与数据的二层交换机,这里说一下因为摄像头需要poe供电所以视频单独配置了一个交换机,无线 与数据公用一个交换机。
vlan batch 10 20 100
#
aaa
authentication-scheme default
authorization-scheme default
accounting-scheme default
domain default
domain default_admin
local-user admin password cipher %@%@5d~9:M^ipCfL\iB)EQd>3Uwe%@%@
local-user admin service-type http
local-user huawei password cipher %@%@up{$XGpgx9h].y9Bp\CYa$D[%@%@
local-user huawei privilege level 15
local-user huawei service-type telnet http
#
interface Vlanif1
#
interface Vlanif100
ip address 172.16.0.21 255.255.255.0
#
interface Ethernet0/0/1
port link-type access
port default vlan 10
#
interface Ethernet0/0/2
port link-type access
port default vlan 10
#
interface Ethernet0/0/3
port link-type access
port default vlan 10
#
interface Ethernet0/0/4
port link-type access
port default vlan 10
#
interface Ethernet0/0/5
port link-type trunk
port trunk pvid vlan 100
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 20 100
#
interface Ethernet0/0/6
port link-type trunk
port trunk pvid vlan 100
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 20 100
#
interface Ethernet0/0/7
port link-type trunk
port trunk pvid vlan 100
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 20 100
#
interface Ethernet0/0/8
port link-type trunk
port trunk pvid vlan 100
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 20 100
#
interface GigabitEthernet0/0/1
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 10 20 100
#
interface NULL0
#
ip route-static 0.0.0.0 0.0.0.0 172.16.0.2
#
user-interface con 0
authentication-mode password
user privilege level 15
set authentication password cipher %@%@`]TeC/Ylv+ChGbL&Avj=.{_,.!J<%_W74Gs_5A0xj=_T{_/.%@%@
user-interface vty 0 4
authentication-mode aaa
protocol inbound all
#
这里我先说一下的是接ap端口的设置,1/2/3/4口是连接终端(电脑的),5/6/7/8/口是直接连接ap的,直接ap的那个端口首先要设成trunk口了,如果ap只发射一个ssid的话是可以设成access 口的,为了以后拓展功能方便我就设成trunk口了,还有一个比较不容易明白的是 port trunk pvid vlan 100 这条命令,这条命令的意思是vlan100的数据经过这个口的话会打上vlan标签,而像vlan20的数据经过这里是没有vlan标签的,下边有一个更加明白的解释转子华为官网。如果有不明白的可以看看明白的请直接跳过。
管理报文在CAPWAP隧道中的转发处理流程:
图1 管理报文的转发处理流程图
如图1所示,
直接转发模式下业务数据报文的转发处理流程:
图2 直接转发模式下业务数据报文的转发处理流程图
如图2所示,业务报文不经过CAPWAP封装。
隧道转发模式下业务数据报文的转发处理流程:
图3 隧道转发模式下业务数据报文的转发处理流程图
如图3所示,业务报文经过CAPWAP封装,在CAPWAP数据隧道中传输。
封装后的报文在CAPWAP报文外层使用管理VLAN m,AP与AC之间的网络设备只需配置透传管理VLAN m,而对封装在CAPWAP报文内的业务VLAN s不需配置。
因此,在WLAN的实际组网中,需要合理规划管理VLAN和业务VLAN,以AP与AC间为二层组网为例:
如图4所示,对于直接转发方式,需要确保AP与AC间管理VLAN互通,AP与上层网络业务VLAN互通。
图4 直接转发模式下VLAN部署
如图5所示,对于隧道转发方式,需要确保AP与AC间管理VLAN互通,AC与上层网络业务VLAN互通。
图5 隧道转发模式下VLAN部署
这段讲的还是比较详细的。
下面我在额外说一些,上面提到过设置vlan隔离之类的,设置vlan隔离我用的方法是配置acl因为这个比较灵活随时可以加一些新的东西。配置完成后是下面这个样子的。
acl number 2001
rule 5 permit source 192.168.10.2 0
#
acl number 3001
rule 5 deny ip source 192.168.10.0 0.0.0.255 destination 192.168.30.0 0.0.0.255
rule 10 deny ip source 192.168.20.0 0.0.0.255 destination 192.168.30.0 0.0.0.25
5
#
traffic classifier c-1 operator and
if-match acl 3001
traffic classifier c-2 operator and
if-match acl 2001
#
traffic behavior b-1
deny
traffic behavior b-2
permit
#
traffic policy p-1 match-order config
classifier c-2 behavior b-2
classifier c-1 behavior b-1
#
drop-profile default
#
vlan 10
description shuju
vlan 20
description wuxian
vlan 30
description jiankong1
traffic-policy p-1 outbound
vlan 100
acl2001的意思是所有的vlan主要是来自192.168.10.2这个ip的都放行,这个的作用是你不想让随便一个人什么都能访问可以通过这里设置单独的权限。
acl3001的作用是让vlan10,与vlan20都不能访问监控vlan,监控怎么能随便让人看呢。后面如果有新东西我会继续更新的^-^