要求
1、R4为ISP,其上只能配置IP地址;R4与其他所有直连设备间使用公有IP
2、R3-R5/6/7为MGRE环境,R3为中心站点
3、整个OSPF环境IP地址为172.16.0.0/16
4、所有设备均可访问R4的环回
5、减少LSA的更新量,加快收敛,保障更新安全
6、全网可达
IP分配
172.16.0.0 17——OSPF
172.16.128.0 17——RIP
172.16.0.0 20——area 0
172.16.0.0 24——MGRE
172.16.1.0 24
172.16.2.0 24
....
172.16.15.0 24
172.16.163. 20——area 1
172.16.16.0 24——骨干
172.16.17.0 24
172.16.18.0 24
172.16.32.0 20——area 2
172.16.48.0 20——area 3
172.16.64.0 20——area 4
172.16.80.0 20
172.168.96.0 20
172.16.112.0 20
配置MGRE
R3
R5
R6
R7
在R3、R5、R6、R7上写一条缺省路由指向外网ISP
[R3] ip route-static 0.0.0.0 0 34.0.0.4
[R5] ip route-static 0.0.0.0 0 45.0.0.4
[R6] ip route-static 0.0.0.0 0 46.0.0.4
[R7] ip route-static 0.0.0.0 0 47.0.0.4
R1:
interface GigabitEthernet0/0/0
ip address 172.16.16.1 29
interface LoopBack0
ip address 17.16.17.1 29
R2:
interface GigabitEthernet0/0/0
ip address 172.16.16.2 29
interface LoopBack0
ip address 17.16.18.1 29
R3:
interface Serial3/0/0
ip address 34.0.0.1 24
interface GigabitEthernet0/0/0
ip address 172.16.16.23 29
interface LoopBack0
ip address 17.16.19.1 29ip route-static 0.0.0.0 0.0.0.0 34.0.0.4
R4:
interface Serial4/0/0
ip address 34.0.0.4 24
interface Serial4/0/1
ip address 45.0.0.4 24
interface Serial3/0/0
ip address 46.0.0.4 24
interface GigabitEthernet0/0/0
ip address 47.0.0.4 24
interface LoopBack0
ip address 4.4.4.4 24
R5:
interface Serial4/0/0
ip address 45.0.0.5 24
interface LoopBack0
ip address 172.16.1.1 24
ip route-static 0.0.0.0 0.0.0.0 45.0.0.4
R6:
interface Serial4/0/0
ip address 46.0.0.6 24
interface GigabitEthernet0/0/1
ip address 172.16.32.1 30
interface LoopBack0
ip address 172.16.2.1 24
ip route-static 0.0.0.0 0.0.0.0 46.0.0.4
R7:
interface GigabitEthernet0/0/0
ip address 47.0.0.7 24interface GigabitEthernet0/0/1
ip address 172.16.48.1 30
interface LoopBack0
ip address 172.16.3.1 24
ip route-static 0.0.0.0 0.0.0.0 47.0.0.4
R8:
interface GigabitEthernet0/0/0
ip address 172.16.48.2 30interface GigabitEthernet0/0/1
ip address 172.16.48.5 30
interface LoopBack0
ip address 172.16.49.1 24
R9:
interface GigabitEthernet0/0/0
ip address 172.16.48.6 30interface GigabitEthernet0/0/1
ip address 172.16.66.1 30
interface LoopBack0
ip address 172.16.64.1 24
R10:
interface GigabitEthernet0/0/0
ip address 172.16.66.2 30interface LoopBack0
ip address 172.16.65.1 24
R11:
interface GigabitEthernet0/0/0
ip address 172.16.32.2 30interface GigabitEthernet0/0/1
ip address 172.16.32.5 30
interface LoopBack0
ip address 172.16.33.1 24
R12:
interface GigabitEthernet0/0/0
ip address 172.16.32.6 30
R1配置
ospf 1 router-id 1.1.1.1
area 1
network 172.16.17.1 0.0.0.0
R2:
ospf 1 router-id 2.2.2.2
area 1network 172.16.17.2 0.0.0.0
R3:
ospf 1 router-id 3.3.3.3
area 0
network 172.16.17.3 0.0.0.0
area 0
network 172.16.19.1 0.0.0.0
network 172.16.0.1 0.0.0.0
R5:
ospf 1 router-id 5.5.5.5
area 0network 172.16.1.1 0.0.0.0
network 172.16.0.2 0.0.0.0
R6:
ospf 1 router-id 6.6.6.6
area 0
network 172.16.2.1 0.0.0.0
network 172.16.0.3 0.0.0.0
area 2
network 172.16.32.1 0.0.0.0
R7:
ospf 1 router-id 7.7.7.7
area 0
network 47.0.0.7 0.0.0.0
area 3network 172.16.48.1 0.0.0.0
network 172.16.0.4 0.0.0.0
R8:
ospf 1 router-id 8.8.8.8
area 3network 172.16.48.2 0.0.0.0
network 172.16.48.5 0.0.0.0
R9:
ospf 1 router-id 9.9.9.9
import-route ospf 2
area 3
network 172.16.48.6 0.0.0.0
ospf 2 router-id 9.9.9.9
import-route ospf 1
area 4
network 172.16.64.1 0.0.0.0
network 172.16.66.1 0.0.0.0
R10:
ospf 2 router-id 10.10.10.10
area 4
network 172.16.66.2 0.0.0.0network 172.16.65.1 0.0.0.0
R11:
ospf 1 router-id 11.11.11.11
area 2
network 172.16.32.2 0.0.0.0network 172.16.33.1 0.0.0.0
network 172.16.32.5 0.0.0.0
R12:
ospf 1 router-id 12.12.12.12
import-route rip 1
area 2
network 172.16.32.6 0.0.0.0
NAT配置
R3:
acl 2000
rule 5 permit source 172.16.0.0 0.0.255.255
int s4/0/0
nat outbound 2000
R4:
acl 2000
rule 5 permit source 172.16.0.0 0.0.255.255
int s4/0/0
nat outbound 2000
R6:
acl 2000
rule 5 permit source 172.16.0.0 0.0.255.255
int s4/0/0
nat outbound 2000
R7:
acl 2000
rule 5 permit source 172.16.0.0 0.0.255.255
int g0/0/0
nat outbound 2000