[AR5]int g0/0/0
[AR5-GigabitEthernet0/0/0]ip add 10.1.100.1 24
[AR5-GigabitEthernet0/0/0]un sh
[AR5-GigabitEthernet0/0/0]int g0/0/2
[AR5-GigabitEthernet0/0/2]ip add 10.1.135.2 24
[AR5-GigabitEthernet0/0/2]un sh
[AR5]int loo0
[AR5-LoopBack0]ip add 5.5.5.5 32
[AR5-LoopBack0]q
[AR5]rip 1
[AR5-rip-1]v 2
[AR5-rip-1]net 10.0.0.0
[AR5-rip-1]net 5.0.0.0
[AR4]int g0/0/2
[AR4-GigabitEthernet0/0/2]ip add 10.1.135.1 24
[AR4-GigabitEthernet0/0/2]un sh
[AR4-GigabitEthernet0/0/2]int g0/0/1
[AR4-GigabitEthernet0/0/1]ip add 10.1.134.2 24
[AR4-GigabitEthernet0/0/2]un sh
[AR4-GigabitEthernet0/0/1]int loo0
[AR4-LoopBack0]ip add 4.4.4.4 32
[AR4-LoopBack0]q
[AR4]int g0/0/0.21
[AR4-GigabitEthernet0/0/0.21]d t v 21
[AR4-GigabitEthernet0/0/0.21]ip add 10.1.21.1 24
[AR4-GigabitEthernet0/0/0.21]a b e
[AR4-GigabitEthernet0/0/0.21]un sh
[AR4-GigabitEthernet0/0/0.21]int g0/0/0.22
[AR4-GigabitEthernet0/0/0.22]d t v 22
[AR4-GigabitEthernet0/0/0.22]ip add 10.1.22.1 24
[AR4-GigabitEthernet0/0/0.22]a b e
[AR4-GigabitEthernet0/0/0.22]un sh
[AR4]rip 1
[AR4-rip-1]v 2
[AR4-rip-1]net 10.0.0.0
[AR4-rip-1]net 4.0.0.0
[AR4-rip-1]dis this
rip 1
version 2
network 10.0.0.0
network 4.0.0.0
[AR3]int g0/0/1
[AR3-GigabitEthernet0/0/1]ip add 10.1.134.1 24
[AR3-GigabitEthernet0/0/1]un sh
[AR3-GigabitEthernet0/0/1]int g0/0/0
[AR3-GigabitEthernet0/0/0]ip add 10.1.113.2 24
[AR3-GigabitEthernet0/0/0]un sh
[AR3-GigabitEthernet0/0/0]int loo0
[AR3-LoopBack0]ip add 3.3.3.3 32
[AR3-LoopBack0]q
[AR3]ospf 1 router-id 3.3.3.3
[AR3-ospf-1]a 0
[AR3-ospf-1-area-0.0.0.0]network 10.1.113.0 0.0.0.255
[AR3-ospf-1-area-0.0.0.0]network 3.3.3.3 0.0.0.0
[AR3-ospf-1-area-0.0.0.0]q
[AR3-ospf-1]import-route rip type 1 cost 5
[AR3-rip-1]v 2
[AR3-rip-1]net 10.0.0.0
[AR3-rip-1]import-route ospf
[AR3-rip-1]default-route originate
[AR2]int g4/0/0
[AR2-GigabitEthernet4/0/0]ip add 202.2.12.2 24
[AR2-GigabitEthernet4/0/0]un sh
[AR2-GigabitEthernet4/0/0]int g0/0/0
[AR2-GigabitEthernet0/0/0]ip add 10.1.113.1 24
[AR2-GigabitEthernet0/0/0]un sh
[AR2-GigabitEthernet0/0/0]int g0/0/2
[AR2-GigabitEthernet0/0/2]ip add 10.1.112.1 24
[AR2-GigabitEthernet0/0/2]un sh
[AR2-GigabitEthernet0/0/2]int g0/0/1
[AR2-GigabitEthernet0/0/1]ip add 10.1.111.1 24
[AR2-GigabitEthernet0/0/1]un sh
[AR2]int loo0
[AR2-LoopBack0]ip add 2.2.2.2 32
[AR2]ospf 1 router-id 2.2.2.2
[AR2-ospf-1]a 0
[AR2-ospf-1-area-0.0.0.0]network 2.2.2.2 0.0.0.0
[AR2-ospf-1-area-0.0.0.0]net 10.1.112.0 0.0.0.255
[AR2-ospf-1-area-0.0.0.0]net 10.1.113.0 0.0.0.255
[AR2-ospf-1-area-0.0.0.0]net 10.1.111.0 0.0.0.255
[AR2-ospf-1-area-0.0.0.0]dis this
area 0.0.0.0
network 2.2.2.2 0.0.0.0 #32位的掩码是0.0.0.0 网络号是2.2.2.2 不能设2.2.2.0
network 10.1.111.0 0.0.0.255
network 10.1.112.0 0.0.0.255
network 10.1.113.0 0.0.0.255
[AR2]ip route-static 0.0.0.0 0.0.0.0 202.2.12.1
[AR2]ospf 1
[AR2-ospf-1]default-route-advertise
[AR2]ac 2000
[AR2-acl-basic-2000]rule permit source 10.1.0.0 0.0.255.255
[AR2-acl-basic-2000]q
[AR2]int g4/0/0
[AR2-GigabitEthernet4/0/0]nat outbound 2000
[AR2-GigabitEthernet4/0/0]nat server protocol tcp global 202.2.12.3 www inside
10.1.100.100 www
[AR2-GigabitEthernet4/0/0]dis this
ip address 202.2.12.2 255.255.255.0
nat server protocol tcp global 202.2.12.3 www inside 10.1.100.100 www
nat outbound 2000
[Huawei]int g0/0/1
[Huawei-GigabitEthernet0/0/1]ip add 202.2.12.1 24
[Huawei-GigabitEthernet0/0/1]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip add 202.2.2.1 24
[Huawei-GigabitEthernet0/0/0]un sh
[SW1]v b 11 12 1001 1000
[SW1]interface g0/0/1
[SW1-GigabitEthernet0/0/1]p l a
[SW1-GigabitEthernet0/0/1]p d v 1001
[SW1-GigabitEthernet0/0/1]un sh
[SW1-GigabitEthernet0/0/1]interface g0/0/21
[SW1-GigabitEthernet0/0/21]p l a
[SW1-GigabitEthernet0/0/21]p d v 11
[SW1-GigabitEthernet0/0/21]un sh
[SW1-GigabitEthernet0/0/21]interface g0/0/22
[SW1-GigabitEthernet0/0/22]p l a
[SW1-GigabitEthernet0/0/22]p d v 12
[SW1-GigabitEthernet0/0/22]un sh
[SW1-GigabitEthernet0/0/22]q
[SW1]int eth-trunk1
[SW1-Eth-Trunk1]trunkport g 0/0/11 to 0/0/12
[SW1-Eth-Trunk1]p l a
[SW1-Eth-Trunk1]p d v 1000
[SW1-Eth-Trunk1]un sh
[SW1-Eth-Trunk1]q
[SW1]int vlanif11
[SW1-Vlanif11]ip add 10.1.11.1 24
[SW1-Vlanif11]int vlanif12
[SW1-Vlanif12]ip add 10.1.12.1 24
[SW1-Vlanif12]int vlanif1000
[SW1-Vlanif1000]ip add 10.1.122.11 24
[SW1-Vlanif1000]int vlanif1001
[SW1-Vlanif1001]ip add 10.1.111.12 24
[SW1-Vlanif1001]int loo0
[SW1-LoopBack0]ip add 11.11.11.11 32
[SW1-ospf-1]ospf 1 router-id 11.11.11.11
[SW1-ospf-1]a 0
[SW1-ospf-1-area-0.0.0.0]network 11.11.11.11 0.0.0.0
[SW1-ospf-1-area-0.0.0.0]network 10.1.122.0 0.0.0.255
[SW1-ospf-1-area-0.0.0.0]network 10.1.111.0 0.0.0.255
[SW1-ospf-1-area-0.0.0.0]net 10.1.11.0 0.0.0.255
[SW1-ospf-1-area-0.0.0.0]net 10.1.12.0 0.0.0.255
[SW1-ospf-1-area-0.0.0.0]dis this
network 11.11.11.11 0.0.0.0
network 10.1.122.0 0.0.0.255
network 10.1.111.0 0.0.0.255
network 10.1.11.0 0.0.0.255
network 10.1.12.0 0.0.0.255
[SW2]v b 13 14 1000 1002
[SW2]int g0/0/2
[SW2-GigabitEthernet0/0/2]p l a
[SW2-GigabitEthernet0/0/2]p d v 1002
[SW2-GigabitEthernet0/0/2]un sh
[SW2-GigabitEthernet0/0/2]int g0/0/23
[SW2-GigabitEthernet0/0/23]p l a
[SW2-GigabitEthernet0/0/23]p d v 13
[SW2-GigabitEthernet0/0/23]un sh
[SW2-GigabitEthernet0/0/23]int g0/0/24
[SW2-GigabitEthernet0/0/24]p l a
[SW2-GigabitEthernet0/0/24]p d v 14
[SW2-GigabitEthernet0/0/24]un sh
[SW2-GigabitEthernet0/0/24]q
[SW2]int eth-trunk1
[SW2-Eth-Trunk1]trunkport g 0/0/11 to 0/0/12
[SW2-Eth-Trunk1]p l a
[SW2-Eth-Trunk1]p d v 1000
[SW2-Eth-Trunk1]un sh
[SW2-Eth-Trunk1]q
[SW2]int vlanif 13
[SW2-Vlanif13]ip add 10.1.13.1 24
[SW2-Vlanif13]int vlanif 14
[SW2-Vlanif14]ip add 10.1.14.1 24
[SW2-Vlanif14]int vlanif 1000
[SW2-Vlanif1000]ip add 10.1.122.12 24
[SW2]int vlanif 1002
[SW2-Vlanif1002]ip add 10.1.112.12 24
[SW2-Vlanif1002]int loo0
[SW2-LoopBack0]ip add 22.22.22.22 32
[SW2]ospf 1 router-id 22.22.22.22
[SW2-ospf-1]a 0
[SW2-ospf-1-area-0.0.0.0]network 10.1.13.0 0.0.0.255
[SW2-ospf-1-area-0.0.0.0]network 10.1.14.0 0.0.0.255
[SW2-ospf-1-area-0.0.0.0]network 10.1.122.0 0.0.0.255
[SW2-ospf-1-area-0.0.0.0]network 10.1.112.0 0.0.0.255
[SW2-ospf-1-area-0.0.0.0]display this
network 10.1.13.0 0.0.0.255
network 10.1.14.0 0.0.0.255
network 10.1.122.0 0.0.0.255
network 10.1.112.0 0.0.0.255
[SW3]v b 11
[SW3]int g0/0/1
[SW3-GigabitEthernet0/0/1]p l a
[SW3-GigabitEthernet0/0/1]p d v 11
[SW3-GigabitEthernet0/0/1]un sh
[SW3]int e0/0/1
[SW3-Ethernet0/0/1]p l a
[SW3-Ethernet0/0/1]p d v 11
[SW3-Ethernet0/0/1]un sh
[SW4]vlan b 12
[SW4]int e0/0/1
[SW4-Ethernet0/0/1]p l a
[SW4-Ethernet0/0/1]p d v 12
[SW4-Ethernet0/0/1]un sh
[SW4]int g0/0/1
[SW4-GigabitEthernet0/0/1]p l a
[SW4-GigabitEthernet0/0/1]p d v 12
[SW4-GigabitEthernet0/0/1]un sh
[SW5]v b 13
[SW5]int e0/0/1
[SW5-Ethernet0/0/1]p l a
[SW5-Ethernet0/0/1]p d v 13
[SW5-Ethernet0/0/1]un sh
[SW5]int g0/0/1
[SW5-GigabitEthernet0/0/1]p l a
[SW5-GigabitEthernet0/0/1]p d v 13
[SW5-GigabitEthernet0/0/1]un sh
[SW6]v b 14
[SW6-Ethernet0/0/1]p l a
[SW6-Ethernet0/0/1]p d v 14
[SW6-Ethernet0/0/1]un sh
[SW6]int g0/0/1
[SW6-GigabitEthernet0/0/1]p l a
[SW6-GigabitEthernet0/0/1]p d v 14
[SW6-GigabitEthernet0/0/1]un sh
[SW7]v b 21 22
[SW7]int e0/0/10
[SW7-Ethernet0/0/10]p l t
[SW7-Ethernet0/0/10]p t a v 21 22
[SW7-Ethernet0/0/10]un sh
[SW7-Ethernet0/0/10]int e0/0/1
[SW7-Ethernet0/0/1]p l a
[SW7-Ethernet0/0/1]p d v 21
[SW7-Ethernet0/0/1]un sh
[SW7-Ethernet0/0/1]int e0/0/2
[SW7-Ethernet0/0/2]p l a
[SW7-Ethernet0/0/2]int e0/0/2
[SW7-Ethernet0/0/2]p d v 22
[SW7-Ethernet0/0/2]un sh
五.实验总结
OSPF下发默认路由:default-route-advertise命令的意思是本路由器发布一条0.0.0.0/0.0.0.0的路由到域内其他路由器。其他路由器学习到这条默认路由后,下一跳就是指向发布这条路由的路由器。
RIP下发默认路由:default-route originate