24212 发表于 2016-2-23 08:27:25

三层交换机实现VLAN间路由



配置过程
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)#switchportmodetrunk
       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

测试结果



页: [1]
查看完整版本: 三层交换机实现VLAN间路由