实验目的:
PC1能通过交换机中的路由实现192.168.10.10对192.168.100.2的访问
PC1:192.168.10.10 网关:192.168.10.254
SW7配置:
vlan batch 10 100
设置端口模式
interface Ethernet0/0/1
port link-type access
port default vlan 10
允许vlan10 100通过
interface Ethernet0/0/2
port link-type trunk
port trunk allow-pass vlan 10 100
给vlan10 100配置IP地址
interface Vlanif10
ip address 192.168.10.254 255.255.255.0
interface Vlanif100
ip address 192.168.100.1 255.255.255.0
配置默认路由
ip route-static 0.0.0.0 0.0.0.0 192.168.100.2
SW8配置:
创建vlan 10 100
vlan batch 10 100
配置端口模式并允许vlan通过
interface Ethernet0/0/1
port link-type trunk
port trunk allow-pass vlan 10 100
interface Ethernet0/0/2
port link-type trunk
port trunk allow-pass vlan 10 100
SW9配置:
创建vlan
vlan 10 100
vlan 100配IP地址
interface vlanif 100
ip address 192.168.100.2 24
配置端口模式并允许通过vlan
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 10 100
静态路由配置:
ip route-static 192.168.10.0 255.255.255.0 192.168.100.1
实验结果:
PC1ping192.168.100.2