1、 1 端口隔离典型配置举例 1.1 简介 本章介绍了采用端口隔离特性,实现同一VLAN内端口之间的隔离。用户只需要将端口加入到隔离组中,就可以实现隔离组内端口之间数据的隔离。 1.2 端口隔离限制设备间互访典型配置举例 1.2.1 适用产品和版本 表1 配置适用的产品与软件版本关系 产品 软件版本 S10500系列以太网交换机 Release 1120系列,Release 1130系列,Release 1200系列 S5800&S5820X系列以太网交换机 Release 1808 S5830系列以太网交换机 Release 1115,Release 111
2、8 S5500-EI&S5500-SI系列以太网交换机 Release 2220 1.2.2 组网需求 如图1所示,Host A和Host B属同一VLAN,使用端口隔离功能实现Host A和Host B不能互访,但都可以与服务器Server及外部网络进行通信。 图1 端口隔离典型配置组网图 1.2.3 配置注意事项 (1) 将端口加入隔离组前,请先确保端口的链路模式为bridge,即端口工作在二层模式下。 (2) 同一端口不能同时配置为业务环回组成员端口和隔离组端口,即业务环回组成员端口不能加入隔离组。 1.2.4 配置步骤
3、 创建VLAN 100 ,并将端口GigabitEthernet1/0/1、GigabitEthernet1/0/2、GigabitEthernet1/0/3、GigabitEthernet1/0/4全部加入VLAN 100。
4、加入隔离组。 [SwitchA] interface gigabitethernet 1/0/1 [SwitchA-GigabitEthernet1/0/1] port-isolate enable [SwitchA-GigabitEthernet1/0/1] quit [SwitchA] interface gigabitethernet 1/0/2 [SwitchA-GigabitEthernet1/0/2] port-isolate enable [SwitchA-GigabitEthernet1/0/2] quit 1.2.5 验证配置 # 使用display por
5、t-isolate group命令显示Switch A上隔离组中的信息。显示信息的描述请参见表2。
6、tion 显示端口隔离组的信息 Uplink port support 是否支持配置上行端口 Group ID 隔离组编号 Group members 隔离组中包含的普通端口(非上行端口) 1.2.6 配置文件 S5500-SI系列交换机不支持port link-mode bridge命令。 # vlan 100 # interface GigabitEthernet1/0/1 port link-mode bridge port access vlan 100 port-isolate enable # interface
7、GigabitEthernet1/0/2 port link-mode bridge port access vlan 100 port-isolate enable # interface GigabitEthernet1/0/3 port link-mode bridge port access vlan 100 # interface GigabitEthernet1/0/4 port link-mode bridge port access vlan 100 # 1.3 隔离端口间的定时互访典型配置举例 1.3.1 适用产品和版本 表3
8、配置适用的产品与软件版本关系 产品 软件版本 S10500系列以太网交换机 Release 1120系列,Release 1130系列,Release 1200系列 S5800&S5820X系列以太网交换机 Release 1808 S5830系列以太网交换机 Release 1115,Release 1118 S5500-EI&S5500-SI系列以太网交换机 Release 2220 1.3.2 组网需求 如图2所示,某公司内部的研发部门、市场部门和行政部门分别与Switch B上的端口相连。要求在使用端口隔离功能的情况下同时实现以下需求: ·
9、 各部门与外界网络互访。 · 在每天8:00~12:00的时间段内,允许Host A访问行政部门的服务器,拒绝其它的IP报文通过。 · 在每天14:00~16:00的时间段内,允许Host B访问行政部门的服务器,拒绝其它的IP报文通过。 · 在其他时间段,各部门之间不能互访。 图2 隔离端口间的定时互访组网图 1.3.3 配置思路 要实现隔离端口间的互访,需要在网关设备上使用本地代理ARP功能。然而,启用本地代理ARP之后,接入层设备上的隔离端口都可互访或某一IP地址范围内的设备可互访。因此,还需要结合网关设备的报文过滤功能以实现隔离端口
10、间的定时访问。
1.3.4 配置步骤
1. Switch B的配置
# 配置Switch B上的端口GigabitEthernet1/0/1、 GigabitEthernet1/0/2、 GigabitEthernet1/0/3和GigabitEthernet1/0/4属于同一VLAN 100;并将端口GigabitEthernet1/0/1、 GigabitEthernet1/0/2和GigabitEthernet1/0/3加入到隔离组中,以实现研发部门、市场部门和行政部门彼此之间二层报文不能互通。
11、 [SwitchB-vlan100] port gigabitethernet 1/0/1 to gigabitethernet 1/0/4 [SwitchB-vlan100] quit [SwitchB] interface gigabitethernet 1/0/1 [SwitchB-GigabitEthernet1/0/1] port-isolate enable [SwitchB-GigabitEthernet1/0/1] quit [SwitchB] interface gigabitethernet 1/0/2 [SwitchB-GigabitEthernet
12、1/0/2] port-isolate enable
[SwitchB-GigabitEthernet1/0/2] quit
[SwitchB] interface gigabitethernet 1/0/3
[SwitchB-GigabitEthernet1/0/3] port-isolate enable
[SwitchB-GigabitEthernet1/0/3] quit
2. Switch A的配置
# 在Switch A上配置VLAN接口100的IP地址为10.1.1.33,掩码为24位。
13、00 [SwitchA-vlan100] port gigabitethernet 1/0/4 [SwitchA-vlan100] interface vlan-interface 100 [SwitchA-Vlan-interface100] ip address 10.1.1.33 255.255.255.0 # 在Switch A上配置本地代理ARP,实现部门之间的三层互通。 [SwitchA-Vlan-interface100] local-proxy-arp enable [SwitchA-Vlan-interface100] quit # 在Switch A上定义两个
14、工作时间段,分别是trname_1,周期时间范围为每天的8:00~12:00; trname_2,周期时间范围为每天的14:00~16:00。 [SwitchA] time-range trname_1 8:00 to 12:00 daily [SwitchA] time-range trname_2 14:00 to 16:00 daily # 在Switch A上定义到行政部门服务器的三条访问规则。 · 允许Host A访问行政部门的服务器。 [SwitchA] acl number 3000 [SwitchA-acl-adv-3000] rule permit i
15、p source 10.1.1.1 0 destination 10.1.1.24 0 time-range trname_1 · 允许Host B访问行政部门的服务器。 [SwitchA-acl-adv-3000] rule permit ip source 10.1.1.16 0 destination 10.1.1.24 0 time-range trname_2 · 禁止各部门间的互访。 [SwitchA-acl-adv-3000] rule deny ip source 10.1.1.0 0.0.0.31 destination 10.1.1.0 0.0.0.
16、31 [SwitchA-acl-adv-3000] quit # 在端口GigabitEthernet1/0/4上应用高级IPv4 ACL,以对该端口收到的IPv4报文进行过滤。 [SwitchA] interface gigabitethernet 1/0/4 [SwitchA-GigabitEthernet1/0/4] packet-filter 3000 inbound [SwitchA-GigabitEthernet1/0/4] quit 1.3.5 验证配置 # 使用display port-isolate group命令显示Switch B上隔离组的信息。
17、 [SwitchB] display port-isolate group Port-isolate group information: Uplink port support: NO Group ID: 1 Group members: GigabitEthernet1/0/1 GigabitEthernet1/0/2 GigabitEthernet1/0/3 # 显示Switch A上的配置信息 · 在VLAN接口视图下通过display this命令显示VLAN 100的信息。 [SwitchA-Vlan-interface100]disp
18、lay this # interface Vlan-interface100 ip address 10.1.1.33 255.255.255.0 local-proxy-arp enable # return · 通过display acl 3000命令显示Switch A上的访问规则。 [SwitchA]display acl 3000 Advanced ACL 3000, named -none-, 3 rules, ACL's step is 5 rule 0 permi
19、t ip source 10.1.1.1 0 destination 10.1.1.24 0 time-range trname_1 rule 5 permit ip source 10.1.1.16 0 destination 10.1.1.24 0 time-range trname_2 rule 10 deny ip source 10.1.1.0 0.0.0.31 destination 10.1.1.0 0.0.0.31 1.3.6 配置文件 S5500-SI系列交换机不支持port link-mode bridge命令。 · Switch B:
20、 vlan 100 # interface GigabitEthernet1/0/1 port link-mode bridge port access vlan 100 port-isolate enable # interface GigabitEthernet1/0/2 port link-mode bridge port access vlan 100 port-isolate enable # interface GigabitEthernet1/0/3 port link-mode bridge port access vlan
21、100 port-isolate enable # interface GigabitEthernet1/0/4 port link-mode bridge port access vlan 100 # · Switch A: # time-range trname_1_8:00 to 12:00 daily time-range trname_2 14:00 to 16:00 daily # acl number 3000 rule 0 permit ip source 10.1.1.1 0 destination 10.1.1.24 0 time
22、range trname_1 rule 5 permit ip source 10.1.1.16 0 destination 10.1.1.24 0 time-range trname_2 rule 10 deny ip source 10.1.1.0 0.0.0.31 destination 10.1.1.0 0.0.0.31 # vlan 100 # interface Vlan-interface 100 ip address 10.1.1.33 255.255.255.0 local-proxy-arp enable # interface GigabitEthernet1/0/4 port link-mode bridge port access vlan 100 packet-filter 3000 inbound #






