1、实验二十一:端口隔离一、 理论基础1、端口隔离简介通过端口隔离特性,可以实现不同用户的端口属于同一个 VLAN,而不同用户之间不能互通。从而增强了网络的安全性,提供了灵活的组网方案,同时节省了大量的 VLAN 资源。通过本实验的配置,使得 VLAN 内的端口二层隔离,从而该 VLAN 内的端口间不能进行二层转发,导致属于同一个 VLAN 的 PC1 和 PC2 不能 ping 通,但通过配置该 VLAN 内的某个端口为上行端口,从而使得被隔离端口的报文仍然能够通过二层转发出去。2、端口间的二层隔离可以通过下面的命令设置指定 VLAN 内的端口二层隔离,从而使该 VLAN 内的端口间不能进行二层
2、转发。在 VLAN 视图下进行配置。操作 命令使能 VLAN 内的端口二层隔离 port-isolate enable取消 VLAN 内的端口二层隔离 undo port-isolate enable缺省情况下,VLAN 内的端口二层不隔离,即端口间可以进行二层转发。二、 实验案例 端口隔离的配置1、 实验拓扑结构图:2、配置说明:PC1 的地址:192.168.10.3/24 网关:192.168.10.1 路由器的 E0 接口PC2 的地址:192.168.10.4/24 网关:192.168.10.1 路由器的 E0 接口PC3 的地址:192.168.11.5/24 网关:192.16
3、8.11.1 路由器的 E1 接口Router 各个接口的地址分别是:E0:192.168.10.1 E1:192.168.11.13、具体配置:交换机的配置:Switchvlan 2Switch-vlan2port e0/1Switch-vlan2port e0/6Switch-vlan2port e0/8Switchint e0/1Switch-Ethernet0/1port link-type trunkSwitch-Ethernet0/1port trunk permit vlan allPlease wait. Done.Switchvlan 2Switch-vlan2port-is
4、olate enableSwitchint e0/1Switch-Ethernet0/1port-isolate uplink-port vlan 2Switch-Ethernet0/1quitdis cursysname Switchradius scheme systemserver-type huaweiprimary authentication 127.0.0.1 1645primary accounting 127.0.0.1 1646user-name-format without-domaindomain systemradius-scheme systemaccess-lim
5、it disablestate activeidle-cut disableself-service-url disablemessenger time disabledomain default enable systemlocal-server nas-ip 127.0.0.1 key huaweiqueue-scheduler wrr 1 2 4 8vlan 1vlan 2port-isolate enableinterface Vlan-interface1ip address 192.168.10.2 255.255.255.0interface Aux0/0interface Et
6、hernet0/1port link-type trunkport trunk permit vlan allport-isolate uplink-port vlan 2interface Ethernet0/2interface Ethernet0/3interface Ethernet0/4interface Ethernet0/5interface Ethernet0/6port access vlan 2interface Ethernet0/7interface Ethernet0/8port access vlan 2interface NULL0user-interface a
7、ux 0user-interface vty 0 4user privilege level 3set authentication password simple ciscoReturn路由器的配置:Routerint e1Router-Ethernet1ip address 192.168.11.1 255.255.255.0Router-Ethernet0int e0.1Router-Ethernet0.1vlan-type dot1q vid 2Router-Ethernet0.1ip address 192.168.10.1 255.255.255.0Router-Ethernet0
8、.1%20:46:34: Line protocol ip on the interface Ethernet0.1 is UPRouterdis curNow create configuration.Current configurationversion 1.74firewall enableaaa-enableaaa accounting-scheme optionalinterface Aux0async mode flowlink-protocol pppinterface Ethernet0interface Ethernet0.1vlan-type dot1q vid 2ip
9、address 192.168.10.1 255.255.255.0interface Ethernet1ip address 192.168.11.1 255.255.255.0interface Serial0link-protocol pppinterface Serial1link-protocol pppinterface Serial2link-protocol pppinterface Serial3link-protocol pppreturn三、 实验总结隔离时的显示结果(见图)PC1 ping 不通 PC2。虽然被隔离了,但是该 VLAN 内的某个端口为上行端口,从而使得被隔离端口的报文仍然能够通过二层转发出去。此时,从 VLAN2 中的计算机可以 ping 通 PC3,说明报文可以被上行端口转发出去(见图)