地址规划:
R1: 192.168.1.0 24 LOOPBUCK 1.1.1.1 24 14.1.1.1 24 14.1.1.3 24
R2: 192.168.2.0 24 LOOPNUCK 2.2.2.2 24 24.1.2.1 24
R3: 192.168.3.0 24 LOOPBUCK 3.3.3.3 24 34.1.3.1 24
R4: LOOPBUCL 4.4.4.4 24
14.1.1.2 24
24.1.2.2 24
34.1.3.2 24
45.1.5.2 24
46.1.6.2 24
R5: 192.168.4.0 24 LOOPBUCK 5.5.5.5 45.1.5.1 24
R6: 192.168.5.0 24 LOOPBUCK 6.6.6.6 46.1.6.1 24
步骤1:
配置缺省路由:
在R1上配置缺省路由:
ip router-static 0.0.0.0 0 14.1.1.2
在R2上配置缺省路由:
Ip router-static 0.0.0.0 0 24.1.2.2
在R3上配置缺省路由:
ip router-static 0.0.0.0 0 34.1.3.2
在R5上配置缺省路由:
ip router-static 0.0.0.0 0 45.1.5.2
在R6上配置缺省路由:
ip router-static 0.0.0.0 0 46.1.6.2
在R1上配置NAT:
ACL 2000
Rule permit source any
Int g0/0/1
Nat outbound 2000
ACL 2001
Rule permit source any
Int g0/0/2
Nat outbound 2001
在R2上配置NAT:
ACL 2000
Rule permit source any
Int g0/0/2
Nat outbound 2000
在R3上进行配置NAT:
ACL 2000
Rule permit source any
Int g0/0/2
Nat outbound 2000
在R5上配置NAT:
ACL 2000
Rule permit source any
Int g0/0/2
Nat outbound 2000
在R6上配置NAT:
ACL 2000
Rule permit source any
Int g0/0/2
Nat outbound 2000
要求1:
R1,R2,R3构建MGRE结构 其中R1为中心站点
R1:(设置为中心站点)
Int tunnel 0/0/0
Ip address 10.1.1.1 24
Tunnel-protocol gre p2mp
Source g0/0/q
Nhrp entry mulicast dynamic(使用NHRP让R1作为中心站点,进行伪广播)
Nhrp network-id 100
在R3上进行分支站点的注册
Int tunnel 0/0/0
ip address 10.1.1.2 24
Tunnel-protocol gre p2mp
Source 14.1.1.1
Nhrp entry 10.1.1.1 14.1.1.1 register
Nhrp network-id 100
在R4上进行分支站点的注册
Int tunnel 0/0/0
Ip address 10.1.1.3 24
Tunnel-protocol gre p2mp
Source 14.1.1.1
Nhrp entry 10.1.1.1 14.1.1.1 register
Nhrp network -id 100
R1,R5,R6构建另一个MGRE网络,其中R1,R5均为中心站点
将R1定义为MGRE的中心站点
R1:
int tunnel 0/0/1
Ip address 10.1.1.4 24
Tunnel-protocol gre p2mp
Source 14.1.1.1
Nhrp entry mulicast dynamic
Nhrp network-id 101
将R5定义为MGRE的中心站点
R5:
Int tunnel 0/0/1
Ip address 10.1.1.5 24
Tunnel -protocol gre p2mp
Source 45.1.5.1
Nhrp entry mulicast dynamic
Nhrp network-id 101
R6:(分支站点上进行注册)
Int tunnel 0/0/1
Ip address 10.1.1.6 24
Tunnel-protocol gre p2mp
Source 46.1.1.1
Nhrp entry 10.1.1.1 14.1.1.1 register
Nhrp entry 10.1.1.6 45.1.5.1 register
Nhrp network-id 101
R1向R5进行注册:
在R1上注册R5
int tunnel 0/0/1
Tunnel-protocol gre p2mp
Source 45.1.5.1
Nhrp entry 10.1.1.6 45.1.5.1 register
使用OSPF实现整个私有网络的互通,同时所有PC可以正常访问R4的环回
OSPF的创建规则:
1.合理的区域划分
2.合理的地址划分
在R1上启用OSPF
R1:
OSPF 1 router-id 1.1.1.1
Area 0
Network 192.168.1.0 0.0.0.255
Network 1.1.1.1 0.0.0.0
宣告两个隧道:
Network 10.1.4.1 0.0.0.0
Network 10.1.1.1 0.0.0.0
在R2上启用OSPF
R2:
OSPF 1 router-id 2.2.2.2
Area 1
Network 192.168.2.0 0.0.0.255
Network 2.2.2.2 0.0.0.0
OSPF 1 router-id 1.1.1.1
Area 0
Network 10.1.1.2 0.0.0.0 (将隧道通告到OSPF中)
在R3上启用OSPF
OSPF 1 router-id 3.3.3.3
Area 1
Network 192.168.3.0
Network 3.3.3.3 0.0.0.0
Network 34.1.3.0 0.0.0.255
Area 0
Network 10.1.1.3 0.0.0.0 (将隧道通告到OSPF中)
在R5上配置OSPF
OSPF 1 router-id 5.5.5.5
Area 2
Network 45.1.1.0 0.0.0.255
Network 5.5.5.5 0.0.0.0
Network 192.168.4.0 0.0.0.255
Area 0
Network 10.1.1.5 0.0.0.0
在R6上进行配置
OSPF 1 router-id 6.6.6.6
Area 2
Network 46.1.1.0 0.0.0.255
Network 6.6.6.6 0.0.0.0
Network 192.168.5.0 0.0.0.255
Area 0
Network 10.1.1.6 0.0.0.0
在隧道中修改网络类型:
在R1,R2,R3,R5,R6上修改网络类型为广播:
在R1,R2,R3上修改网络类型
Int tunnel 0/0/0
Ospf network-type brocast
将R3的接口优先级改为0,防止出现无法进行DR/BDR的选举:
int tunnel 0/0/0
OSPF dr-prioity 0
在R4,R5,R6上修改网络类型:
int tunnel 0/0/0
OSPF network-type brocast
在R5上修改接口优先级为0
Int tunnel0/0/0
Ospf dr-prioity 0