1、左边三台设备配置OSPF 10,区域0;
2、右边为OSPF 1 中间是Area0,下挂Area1和Area2.
要点:
- 配置IP地址
- 配置静态路由
- 配置MGRE、NHRP
- 配置OSPF,MGRE部分ospf接口网络类型改为p2mp,hello时间改为10s
- 绑定NAT,配置OSPF下发缺省
- 两边打通GRE,并对用户网配置静态路由使其互通(如1.1.1.1-9.9.9.9)
配置:
R1:
interface LoopBack0
ip address 1.1.1.1 255.255.255.255
ospf 10 router-id 1.1.1.1
area 0.0.0.0
network 1.1.1.1 0.0.0.0
network 192.168.1.1 0.0.0.0
R2:
ospf 10 router-id 2.2.2.2
area 0.0.0.0
network 192.168.1.2 0.0.0.0
R3:
interface Tunnel0/0/0
ip address 10.0.1.1 255.255.255.0
tunnel-protocol gre
source 34.0.0.1
destination 45.0.0.2
ip route-static 0.0.0.0 0.0.0.0 34.0.0.2
ip route-static 9.9.9.9 255.255.255.255 10.0.1.2
ip route-static 16.16.16.16 255.255.255.255 10.0.1.2
ospf 10 router-id 3.3.3.3
default-route-advertise
area 0.0.0.0
network 192.168.1.3 0.0.0.0
[r3]acl 2000
[r3-acl-basic-2000]rule permit source any
[r3-GigabitEthernet0/0/1]nat outbound 2000
R5:
interface Tunnel0/0/0
ip address 10.0.1.2 255.255.255.0
tunnel-protocol gre
source 45.0.0.2
destination 34.0.0.1
ip route-static 0.0.0.0 0.0.0.0 45.0.0.1
ip route-static 1.1.1.1 255.255.255.255 10.0.1.1
ospf 1 router-id 5.5.5.5
default-route-advertise
area 0.0.0.0
network 192.168.2.1 0.0.0.0
rule 5 permit source 192.168.0.0 0.0.255.255
nat outbound 2000
R6:
ip route-static 7.0.0.0 255.255.255.0 67.0.0.2
ip route-static 47.0.0.0 255.255.255.0 67.0.0.2
ip route-static 78.0.0.0 255.255.255.0 67.0.0.2
interface Tunnel0/0/0
ip address 10.0.0.1 255.255.255.0
tunnel-protocol gre p2mp
source 67.0.0.1
ospf network-type p2mp
ospf timer hello 10
nhrp entry multicast dynamic
ospf 1 router-id 6.6.6.6
area 0.0.0.0
network 10.0.0.1 0.0.0.0
network 192.168.2.2 0.0.0.0
R8:
ip route-static 7.0.0.0 255.255.255.0 78.0.0.2
ip route-static 47.0.0.0 255.255.255.0 78.0.0.2
ip route-static 67.0.0.0 255.255.255.0 78.0.0.2
ospf 1 router-id 8.8.8.8
area 0.0.0.0
network 10.0.0.2 0.0.0.0
network 192.168.3.1 0.0.0.0
R9:
interface LoopBack0
ip address 9.9.9.9 255.255.255.255
ospf 1 router-id 9.9.9.9
area 0.0.0.0
network 9.9.9.9 0.0.0.0
network 192.168.3.2 0.0.0.0
R10:
interface Tunnel0/0/0
ip address 10.0.0.3 255.255.255.0
tunnel-protocol gre p2mp
source GigabitEthernet0/0/0
ospf network-type p2mp
ospf timer hello 10
nhrp entry 10.0.0.1 67.0.0.1 register
ip route-static 47.0.0.0 255.255.255.0 7.0.0.2
ip route-static 67.0.0.0 255.255.255.0 7.0.0.2
ip route-static 78.0.0.0 255.255.255.0 7.0.0.2
ospf 1 router-id 10.10.10.10
area 0.0.0.0
network 10.0.0.3 0.0.0.0
network 192.168.6.1 0.0.0.0
R11:
ospf 1 router-id 11.11.11.11
area 0.0.0.0
network 192.168.6.2 0.0.0.0
area 0.0.0.1
network 192.168.7.1 0.0.0.0
R12:
ospf 1 router-id 12.12.12.12
area 0.0.0.1
network 192.168.7.2 0.0.0.0
network 192.168.8.1 0.0.0.0
R13:
ospf 1 router-id 13.13.13.13
area 0.0.0.1
network 13.13.13.13 0.0.0.0
network 192.168.8.2 0.0.0.0
R14:
interface Tunnel0/0/0
ip address 10.0.0.4 255.255.255.0
tunnel-protocol gre p2mp
source GigabitEthernet0/0/0
ospf network-type p2mp
ospf timer hello 10
nhrp entry 10.0.0.1 67.0.0.1 register
ip route-static 7.0.0.0 255.255.255.0 47.0.0.2
ip route-static 67.0.0.0 255.255.255.0 47.0.0.2
ip route-static 78.0.0.0 255.255.255.0 47.0.0.2
ospf 1 router-id 14.14.14.14
area 0.0.0.0
network 10.0.0.4 0.0.0.0
network 192.168.4.1 0.0.0.0
R15:
ospf 1 router-id 15.15.15.15
area 0.0.0.0
network 192.168.4.2 0.0.0.0
area 0.0.0.2
network 192.168.5.1 0.0.0.0
R16:
ospf 1 router-id 16.16.16.16
area 0.0.0.2
network 16.16.16.16 0.0.0.0
network 192.168.5.2 0.0.0.0