二层交换与三层交换的配置
一、将二层交换的路由功能关闭,将 E1/1 端口配置成 access 模式并加入 vlan1,新建 vlan2 和
vlan3,把端口 E1/2 和 E1/3 配置成 access 模式,E1/2 端口加入 vlan2,E1/3 端口加入 vlan3,然后激
活 vlan1、vlan2、vlan3
SW-L2(cong)#
SW-L2(cong)#no ip roung //关闭二层交换机的路由功能
SW-L2(cong)#int e1/1
SW-L2(cong-if)#switchport mode access //将 E1/1 配置成 access 模式
SW-L2(cong-if)#switchport access vlan 1 //将 E1/1 加入 vlan1
SW-L2(cong-if)#exit
SW-L2(cong)#
SW-L2(cong)#vlan 2
SW-L2(cong-vlan)#int e1/2
SW-L2(cong-if)#switchport mode access
SW-L2(cong-if)#switchport access vlan //新建 vlan2,将 E1/2 配置成 access 模式并加入 vlan2
SW-L2(cong-if)#no sh
SW-L2(cong-if)#vlan 3
SW-L2(cong-vlan)#int e1/3
SW-L2(cong-if)#switchport mode access
SW-L2(cong-if)#switchport access vlan 3 //新建 vlan3,将 E1/3 配置成 access 模式并加入 vlan3
SW-L2(cong-if)#
SW-L2(cong-if)#int vlan 1 //激活 vlan1
SW-L2(cong-if)#no sh
SW-L2(cong-if)#
*Sep 20 17:11:45.832: %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changed state to down
*Sep 20 17:12:05.145: %LINK-3-UPDOWN: Interface Vlan1, changed state to up
*Sep 20 17:12:06.149: %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changed state to up
SW-L2(cong-if)#int vlan 2 //激活 vlan2
1