三層交換實現VLAN路由

 

 



Switch>en
Switch>enable
Switch#conf
Switch#configure
Switch#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#vl
Switch(config)#vlan 2
Switch(config-vlan)#exit
Switch(config)#in f0/1
Switch(config-if)#sw
Switch(config-if)#switchport m
Switch(config-if)#switchport mode a
Switch(config-if)#switchport mode access
Switch(config-if)#sw
Switch(config-if)#switchport a
Switch(config-if)#switchport access v
Switch(config-if)#switchport access vlan 1
Switch(config-if)#in f0/2
Switch(config-if)#sw
Switch(config-if)#switchport m
Switch(config-if)#switchport mode a
Switch(config-if)#switchport mode access
Switch(config-if)#sw
Switch(config-if)#switchport a
Switch(config-if)#switchport access v
Switch(config-if)#switchport access vlan 2
Switch(config-if)#exit
Switch(config)#ip routing
Switch(config)#in vl
Switch(config)#in vlan 1
Switch(config-if)#ip add 172.16.1.1 255.255.255.0
Switch(config-if)#no shu
Switch(config-if)#no shutdown

%LINK-5-CHANGED: Interface Vlan1, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changed state to up

Switch(config-if)#exit
Switch(config)#in vl
Switch(config)#in vlan 2

%LINK-5-CHANGED: Interface Vlan2, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan2, changed state to up
Switch(config-if)#ip add 172.16.2.1 255.255.255.0
Switch(config-if)#no shu
Switch(config-if)#no shutdown
Switch(config-if)#exit
Switch(config)#
Switch#
%SYS-5-CONFIG_I: Configured from console by console

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章