案例要求:需要不通网段的PC1与PC2、PC3主机分别ping通
准备:三台PC端主机、三台路由器(AR2220)
操作:
Switch1:
#
sysname S1
#
vlan batch 10 40 50
#
interface Vlanif40
ip address 10.1.4.2 255.255.255.252
#
interface Vlanif50
ip address 10.1.4.5 255.255.255.252
#
interface Vlanif10
ip address 10.1.1.1 255.255.255.0
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 10
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 40
#
interface GigabitEthernet0/0/3
port link-type access
port default vlan 50
#
ip route-static 10.1.2.0 255.255.255.0 10.1.4.1
ip route-static 10.1.3.0 255.255.255.0 10.1.4.6
#
return
Switch2:
#
sysname S2
#
vlan batch 20 40
#
interface Vlanif40
ip address 10.1.4.1 255.255.255.252
#
interface Vlanif20
ip address 10.1.2.1 255.255.255.0
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 40
#
interface GigabitEthernet0/0/2
port link-type access
port default vlan 20
#
ip route-static 0.0.0.0 0.0.0.0 10.1.4.2
#
return
Switch3:
#
sysname S3
#
vlan batch 30 50
#
interface Vlanif50
ip address 10.1.4.6 255.255.255.252
#
interface Vlanif30
ip address 10.1.3.1 255.255.255.0
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 50
#
interface GigabitEthernet0/0/2
port link-type access
port default vlan 30
#
ip route-static 0.0.0.0 0.0.0.0 10.1.4.5
#
return
测试连通性(10.1.2.1 ping 10.1.3.1)
]]>