1.分配IP
2.配置IP
1.R1:
[r1]interface GigabitEthernet 0/0/0
[r1-GigabitEthernet0/0/0]ip address 172.16.33.1 24
[r1]int LoopBack 0
[r1-LoopBack0]ip address 172.16.34.1 24
2.R2:
[r2]int g0/0/0
[r2-GigabitEthernet0/0/0]ip address 172.16.33.2 24
[r2]int l0
[r2-LoopBack0]ip address 172.16.35.2 24
3.R3:
[r3]int g0/0/0
[r3-GigabitEthernet0/0/0]ip address 172.16.33.3 24
[r3]interface LoopBack 0
[r3-LoopBack0]ip address 172.16.36.3 24
[r3]int Serial 4/0/0
[r3-Serial4/0/0]ip address 34.0.0.3 24
4.R4:
[ISP]int s4/0/0
[ISP-Serial4/0/0]ip address 34.0.0.4 24
[ISP]int s4/0/1
[ISP-Serial4/0/1]ip address 45.0.0.4 24
[ISP]int s3/0/0
[ISP-Serial3/0/0]ip address 46.0.0.4 24
[ISP]int g0/0/0
[ISP-GigabitEthernet0/0/0]ip address 47.0.0.4 24
[ISP]int LoopBack 0
[ISP-LoopBack0]ip address 172.16.2.4 24
5.R5:
[r5]int s4/0/0
[r5-Serial4/0/0]ip address 45.0.0.5 24
[r5]int LoopBack 0
[r5-LoopBack0]ip address 172.16.3.5 24
6.R6
[r6]int s4/0/0
[r6-Serial4/0/0]ip address 46.0.0.6 24
[r6]int g0/0/0
[r6-GigabitEthernet0/0/0]ip address 172.16.65.1 30
[r6]int LoopBack 0
[r6-LoopBack0]ip address 172.16.4.6 24
7.R7
[r7]int g0/0/0
[r7-GigabitEthernet0/0/0]ip address 47.0.0.7 24
[r7]int g0/0/1
[r7-GigabitEthernet0/0/1]ip address 172.16.97.1 30
[r7]int LoopBack 0
[r7-LoopBack0]ip address 172.16.5.7 24
8.R8
[r8]int g0/0/0
[r8-GigabitEthernet0/0/0]ip address 172.16.97.2 30
[r8]int g0/0/1
[r8-GigabitEthernet0/0/1]ip address 172.16.97.5 30
[r8]int LoopBack 0
[r8-LoopBack0]ip address 172.16.98.8 24
9.R9
[r9]int g0/0/0
[r9-GigabitEthernet0/0/0]ip address 172.16.97.6 30
[r9]int g0/0/1
[r9-GigabitEthernet0/0/1]ip address 172.16.129.1 30
[r9]int LoopBack 0
[r9-LoopBack0]ip address 172.16.130.9 24
10.R10
[r10]int g0/0/0
[r10-GigabitEthernet0/0/0]ip address 172.16.129.2 30
[r10]int LoopBack 0
[r10-LoopBack0]ip address 172.16.131.10 24
11.R11
[r11]int g0/0/0
[r11-GigabitEthernet0/0/0]ip address 172.16.65.2 30
[r11]int g0/0/1
[r11-GigabitEthernet0/0/1]ip address 172.16.65.5 30
[r11]int LoopBack 0
[r11-LoopBack0]ip address 172.16.66.11 24
12.R12
[r12]int g0/0/0
[r12-GigabitEthernet0/0/0]ip address 172.16.65.6 30
[r12]int LoopBack 0
[r12-LoopBack0]ip address 172.16.160.12 24
[r12]int LoopBack 1
[r12-LoopBack1]ip address 172.16.161.12 24
3.测试公网是否通
[r7]ip route-static 0.0.0.0 0 47.0.0.4
[r6]ip route-static 0.0.0.0 0 46.0.0.4
[r5]ip route-static 0.0.0.0 0 45.0.0.4
[r3]ip route-static 0.0.0.0 0 34.0.0.4
4. 宣告网段
R1
[r1]ospf 1 router-id 1.1.1.1
[r1-ospf-1]area 1
[r1-ospf-1-area-0.0.0.1]network 172.16.33.0 0.0.0.255
[r1-ospf-1-area-0.0.0.1]network 172.16.34.0 0.0.0.255
R2
[r2]ospf 1 router-id 2.2.2.2
[r2-ospf-1]area 1
[r2-ospf-1-area-0.0.0.1]network 172.16.33.0 0.0.0.255
[r2-ospf-1-area-0.0.0.1]network 172.16.35.0 0.0.0.255
R3
[r3]ospf 1 router-id 3.3.3.3
[r3-ospf-1]area 1
[r3-ospf-1-area-0.0.0.1]network 172.16.33.0 0.0.0.255
[r3-ospf-1-area-0.0.0.1]network 172.16.36.0 0.0.0.255
R5
[r5]ospf 1 router-id 5.5.5.5
[r5-ospf-1]area 0
[r5-ospf-1-area-0.0.0.0]network 172.16.3.0 0.0.0.255
R6
[r6]ospf 1 router-id 6.6.6.6
[r6-ospf-1]area 0
[r6-ospf-1-area-0.0.0.0]network 172.16.4.0 0.0.0.255
[r6-ospf-1]area 2
[r6-ospf-1-area-0.0.0.2]network 172.16.65.0 0.0.0.255
R7
[r7]ospf 1 router-id 7.7.7.7
[r7-ospf-1]area 0
[r7-ospf-1-area-0.0.0.0]network 172.16.5.0 0.0.0.255
[r7-ospf-1]area 3
[r7-ospf-1-area-0.0.0.3]network 172.16.97.1 0.0.0.0
R8
[r8]ospf 1 router-id 8.8.8.8
[r8-ospf-1]area 3
[r8-ospf-1-area-0.0.0.3]network 172.16.98.0 0.0.0.255
[r8-ospf-1-area-0.0.0.3]network 172.16.97.2 0.0.0.0
[r8-ospf-1-area-0.0.0.3]network 172.16.97.5 0.0.0.0
R9
[r9]ospf 1 router-id 9.9.9.9
[r9-ospf-1]area 3
[r9-ospf-1-area-0.0.0.3]network 172.16.97.6 0.0.0.0
[r9-ospf-1]area 4
[r9-ospf-1-area-0.0.0.4]network 172.16.130.0 0.0.0.255
[r9-ospf-1-area-0.0.0.4]network 172.16.129.1 0.0.0.0
R10
[r10]ospf 1 router-id 10.10.10.10
[r10-ospf-1]area 4
[r10-ospf-1-area-0.0.0.4]network 172.16.131.0 0.0.0.255
[r10-ospf-1-area-0.0.0.4]network 172.16.129.2 0.0.0.0
R11
[r11]ospf 1 router-id 11.11.11.11
[r11-ospf-1]area 2
[r11-ospf-1-area-0.0.0.2]network 172.16.66.0 0.0.0.255
[r11-ospf-1-area-0.0.0.2]network 172.16.65.2 0.0.0.0
[r11-ospf-1-area-0.0.0.2]network 172.16.65.5 0.0.0.0
R12
[r12]ospf 1 router-id 12.12.12.12
[r12-ospf-1]area 2
[r12-ospf-1-area-0.0.0.2]network 172.16.65.6 0.0.0.0
[r12-ospf-1]rip 1
[r12-rip-1]version 2
[r12-rip-1]undo summary
[r12-rip-1]network 172.16.0.0
[r12-rip-1]ospf 1
[r12-ospf-1]import-route rip
5.,R3-R5/6/7为MGRE环境,R3为中心站点
R3
[r3]interface Tunnel 0/0/0
[r3-Tunnel0/0/0]ip address 172.16.6.3 24
[r3-Tunnel0/0/0]tunnel-protocol gre p2mp
[r3-Tunnel0/0/0]source Serial 4/0/0
[r3-Tunnel0/0/0]nhrp n
[r3-Tunnel0/0/0]nhrp network-id 100
[r3-Tunnel0/0/0]nhrp entry multicast dynamic
R5
[r5]interface Tunnel 0/0/0
[r5-Tunnel0/0/0]ip address 172.16.6.5 24
[r5-Tunnel0/0/0]tunnel-protocol gre p2mp
[r5-Tunnel0/0/0]source Serial 4/0/0
[r5-Tunnel0/0/0]nhrp network-id 100
[r5-Tunnel0/0/0]nhrp entry 172.16.6.3 34.0.0.3 register
R6
[r6]int Tunnel 0/0/0
[r6-Tunnel0/0/0]ip address 172.16.6.6 24
[r6-Tunnel0/0/0]tunnel-protocol gre p2mp
[r6-Tunnel0/0/0]source Serial 4/0/0
[r6-Tunnel0/0/0]nhrp network-id 100
[r6-Tunnel0/0/0]nhrp entry 172.16.6.3 34.0.0.3 register
R7
[r7-Tunnel0/0/0]ip address 172.16.6.7 24
[r7-Tunnel0/0/0]tunnel-protocol gre p2mp
[r7-Tunnel0/0/0]source g 0/0/0
[r7-Tunnel0/0/0]nhrp network-id 100
[r7-Tunnel0/0/0]nhrp entry 172.16.6.3 34.0.0.3 register
6.补充
[r3]ospf 1
[r3-ospf-1]a 0
[r3-ospf-1-area-0.0.0.0]network 172.16.6.0 0.0.0.255
[r3-Tunnel0/0/0]ospf network-type broadcast
[r5]ospf 1
[r5-ospf-1]area 0
[r5-ospf-1-area-0.0.0.0]network 172.16.6.0 0.0.0.255
[r5-Tunnel0/0/0]ospf network-type broadcast
[r5-Tunnel0/0/0]ospf dr-priority 0
[r6]ospf 1
[r6-ospf-1]area 0
[r6-ospf-1-area-0.0.0.0]network 172.16.6.0 0.0.0.255
[r6-Tunnel0/0/0]ospf network-type broadcast
[r6-Tunnel0/0/0]ospf dr-priority 0
[r7]ospf 1
[r7-ospf-1]area 0
[r7-ospf-1-area-0.0.0.0]network 172.16.6.0 0.0.0.255
[r7-Tunnel0/0/0]ospf network-type broadcast
[r7-Tunnel0/0/0]ospf dr-priority 0
[r9]ospf 1
[r9-ospf-1]import-route ospf 2
[r9]ospf 2
[r9-ospf-2]import-route ospf 1
[r12]ospf 1
[r12-ospf-1]import-route rip
7.对边界路由器配置NAT
[r3]acl 2000
[r3-acl-basic-2000]rule permit source 172.16.0.0 0.0.255.255
[r3]int s4/0/0
[r3-Serial4/0/0]nat outbound 2000
[r5]acl 2000
[r5-acl-basic-2000]rule permit source 172.16.0.0 0.0.255.255
[r5]int s4/0/0
[r5-Serial4/0/0]nat outbound 2000
[r6]acl 2000
[r6-acl-basic-2000]rule permit source 172.16.0.0 0.0.255.255
[r6]int s0/0/0
[r6-Serial4/0/0]nat outbound 2000
[r7]acl 2000
[r7-acl-basic-2000]rule permit source 172.16.0.0 0.0.255.255
[r7-acl-basic-2000]int g0/0/0
[r7-GigabitEthernet0/0/0]nat outbound 2000
8.汇总
[r3]ospf 1
[r3-ospf-1]area 1
[r3-ospf-1-area-0.0.0.1]abr-summary 172.16.32.0 255.255.224.0
[r6]ospf 1
[r6-ospf-1]area 2
[r6-ospf-1-area-0.0.0.2]abr-summary 172.16.64.0 255.255.224.0
[r7]ospf 1
[r7-ospf-1]area 3
[r7-ospf-1-area-0.0.0.3]abr-summary 172.16.96.0 255.255.224.0
[r9]ospf 1
[r9-ospf-1]area 4
[r9-ospf-1-area-0.0.0.4]abr-summary 172.16.128.0 255.255.224.0
[r12]ospf 1
[r12-ospf-1]asbr-summary 172.16.160.0 255.255.224.0
[r1-ospf-1]area 1
[r1-ospf-1-area-0.0.0.1]stub no-summary
[r2]ospf 1
[r2-ospf-1]a 1
[r2-ospf-1-area-0.0.0.1]stub no-summary
[r3]ospf 1
[r3-ospf-1]a 1
[r3-ospf-1-area-0.0.0.1]stub no-summary
[r6]ospf 1
[r6-ospf-1]area 2
[r6-ospf-1-area-0.0.0.2]nssa no-summary
[r7]ospf 1
[r7-ospf-1]area 3
[r7-ospf-1-area-0.0.0.3]nssa no-summary
[r8]ospf 1
[r8-ospf-1]area 3
[r8-ospf-1-area-0.0.0.3]nssa no-summary
[r9]ospf 1
[r9-ospf-1]area 3
[r9-ospf-1-area-0.0.0.3]nssa no-summary
[r9]ospf 2
[r9-ospf-2]default-route-advertise