你这个是没法使每台PC相互Ping通的,因为你这里划分了3个VLAN,中间的交换机要用三层的才有可能启用VLAN路由,使VLAN互通。所以要先将Switch7换成3560的三层交换机。然后在这个设备上进行配置,如下:
Switch>en
Switch#conf t
Switch(config)#vlan 10
Switch(config-vlan)#vlan 20
Switch(config-vlan)#vlan 30
Switch(config-vlan)#exit
Switch(config-if)#int r f0/1,f0/4
Switch(config-if-range)#sw acc vlan 10
Switch(config-if-range)#int r f0/2,f0/5
Switch(config-if-range)#sw acc vlan 20
Switch(config-if-range)#int r f0/3,f0/6
Switch(config-if-range)#sw acc vlan 20
Switch(config-if-range)#sw acc vlan 30
Switch(config-if-range)#int vlan 10
Switch(config-if)#ip add 192.168.10.254 255.255.255.0
Switch(config-if)#int vlan 20
Switch(config-if)#ip add 192.168.20.254 255.255.255.0
Switch(config-if)#int vlan 30
Switch(config-if)#ip add 192.168.30.254 255.255.255.0
Switch(config-if)#exit
Switch(config)#ip routing其它的交换机无需配置,电脑的IP地址设置好,默认网关为最后为.254
你好!
中间那个switch7需要换成三层交换机才能实现VLAN间通讯,否则需要做单臂路由!
Switch7配置命令如下:
enable
vlan database
vlan 10
vlan 20
vlan 30
exit
configure terminal
interface range fastethernet0/1 ,fastethernet0/4
switchport mode access
switchport access vlan 10
exit
interface range fastethernet0/2 ,fastethernet0/5
switchport mode access
switchport access vlan 20
exit
interface range fastethernet0/3 ,fastethernet0/6
switchport mode access
switchport access vlan 30
exit
interface vlan 10
ip address 192.168.10.254 255.255.255.0
exit
interface vlan 20
ip address 192.168.20.254 255.255.255.0
exit
interface vlan 30
ip address 192.168.30.254 255.255.255.0
如果你依然使用二层交换机,那么需要配置路由器的单臂路由功能:
假设:Switch7 的24口连接Router 1的fastethernet0/0口
那么
Switch 7
enable
configure terminial
interface fa0/24
switchport mode trunk
Router 1
enable
configure terminal
interface fastethernet0/0
no shutdown
exit
interfaec fa0/0.1
encapsulation dot1q 10
ip address 192.168.10.254 255.255.255.0
exit
interface fa0/0.2
encapsulation dot1q 20
ip address 192.168.20.254 255.255.255.0
exit
interface fa0/0.3
encapsulation dot1q 30
ip address 192.168.30.254 255.255.255.0
希望你能明白!
把两个设为同个网段,,