要求:
1、R4为ISP,所连接的所有物理接口为公有网段,任意指定ip即可
2、R1-2-3 构建一个星型结构的MGRE结构,其中r1为中心点,假设r1的公有ip为固定地址
3、R1-5-6 构建另一个全连网状的MGRE网络,其中R1/5均为中心区域;
4.使用OSpF实现整个私有网络的互通,同时所有pc可以正常访问R4的环回
拓扑图
PC机的配置:
AR1
sysname r1
acl number 2000
rule 5 permit source 192.168.0.0 0.0.255.255
interface GigabitEthernet0/0/0
ip address 192.168.1.1 255.255.255.0
interface GigabitEthernet0/0/1
ip address 12.1.1.1 255.255.255.0
nat outbound 2000
interface GigabitEthernet0/0/2
ip address 11.1.1.1 255.255.255.0
nat outbound 2000
interface Tunnel0/0/0
ip address 10.1.1.1 255.255.255.0
tunnel-protocol gre p2mp
source 11.1.1.1
ospf network-type broadcast
nhrp entry multicast dynamic
nhrp network-id 100
interface Tunnel0/0/1
ip address 20.1.1.1 255.255.255.0
tunnel-protocol gre p2mp
source 12.1.1.1
ospf network-type broadcast
nhrp entry multicast dynamic
nhrp network-id 200
nhrp entry 20.1.1.2 15.1.1.1 register
ospf 1 router-id 1.1.1.1
default-route-advertise always
import-route ospf 2
area 0.0.0.0
network 10.1.1.0 0.0.0.255
network 192.168.1.0 0.0.0.255
ospf 2 router-id 7.7.7.7
default-route-advertise always
import-route ospf 1
area 0.0.0.0
network 20.1.1.0 0.0.0.255
ip route-static 0.0.0.0 0.0.0.0 11.1.1.2
ip route-static 0.0.0.0 0.0.0.0 12.1.1.2
AR2
sysname r2
acl number 2000
rule 5 permit
firewall zone Local
priority 15
interface GigabitEthernet0/0/0
ip address 13.1.1.1 255.255.255.0
nat outbound 2000
interface GigabitEthernet0/0/1
ip address 192.168.2.1 255.255.255.0
interface Tunnel0/0/0
ip address 10.1.1.2 255.255.255.0
tunnel-protocol gre p2mp
source GigabitEthernet0/0/0
ospf network-type broadcast
ospf dr-priority 0
nhrp network-id 100
nhrp entry 10.1.1.1 11.1.1.1 register
ospf 1 router-id 2.2.2.2
area 0.0.0.0
network 10.1.1.0 0.0.0.255
network 192.168.2.0 0.0.0.255
ip route-static 0.0.0.0 0.0.0.0 13.1.1.2
user-interface con 0
authentication-mode password
user-interface vty 0 4
user-interface vty 16 20
AR3
sysname r3
acl number 2000
rule 5 permit
interface GigabitEthernet0/0/0
ip address 14.1.1.1 255.255.255.0
nat outbound 2000
interface GigabitEthernet0/0/1
ip address 192.168.3.1 255.255.255.0
interface Tunnel0/0/0
ip address 10.1.1.3 255.255.255.0
tunnel-protocol gre p2mp
source GigabitEthernet0/0/0
ospf network-type broadcast
ospf dr-priority 0
nhrp network-id 100
nhrp entry 10.1.1.1 11.1.1.1 register
ospf 1 router-id 3.3.3.3
area 0.0.0.0
network 10.1.1.0 0.0.0.255
network 192.168.3.0 0.0.0.255
ip route-static 0.0.0.0 0.0.0.0 14.1.1.2
ISP
sysname ISP
interface GigabitEthernet0/0/0
ip address 12.1.1.2 255.255.255.0
interface GigabitEthernet0/0/1
ip address 11.1.1.2 255.255.255.0
interface GigabitEthernet0/0/2
ip address 13.1.1.2 255.255.255.0
interface GigabitEthernet2/0/0
ip address 14.1.1.2 255.255.255.0
interface GigabitEthernet3/0/0
ip address 16.1.1.2 255.255.255.0
interface GigabitEthernet4/0/0
ip address 15.1.1.2 255.255.255.0
interface LoopBack1
ip address 1.1.1.1 255.255.255.0
AR5
sysname r5
acl number 2000
rule 5 permit
interface GigabitEthernet0/0/0
ip address 15.1.1.1 255.255.255.0
nat outbound 2000
interface GigabitEthernet0/0/1
ip address 192.168.4.1 255.255.255.0
interface Tunnel0/0/1
ip address 20.1.1.2 255.255.255.0
tunnel-protocol gre p2mp
source 15.1.1.1
ospf network-type broadcast
ospf dr-priority 0
nhrp entry multicast dynamic
nhrp network-id 200
nhrp entry 20.1.1.1 12.1.1.1 register
ospf 2 router-id 5.5.5.5
area 0.0.0.0
network 20.1.1.0 0.0.0.255
network 192.168.4.0 0.0.0.255
ip route-static 0.0.0.0 0.0.0.0 15.1.1.2
AR6
sysname r6
acl number 2000
rule 5 permit
interface GigabitEthernet0/0/0
ip address 16.1.1.1 255.255.255.0
nat outbound 2000
interface GigabitEthernet0/0/1
ip address 192.168.5.1 255.255.255.0
interface Tunnel0/0/1
ip address 20.1.1.3 255.255.255.0
tunnel-protocol gre p2mp
source GigabitEthernet0/0/0
ospf network-type broadcast
nhrp network-id 200
nhrp entry 20.1.1.1 12.1.1.1 register
nhrp entry 20.1.1.2 15.1.1.1 register
ospf 2
area 0.0.0.0
network 20.1.1.0 0.0.0.255
network 192.168.5.0 0.0.0.255
ip route-static 0.0.0.0 0.0.0.0 16.1.1.2
结果