1.路由器的IP分配
1.对R6即ISP进行相关配置:
[ISP]interface GigabitEthernet 0/0/1
[ISP-GigabitEthernet0/0/1]ip address 15.0.0.2 8
[ISP]interface GigabitEthernet 0/0/0
[ISP-GigabitEthernet0/0/0]ip address 65.0.0.2 8
[ISP]interface GigabitEthernet 4/0/2
[ISP-GigabitEthernet4/0/2]ip ad 25.0.0.2 8
[ISP]interface GigabitEthernet 4/0/3
[ISP-GigabitEthernet4/0/3]ip address 35.0.0.2 8
[ISP]interface GigabitEthernet 4/0/0
[ISP-GigabitEthernet4/0/0]ip address 45.0.0.2 8
[ISP]interface GigabitEthernet 0/0/2
[ISP-GigabitEthernet0/0/2]ip address 55.0.0.2 8
2.测试公网是否通畅
2.把R1,R4,R5 构造为全连的MGRE结构
为了使R1,R4,R5为全连的MGRE结构需要对每个路由器进行中心和分支的配置
1.对R1进行相关配置
[r1]interface Tunnel 0/0/0
[r1-Tunnel0/0/0]display this
[V200R003C00]
#
interface Tunnel0/0/0
ip address 192.168.1.1 255.255.255.0
tunnel-protocol gre p2mp
source GigabitEthernet0/0/1
nhrp network-id 100
nhrp entry 192.168.1.5 55.0.0.1 register
nhrp entry 192.168.1.4 45.0.0.1 register
#
return
2.对R4进行相关配置
[r4]interface Tunnel 0/0/0
[r4-Tunnel0/0/0]ip address 192.168.1.4 24
[r4-Tunnel0/0/0]tunnel-protocol gre p2mp
[r4-Tunnel0/0/0]source GigabitEthernet 0/0/0
[r4-Tunnel0/0/0]nhrp network-id 100
[r4-Tunnel0/0/0]nhrp entry 192.168.1.1 15.0.0.1 register
[r4-Tunnel0/0/0]nhrp entry 192.168.1.5 55.0.0.1 register
3.对R5进行相关配置:
[r5]interface Tunnel 0/0/0
[r5-Tunnel0/0/0]ip address 192.168.1.5 24
[r5-Tunnel0/0/0]tunnel-protocol gre p2mp
[r5-Tunnel0/0/0]source GigabitEthernet 0/0/0
[r5-Tunnel0/0/0]nhrp network-id 100
[r5-Tunnel0/0/0]nhrp entry 192.168.1.1 15.0.0.1 register
[r5-Tunnel0/0/0]nhrp entry 192.168.1.4 45.0.0.1 register
4.测试隧道是否建通:
3.R1,R2,R3为星型拓扑结构,其中R1为中心站点
1.对中心站点R1的第2条隧道进行相关配置:
[r1]interface Tunnel 0/0/1
[r1-Tunnel0/0/1]ip address 192.168.2.1 24
[r1-Tunnel0/0/1]tunnel-protocol gre p2mp
[r1-Tunnel0/0/1]source GigabitEthernet 0/0/0
[r1-Tunnel0/0/1]nhrp network-id 50
[r1-Tunnel0/0/1]display this
[V200R003C00]
#
interface Tunnel0/0/1
ip address 192.168.2.1 255.255.255.0
tunnel-protocol gre p2mp
source GigabitEthernet0/0/0
nhrp network-id 50
#
return
2.对分支R2进项相关配置:
[r2]interface Tunnel 0/0/0
[r2-Tunnel0/0/0]ip address 192.168.2.2 24
[r2-Tunnel0/0/0]tunnel-protocol gre p2mp
[r2-Tunnel0/0/0]source GigabitEthernet 0/0/0
[r2-Tunnel0/0/0]nhrp network-id 50
[r2-Tunnel0/0/0]nhrp entry 192.168.2.1 65.0.0.1 register
[r2-Tunnel0/0/0]display this
[V200R003C00]
#
interface Tunnel0/0/0
ip address 192.168.2.2 255.255.255.0
tunnel-protocol gre p2mp
source GigabitEthernet0/0/0
nhrp network-id 50
nhrp entry 192.168.2.1 65.0.0.1 register
#
return
3.对分支R3进行相关配置 :
[r3]interface Tunnel 0/0/0
[r3-Tunnel0/0/0]ip address 192.168.2.3 24
[r3-Tunnel0/0/0]tunnel-protocol gre p2mp
[r3-Tunnel0/0/0]source GigabitEthernet 0/0/0
[r3-Tunnel0/0/0]nhrp network-id 50
[r3-Tunnel0/0/0]nhrp entry 192.168.2.1 65.0.0.1
[r3-Tunnel0/0/0]display this
[V200R003C00]
#
interface Tunnel0/0/0
ip address 192.168.2.3 255.255.255.0
tunnel-protocol gre p2mp
source GigabitEthernet0/0/0
nhrp network-id 50
nhrp entry 192.168.2.1 65.0.0.1
#
return
4.测试隧道是否建通:
4.对路由器配置ospf环境
1.对于R1,R4,R5这条隧道进行配置:
[r1]ospf 1 router-id 1.1.1.
[r1-ospf-1]area 0
[r1-ospf-1-area-0.0.0.0]net
[r1-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.255
[r4]ospf 1 router-id 2.2.2.2
[r4-ospf-1]area 0
[r4-ospf-1-area-0.0.0.0]net
[r4-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.255
[r5]ospf 1 router-id 5.5.5.5
[r5-ospf-1]area 0
[r5-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.255
[r4-Tunnel0/0/0]nhrp entry multicast dynamic
[r5-Tunnel0/0/0]nhrp entry multicast dynamic
2.对R1,R2,R3这条隧道进行配置:
[r1]ospf 1 router-id 1.1.1.1
[r1-ospf-1]area 1
[r1-ospf-1-area-0.0.0.1]network 192.168.2.0 0.0.0.255
[r2]ospf 1 router-id 4.4.4.4
[r2-ospf-1]area 1
[r2-ospf-1-area-0.0.0.1]network 192.168.2.0 0.0.0.255
[r3]ospf 1 router-id 3.3.3.3
[r3-ospf-1]area 1
[r3-ospf-1-area-0.0.0.1]network 192.168.2.0 0.0.0.255
[r1-Tunnel0/0/1]ospf network-type broadcast
[r2]interface Tunnel 0/0/0
[r2-Tunnel0/0/0]ospf network-type p2mp
[r3]interface Tunnel 0/0/0
[r3-Tunnel0/0/0]ospf network-type p2mp
3.测试私有网络可以互相通讯