三層交換機實現VLAN間路由

wKiom1bLEN7BtIZ7AACWyXDeD9o794.jpg

 

配置過程

PC0

       IP:                 192.168.1.2

       Submark:              255.255.255.0

       Gateway:       192.168.1.1

PC1

       IP:                 192.168.2.2

       Submark:              255.255.255.0

       Gateway:       192.168.2.1   

PC2

       IP:                 192.168.1.3

       Submark:              255.255.255.0

       Gateway:       192.168.1.1

  

 

S2960

       Switch>en

       Switch#conf t

       Switch(config )#vlan 2

       Switch(config-vlan)#exit

       Switch(config )#vlan 3

       Switch(config-vlan)#exit      

       Switch(config )#int fa 0/2

       Switch(config-if)#switchport access vlan 2

       Switch(config-if)#exit

       Switch(config )#int fa 0/3

       Switch(config-if)#switchport access vlan 3

       Switch(config-if)#exit

       Switch(config )#int fa 0/1

       Switch(config-if)#switchport  mode  trunk

       Switch(config-if)#end

       Switch#show vlan

S3560

       Switch>en

       Switch#conf t

       Switch(config )#vlan 2 

       Switch(config-vlan)#exit

       Switch(config )#vlan 3 

       Switch(config-vlan)#exit

       Switch(config )#int fa 0/1 

       Switch(config-if)#switchport trunk encapsulation dot1q

       Switch(config-if)#switchport mode trunk 

       Switch(config-if)#exit

       Switch(config )#int fa 0/2  

       Switch(config-if)#switchport access vlan 2 

       Switch(config-if)#exit  

       Switch(config-if)#ip routing

       Switch(config )#interface vlan 2 

       Switch(config-if)#ip address 192.168.1.1 255.255.255.0 

       Switch(config-if)#no shutdown 

       Switch(config-if)#exit

       Switch(config )#interface vlan 3

       Switch(config-if)#ip address 192.168.2.1 255.255.255.0

       Switch(config-if)#no shutdown

       Switch(config-if)#end

 

測試結果

wKioL1bLEkyyVHxbAAErSO3ij1g252.jpg

 

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