华为S5700系列交换机配置通过流策略实现VLAN间三层隔离
组网图形
图1 配置通过流策略实现VLAN间三层隔离组网图
组网需求
如图一所示,为了通信的安全性,某公司将访客、员工、服务器分别划分到VLAN10、VLAN20、VLAN30中。公司希望:
- 员工、服务器主机、访客均能访问Internet。
- 访客只能访问Internet,不能与其他任何VLAN的用户通信。
- 员工A可以访问服务器区的所有资源,但其他员工只能访问服务器A的21端口(FTP服务)。
配置思路
可采用如下思路配置通过流策略实现VLAN间互访控制:
1. 配置VLAN并将各接口加入VLAN,使员工、服务器、访客间二层隔离。
2. 配置VLANIF接口及其IP地址,使员工、服务器、访客间可三层互通。
3. 配置上行路由,使员工、服务器、访客均可通过Switch访问Internet。
4. 配置并应用流策略,使员工A可以访问服务器区的所有资源,其他员工只能访问服务器A的21端口,且只允许员工访问服务器;使访客只能访问Internet。
操作步骤
1. 配置VLAN并将各接口加入VLAN,使员工、服务器、访客间二层隔离
# 在Switch_1上创建VLAN10,并将接口GE0/0/1以Untagged方式加入VLAN10,接口GE0/0/2以Tagged方式加入VLAN10。Switch_2和Switch_3的配置与Switch_1类似,不再赘述。
<HUAWEI> system-view
[HUAWEI] sysname Switch_1
[Switch_1] vlan batch 10
[Switch_1] interface gigabitethernet 0/0/1
[Switch_1-GigabitEthernet0/0/1] port link-type access
[Switch_1-GigabitEthernet0/0/1] port default vlan 10
[Switch_1-GigabitEthernet0/0/1] quit
[Switch_1] interface gigabitethernet 0/0/2
[Switch_1-GigabitEthernet0/0/2] port link-type trunk
[Switch_1-GigabitEthernet0/0/2] port trunk allow-pass vlan 10
[Switch_1-GigabitEthernet0/0/2] quit
# 在Switch_4上创建VLAN10、VLAN20、VLAN30、VLAN100,并配置接口GE0/0/1~GE0/0/4分别以Tagged方式加入VLAN10、VLAN20、VLAN30、VLAN100。
<HUAWEI> system-view
[HUAWEI] sysname Switch_4
[Switch_4] vlan batch 10 20 30 100
[Switch_4] interface gigabitethernet 0/0/1
[Switch_4-GigabitEthernet0/0/1] port link-type trunk
[Switch_4-GigabitEthernet0/0/1] port trunk allow-pass vlan 10
[Switch_4-GigabitEthernet0/0/1] quit
[Switch_4] interface gigabitethernet 0/0/2
[Switch_4-GigabitEthernet0/0/2] port link-type trunk
[Switch_4-GigabitEthernet0/0/2] port trunk allow-pass vlan 20
[Switch_4-GigabitEthernet0/0/2] quit
[Switch_4] interface gigabitethernet 0/0/3
[Switch_4-GigabitEthernet0/0/3] port link-type trunk
[Switch_4-GigabitEthernet0/0/3] port trunk allow-pass vlan 30
[Switch_4-GigabitEthernet0/0/3] quit
[Switch_4] interface gigabitethernet 0/0/4
[Switch_4-GigabitEthernet0/0/4] port link-type trunk
[Switch_4-GigabitEthernet0/0/4] port trunk allow-pass vlan 100
[Switch_4-GigabitEthernet0/0/4] quit
2. 配置VLANIF接口及其IP地址,使员工、服务器、访客间可以三层互通
# 在Switch_4上创建VLANIF10、VLANIF20、VLANIF30、VLANIF100,并分别配置其IP地址为10.1.1.1/24、10.1.2.1/24、10.1.3.1/24、10.1.100.1/24。
[Switch_4] interface vlanif 10
[Switch_4-Vlanif10] ip address 10.1.1.1 24
[Switch_4-Vlanif10] quit
[Switch_4] interface vlanif 20
[Switch_4-Vlanif20] ip address 10.1.2.1 24
[Switch_4-Vlanif20] quit
[Switch_4] interface vlanif 30
[Switch_4-Vlanif30] ip address 10.1.3.1 24
[Switch_4-Vlanif30] quit
[Switch_4] interface vlanif 100
[Switch_4-Vlanif100] ip address 10.1.100.1 24
[Switch_4-Vlanif100] quit
3. 配置上行路由,使员工、服务器、访客均可通过Switch访问Internet。
# 在Switch_4上配置OSPF基本功能,发布用户网段以及Switch_4与Router之间的互联网段。
[Switch_4] ospf
[Switch_4-ospf-1] area 0
[Switch_4-ospf-1-area-0.0.0.0] network 10.1.1.0 0.0.0.255
[Switch_4-ospf-1-area-0.0.0.0] network 10.1.2.0 0.0.0.255
[Switch_4-ospf-1-area-0.0.0.0] network 10.1.3.0 0.0.0.255
[Switch_4-ospf-1-area-0.0.0.0] network 10.1.100.0 0.0.0.255
[Switch_4-ospf-1-area-0.0.0.0] quit
[Switch_4-ospf-1] quit
说明:
Router上需要进行如下配置:
- 将连接Switch的接口以Tagged方式加入VLAN100,并指定VLANIF100的IP地址与10.1.100.1在同一网段。
- 配置OSPF基本功能,并发布Switch与Router之间的互联网段。
具体配置请参见使用设备的产品文档,本文不再赘述。
4. 配置并应用流策略,控制员工、访客、服务器之间的访问
a. 通过ACL定义每个流
# 在Switch_4上配置ACL 3000,禁止访客访问员工区和服务器区。
[Switch_4] acl 3000
[Switch_4-acl-adv-3000] rule deny ip destination 10.1.2.1 0.0.0.255
[Switch_4-acl-adv-3000] rule deny ip destination 10.1.3.1 0.0.0.255
[Switch_4-acl-adv-3000] quit
# 在Switch_4上配置ACL 3001,使员工A可以访问服务器区的所有资源,其他员工只能访问服务器A的21端口。
[Switch_4] acl 3001
[Switch_4-acl-adv-3001] rule permit ip source 10.1.2.2 0 destination 10.1.3.1 0.0.0.255
[Switch_4-acl-adv-3001] rule permit tcp destination 10.1.3.2 0 destination-port eq 21
[Switch_4-acl-adv-3001] rule deny ip destination 10.1.3.1 0.0.0.255
[Switch_4-acl-adv-3001] quit
b. 配置流分类,区分不同的流
# 在Switch_4上创建流分类c_custom、c_staff,并分别配置匹配规则3000、3001。
[Switch_4] traffic classifier c_custom
[Switch_4-classifier-c_custom] if-match acl 3000
[Switch_4-classifier-c_custom] quit
[Switch_4] traffic classifier c_staff
[Switch_4-classifier-c_staff] if-match acl 3001
[Switch_4-classifier-c_staff] quit
c. 配置流行为,指定流动作
# 在Switch_4上创建流行为b1,并配置允许动作。
[Switch_4] traffic behavior b1
[Switch_4-behavior-b1] permit
[Switch_4-behavior-b1] quit
d. 配置流策略,关联流分类和流行为
# 在Switch_4上创建流策略p_custom、p_staff,并分别将流分类c_custom、c_staff与流行为b1关联。
[Switch_4] traffic policy p_custom
[Switch_4-trafficpolicy-p_custom] classifier c_custom behavior b1
[Switch_4-trafficpolicy-p_custom] quit
[Switch_4] traffic policy p_staff
[Switch_4-trafficpolicy-p_staff] classifier c_staff behavior b1
[Switch_4-trafficpolicy-p_staff] quit
e. 应用流策略,实现员工、访客、服务器之间的访问控制
# 在Switch_4上,分别在VLAN10、VLAN20的入方向应用流策略p_custom、p_staff。
[Switch_4] vlan 10
[Switch_4-vlan10] traffic-policy p_custom inbound
[Switch_4-vlan10] quit
[Switch_4] vlan 20
[Switch_4-vlan20] traffic-policy p_staff inbound
[Switch_4-vlan20] quit
5. 验证配置结果
配置访客A的IP地址为10.1.1.2/24,缺省网关为VLANIF10接口的IP地址10.1.1.1;配置员工A的IP地址为10.1.2.2/24,缺省网关为VLANIF20接口的从IP地址10.1.2.1;配置员工B的IP地址为10.1.2.3/24,缺省网关为VLANIF20接口的从IP地址10.1.2.1;配置服务器A的IP地址为10.1.3.2/24,缺省网关为VLANIF30接口的从IP地址10.1.3.1。
配置完成后:
- 访客A不能Ping通员工A、服务器A;员工A和服务器A不能Ping通访客A。
- 员工A可以Ping通服务器A,即可以使用服务器A的FTP服务,也可以使用服务器A的。
- 员工B可以Ping不通服务器A,只能使用服务器A的FTP服务。
- 访客、员工A、员工B、服务器A均可以Ping通Router连接Switch_4的接口的IP地址10.1.100.2/24,也就都可以访问Internet。
- Switch_1的配置文件
配置文件
#
sysname Switch_1
#
vlan batch 10
#
interface GigabitEthernet0/0/1
port link-type access
port default vlan 10
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 10
#
return
Switch_2的配置文件
#
sysname Switch_2
#
vlan batch 20
#
interface GigabitEthernet0/0/1
port link-type access
port default vlan 20
#
interface GigabitEthernet0/0/2
port link-type access
port default vlan 20
#
interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 20
#
return
Switch_3的配置文件
#
sysname Switch_3
#
vlan batch 30
#
interface GigabitEthernet0/0/1
port link-type access
port default vlan 30
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 30
#
return
Switch_4的配置文件
#
sysname Switch_4
#
vlan batch 10 20 30 100
#
acl number 3000
rule 5 deny ip destination 10.1.2.0 0.0.0.255
rule 10 deny ip destination 10.1.3.0 0.0.0.255
acl number 3001
rule 5 permit tcp destination 10.1.3.2 0 destination-port eq ftp
rule 10 permit ip source 10.1.2.2 0 destination 10.1.3.0 0.0.0.255
rule 15 deny ip destination 10.1.3.0 0.0.0.255
#
traffic classifier c_custom operator and
if-match acl 3000
traffic classifier c_staff operator and
if-match acl 3001
#
traffic behavior b1
permit
#
traffic policy p_custom match-order config
classifier c_custom behavior b1
traffic policy p_staff match-order config
classifier c_staff behavior b1
#
vlan 10
traffic-policy p_custom inbound
vlan 20
traffic-policy p_staff inbound
#
interface Vlanif10
ip address 10.1.1.1 255.255.255.0
#
interface Vlanif20
ip address 10.1.2.1 255.255.255.0
#
interface Vlanif30
ip address 10.1.3.1 255.255.255.0
#
interface Vlanif100
ip address 10.1.100.1 255.255.255.0
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 10
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 20
#
interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 30
#
interface GigabitEthernet0/0/4
port link-type trunk
port trunk allow-pass vlan 100
#
ospf 1
area 0.0.0.0
network 10.1.1.0 0.0.0.255
network 10.1.2.0 0.0.0.255
network 10.1.3.0 0.0.0.255
network 10.1.100.0 0.0.0.255
#
return
华为S5700系列交换机配置通过流策略实现VLAN间三层隔离的更多相关文章
- 华为S5700系列交换机配置通过Telnet登录设备
声明:不管什么服务,都需要交换机开启服务,创建对应权限的用户,在通道下允许协议通过,缺一不可,以telnet为例. 组网图形 图1 配置通过Telnet登录设备组网图 组网需求 如图一所示,PC与设备 ...
- 华为S5700系列交换机使用高级ACL限制不同网段的用户互访
组网图形 图1 使用高级ACL限制不同网段的用户互访示例 组网需求 如图一所示,某公司通过Switch实现各部门之间的互连.为方便管理网络,管理员为公司的研发部和市场部规划了两个网段的IP地址.同时为 ...
- 华为S5700系列交换机AR配置静态IP双链路负载分担
适用于:有多个以太WAN口的机型. 业务需求: 运营商1分配的接口IP为100.100.1.2,子网掩码为255.255.255.252,网关IP为100.100.1.1. 运营商2分配的接口IP为2 ...
- 华为S5700系列交换机配置文件导出、导入
一.导出 配置用户名密码,使能ftp ftp server enable aaa local-user putty password cipher putty123 local-user putty ...
- 华为QUIDWAY系列交换机的console重置
作者:邓聪聪 华为QUIDWAY系列交换机的console重置 这里以华为QUIDWAY S3700密码清除为例: 各位看官请自行注意,这是两个不同版本设备的重置方法. 一:方法1 首先在电脑上新建一 ...
- 思科Cisco 2960系列交换机配置命令
配置密码: 2960>en :第一次密码为空 2960h#conf t :进入全局配置模式 2960(config)#hostname swa :设置交换机名 2960(config)#enab ...
- 路由器配置——单臂路由实现VLAN间通信
一.实验目的:用路由器使同和不同vlan可以通信 二.拓扑图如下: 三.具体步骤: (1)R1路由器配置: Router>en --进入特权模式Router#conf t --进入全局配置模 ...
- 华为S5300系列交换机限制特定IP可以登录Web
针对Web管理可能有如下需求: 1.限制某个特定IP允许访问Web 2.默认修改80端口访问 那么针对上面的设置可以有效杜绝而已Web密码暴力破解,增强交换机安全等. 实现: 1.限制特定IP登录We ...
- 华为S5300系列交换机V100R005SPH021升级补丁
S23_33_53-V100R005SPH021.pat 附件: 链接:https://pan.baidu.com/s/1xaEZa8hn8psHSQXrk2d9yA 密码:9b6o
随机推荐
- HBase的多节点集群详细启动步骤(3或5节点)(分为Zookeeper自带还是外装)
HBase的多节点集群详细启动步骤(3或5节点)分为: 1.HBASE_MANAGES_ZK的默认值是false(zookeeper外装)(推荐) 2.HBASE_MANAGES_ZK的默认值是tru ...
- Python_selenium之获取页面上的全部邮箱
Python_selenium之获取页面上的全部邮箱 一.思路拆分 获取网页(这里以百度的“联系我们”为例),网址http://home.baidu.com/contact.html 获取页面的全部内 ...
- Ubuntu14.04编译Android5.1.1源码
1.Ubuntu环境配置 硬盘:120G 内存:4G 注:配置很重要,直接影响能否编译成功. 2.安装JDK sudo apt-get update sudo apt-get install open ...
- 【BZOJ2055】80人环游世界 有上下界费用流
[BZOJ2055]80人环游世界 Description 想必大家都看过成龙大哥的<80天环游世界>,里面的紧张刺激的打斗场面一定给你留下了深刻的印象.现在就有这么 一个 ...
- 制作简易app个人总结
1.每次修改app.js或者其他路由js文件,都必须重启node app.js,否则修改不起作用!!! 2.<link rel="stylesheet" href=" ...
- 解决Windows 7 IIS7.5 用户 'IIS APPPOOL\{站点名} AppPool'登录失败
今天调试程序的时候,使用VS调试没有任何问题,但是发布到IIS就发生错误了,网上搜索了一下,问题具体上就出在IIS的应用程序池的设置上.我使用的是Windows7 IIS7.5. 错误为:用户 'II ...
- adb 连接小米1S真机调试
Ubuntu13.04 adb连接小米1S真机调试 搭好Android开发环境后,新建了一个Android Application工程.准备运行,问题来了,模拟器太慢了,怎么在真机上调试呢?百度之,G ...
- C#生成Windows服务
1. 新建一个项目,或者从选择当前解决方案--右键-添加--新建项目 2. 选择Visual C#项目-->Windows 服务,填写要创建的服务名称(修改默认的WindowService1成为 ...
- 【转】spring和springMVC的面试问题总结
1.Spring中AOP的应用场景.Aop原理.好处? 答:AOP--Aspect Oriented Programming面向切面编程:用来封装横切关注点,具体可以在下面的场景中使用: Authen ...
- 【转】如约而至:微信自用的移动端IM网络层跨平台组件库Mars已正式开源
网上看到关于微信官方的跨平台跨业务的终端基础组件Mars的介绍文章,转载这这里.源代码: https://github.com/Tencent/mars作者:男人链接:https://zhuanlan ...