前面我们也讲解了华为的命令,和一般的配置,现在我们来配置一项全面一点的拓扑。
拓扑图解构:
Layer 3 switch-2的配置:
interface Eth-Trunk 12
mode lacp-static
trunkport GigabitEthernet 0/0/10
trunkport GigabitEthernet 0/0/11
quit
配置VLAN间路由:
interface GigabitEthernet 0/0/24
port link-type trunk
port trunk allow-pass vlan all
quit
interface Vlanif 20
ip add 192.168.20.1 24
quit
Layer 3 switch-2的配置:
vlan batch 10 to 40 1000 to 1002
interface Eth-Trunk 12
port link-type trunk
port trunk allow-pass vlan all
quit
interface GigabitEthernet 0/0/23
port link-type trunk
port trunk allow-pass vlan all
quit
interface GigabitEthernet 0/0/24
port link-type trunk
port trunk allow-pass vlan all
quit
interface Vlanif 30
ip add 192.168.30.1 24
quit
interface Vlanif 40
ip add 192.168.40.1 24
quit
Layer 2 switch-1的配置:
Layer 2 switch-2的配置:
vlan batch 10 to 40
interface GigabitEthernet 0/0/1
port link-type trunk
port trunk allow-pass vlan all
quit
interface Ethernet 0/0/1
port link-type access
port default vlan 20
quit
Layer 2 switch-3的配置:
vlan batch 10 to 40
interface GigabitEthernet 0/0/1
port link-type trunk
port trunk allow-pass vlan all
quit
interface Ethernet 0/0/1
port link-type access
port default vlan 30
quit
Layer 2 switch-3的配置:
vlan batch 10 to 40
interface GigabitEthernet 0/0/1
port link-type trunk
port trunk allow-pass vlan all
quit
interface Ethernet 0/0/1
port link-type access
port default vlan 40
quit
单臂路由配置命令:
router4的配置:
interface GigabitEthernet 0/0/2.100
ip address 192.168.100.1 24
dot1q termination vid 100
arp broadcast enable
quit
interface GigabitEthernet 0/0/2.200
ip address 192.168.200.1 24
dot1q termination vid 200
arp broadcast enable
quit
Layer 3 switch的配置:
vlan batch 100 200
port link-type trunk
port trunk allow-pass vlan all
quit
interface Ethernet 0/0/1
port link-type access
port default vlan 100
quit
interface Ethernet 0/0/2
port link-type access
port default vlan 200
配置RIP和OSPF
Layer 3 switch-1的配置:
vlan batch 1000 to 1002
interface GigabitEthernet 0/0/1
port link-type access
port default vlan 1001
quit
interface Vlanif 1000
ip add 10.0.0.1 24
quit
interface Vlanif 1001
ip address 20.0.0.1 24
quit
ospf 8021
area 0
network 10.0.0.0 0.0.0.255
network 20.0.0.0 0.0.0.255
network 192.168.10.0 0.0.0.255
network 192.168.20.0 0.0.0.255
quit
Layer 3 switch-2的配置:
vlan batch 1000 to 1002
interface GigabitEthernet 0/0/2
port link-type access
port default vlan 1002
quit
interface Vlanif 1000
ip address 10.0.0.2 24
quit
interface Vlanif 1002
ip address 30.0.0.1 24
quit
ospf 8021
area 0
network 10.0.0.0 0.0.0.255
network 30.0.0.0 0.0.0.255
network 192.168.30.0 0.0.0.255
network 192.168.40.0 0.0.0.255
quit
router2的配置:
ospf 8021
default-route-advertise
area 0
network 192.168.2.0 0.0.0.255
network 172.16.1.0 0.0.0.255
network 20.0.0.0 0.0.0.255
network 30.0.0.0 0.0.0.255
router3的配置:
ospf 8021
import-route rip 1
area 0
network 172.16.1.0 0.0.0.255
quit
rip
import-route ospf 8021
version 2
undo summary
network 172.16.2.0
quit
router4的配置:
rip
version 2
undo summary
network 172.16.0.0
quit
router5的配置:
rip
version 2
network 172.16.0.0
network 202.1.1.0
到这里就已经配置完成了。