先划vlan给vlan设ip改端口
LSW9
sys
sysname r1
int eth 0/0/1
port link-type access
q
int eth0/0/2
port link-type access
int eth 0/0/3
port link-type trunk
port trunk allow-pass vlan all
q
vlan 10
port eth0/0/1
q
vlan 20
port eth0/0/2
q
LSW10
sys
sysname r2
int eth0/0/1
port link-type access
int eth0/0/2
port link-type access
int eth0/0/3
port link-type trunk
port trunk allow-pass vlan all
q
划分vlan
vlan 30
port eth0/0/1
vlan 40
port eth0/0/2
LSW11
sys
sysname r4
int g0/0/3
port link-type trunk
port trunk allow-pass vlan all
int g0/0/1
port link-type access
port g0/0/1
vlan 10
q
int vlanif 10
ip add 192.168.1.254 24
vlan 20
q
int vlanif 20
ip add 192.168.2.254 24
q
vlan 100
port g0/0/1
q
int vlanif 100
ip add 50.1.1.9 255.255.255.252
ip route-static 0.0.0.0 0.0.0.0 50.1.1.10(设置默认路由IP)
LSW12
sys
sysname r5
int g0/0/3
port link-typr trunk
port trunk allow-pass vlan all
q
int g0/0/1
port link-type access
vlan 30
q
vlan 40
q
vlan 100
port g0/0/1
q
int vlanif 100
ip add 50.1.1.14 30
q
int vlanif 30
ip add 192.168.3.254 24
q
int vlanif 40
ip add 192.168.4.254 24
ip route-static 0.0.0.0 0.0.0.0 50.1.1.13(设置默认路由IP)
然后设置路由器
AR1
sys
sysname r6
int g0/0/1
ip add 50.1.1.10 30
q
int g0/0/2
ip add 50.1.1.13 30
q
int g0/0/0
ip add 50.1.1.5 30
AR2
sys
sysname r7
int g0/0/0
ip add 50.1.1.6 30
int g0/0/1
ip add 50.1.1.1 30
AR3
sys
sysname r11
int g0/0/1
ip add 50.1.1.2 30
int g0/0/0
ip add 192.168.5.254 24
接下来要下一跳
AR1
sys
ip route-static 192.168.1.0 24 50.1.1.9
ip route-static 192.168.2.0 24 50.1.1.9
ip route-static 192.168.3.0 24 50.1.1.14
ip route-static 192.168.4.0 24 50 1.1.14
ip route-static 50.1.1.0 30 50.1.1.6
ip route-static 192.168.5.254 24 50.1.1.6
AR2
sys
ip route-static 192.168.5.254 24 50.1.1.2
ip route-static 50.1.1.8 30 50.1.1.5
ip route-static 50.1.1.12 30 50.1.1.5
ip route-static 192.168.1.0 24 50.1.1.5
ip route-static 192.168.2.0 24 50.1.1.5
ip route-static 192.168.3.0 24 50.1.1.5
ip route-static 192.168.4.0 24 50.1.1.5
AR3
sys
ip route-static 50.1.1.4 30 50.1.1.1
ip route-static 50.1.1.8 30 50.1.1.1
ip route-static 50.1.1.12 30 50.1.1.1
ip toute-static 192.168.1.0 24 50.1.1.1
ip toute-static 192.168.2.0 24 50.1.1.1
ip toute-static 192.168.3.0 24 50.1.1.1
ip toute-static 192.168.4.0 24 50.1.1.1