案例要求:需要不通网段的PC1与PC2、PC3主机分别ping通 准备:三台PC端主机、三台路由器(AR2220) 操作:
注意:配置静态路由无需选择DHCP分配,需要自己设置的,这里的网关即下列步骤中的AR1的GE0的串口端ip PC2、PC3的配置同理
其中static标识的就是咱们设置的静态地址路由 配置AR2路由器: system-view [Huawei]interface GigabitEthernet 0/0/0 [Huawei-GigabitEthernet0/0/0]ip addr 1.1.1.2 24 [Huawei-GigabitEthernet0/0/0]quit [Huawei]interface GigabitEthernet 0/0/1 [Huawei-GigabitEthernet0/0/1]ip addr 20.123.1.1 24 [Huawei-GigabitEthernet0/0/1]quit [Huawei]ip route-static 10.123.1.0 30 1.1.1.1 查看AR2路由表:
配置AR3路由器: system-view [Huawei]interface GigabitEthernet 0/0/0 [Huawei-GigabitEthernet0/0/0]ip addr 30.123.1.1 24 [Huawei-GigabitEthernet0/0/0]quit [Huawei]interface GigabitEthernet 0/0/1 [Huawei-GigabitEthernet0/0/1]ip addr 2.2.2.2 24 [Huawei-GigabitEthernet0/0/1]quit [Huawei]ip route-static 10.123.1.0 30 2.2.2.1 查看AR3路由表:
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)