目录
一.R6为ISP只能配置IP地址,R1-R5的环回为私有网段;
实验要求:
1.R6为ISP只能配置IP地址,R1-R5的环回为私有网段;
2.R1/4/5为全连的MGRE结构,R1/2/3为星型的拓扑结构,R1为中心站点;
3.所有私有网段可以互相通讯,私有网段使用OSPF完成
一.R6为ISP只能配置IP地址,R1-R5的环回为私有网段;
1,给路由器配置IP地址和环回
[R3-GigabitEthernet0/0/0]ip add 1.0.0.1 24
[R3]int l 0
[R3-LoopBack0]ip add 192.168.1.1 24
[R4-GigabitEthernet0/0/0]ip add 6.0.0.1 24
[R4-GigabitEthernet0/0/0]q
[R4]int l0
[R4-LoopBack0]ip add 192.168.5.1 24
[R5-GigabitEthernet0/0/0]ip add 5.0.0.1 24
[R5-GigabitEthernet0/0/0]q
[R5]int l0
[R5-LoopBack0]ip add 192.168.4.1 24
[R1-GigabitEthernet0/0/1]ip add 4.0.0.1 24
[R1-GigabitEthernet0/0/1]q
[R1]int g 0/0/0
[R1-GigabitEthernet0/0/0]ip add 3.0.0.1 24
[R1-GigabitEthernet0/0/0]q
[R1]int l0
[R1-LoopBack0]ip add 192.168.3.1 24
[R2-GigabitEthernet0/0/0]ip add 2.0.0.1 24
[R2-GigabitEthernet0/0/0]q
[R2]int l0
[R2-LoopBack0]ip add 192.168.2.1 24
[ISP-GigabitEthernet0/0/0]ip add 3.0.0.2 24
[ISP]int g 0/0/1
[ISP-GigabitEthernet0/0/1]ip add 4.0.0.2 24
[ISP]int g 0/0/2
[ISP-GigabitEthernet0/0/2]ip add 2.0.0.2 24
[ISP-GigabitEthernet0/0/2]
[ISP]int g 4/0/0
[ISP-GigabitEthernet4/0/0]ip add 1.0.0.2 24
[ISP-GigabitEthernet4/0/0]
[ISP]int g 3/0/0
[ISP-GigabitEthernet3/0/0]ip add 6.0.0.2 24
[ISP-GigabitEthernet3/0/0]
[ISP]int g 2/0/0
[ISP-GigabitEthernet2/0/0]ip add 5.0.0.2 24
二.R1/4/5为全连的MGRE结构;
1.给R1/4/5进行中心配置
[R1]int T 0/0/0
[R1-Tunnel0/0/0]ip add 192.168.6.1 24
[R1-Tunnel0/0/0]tunnel-protocol gre p2mp
[R1-Tunnel0/0/0]source 4.0.0.1
[R1-Tunnel0/0/0]nhrp network-id 100
[R4]int T 0/0/0
[R4-Tunnel0/0/0]ip add 192.168.6.2 24
[R4-Tunnel0/0/0]tunnel-protocol gre p2mp
[R4-Tunnel0/0/0]source 6.0.0.1
[R4-Tunnel0/0/0]nhrp network-id 400
[R5]interface t 0/0/0
[R5-Tunnel0/0/0]ip add 192.168.6.3 24
[R5-Tunnel0/0/0]tunnel-protocol gre p2mp
[R5-Tunnel0/0/0]source 5.0.0.1
[R5-Tunnel0/0/0]nhrp network-id 500
2.互相进行注册配置
[R1]int t 0/0/0
[R1-Tunnel0/0/0]source GigabitEthernet 0/0/1
[R1-Tunnel0/0/0]nhrp network-id 400
[R1-Tunnel0/0/0]nhrp network-id 500
[R1-Tunnel0/0/0]nhrp entry 192.168.6.2 6.0.0.1 register
[R1-Tunnel0/0/0]nhrp entry 192.168.6.3 5.0.0.1 register
[R4]int t 0/0/0
[R4-Tunnel0/0/0]source GigabitEthernet 0/0/0
[R4-Tunnel0/0/0]nhrp network-id 100
[R4-Tunnel0/0/0]nhrp network-id 500
[R4-Tunnel0/0/0]nhrp entry 192.168.6.1 4.0.0.1 register
[R4-Tunnel0/0/0]nhrp entry 192.168.6.3 5.0.0.1 register
[R5]interface Tunnel 0/0/0
[R5-Tunnel0/0/0]source GigabitEthernet 0/0/0
[R5-Tunnel0/0/0]nhrp network-id 100
[R5-Tunnel0/0/0]nhrp network-id 400
[R5-Tunnel0/0/0]nhrp entry 192.168.6.1 4.0.0.1 register
[R5-Tunnel0/0/0]nhrp entry 192.168.6.2 6.0.0.1 register
三.R1/2/3为星型的拓扑结构,R1为中心站点;
R1中心路由的配置
[R1]int t 0/0/1
[R1-Tunnel0/0/1]ip add 192.168.7.1 24
[R1-Tunnel0/0/1]tunnel-protocol gre p2mp
[R1-Tunnel0/0/1]source 3.0.0.1
[R1-Tunnel0/0/1]nhrp network-id 200
R2,R3上的配置
[R2]int t 0/0/1
[R2-Tunnel0/0/1]ip add 192.168.7.2 24u
[R2-Tunnel0/0/1]tunnel-protocol gre p2mp
[R2-Tunnel0/0/1]source GigabitEthernet 0/0/0
[R2-Tunnel0/0/1]nhrp network-id 200
[R2-Tunnel0/0/1]nhrp entry 192.168.7.1 3.0.0.1 register
[R3]interface t 0/0/1
[R3-Tunnel0/0/1]ip add 192.168.7.3 24
[R3-Tunnel0/0/1]tunnel-protocol gre p2mp
[R3-Tunnel0/0/1]source GigabitEthernet 0/0/0
[R3-Tunnel0/0/1]nhrp network-id 200
[R3-Tunnel0/0/1]nhrp entry 192.168.7.1 3.0.0.1 register
3.所有私有网段可以互相通讯,私有网段使用OSPF完成
R1:
[R1]ospf 1 router-id 1.1.1.1
[R1-ospf-1]area 0
[R1-ospf-1-area-0.0.0.0]network 192.168.3.1 0.0.0.0
[R1-ospf-1-area-0.0.0.0]network 192.168.6.0 0.0.0.255
[R1-ospf-1-area-0.0.0.0]network 192.168.7.0 0.0.0.255
R2:
[R2]ospf 1 router-id 2.2.2.2
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]network 192.168.2.1 0.0.0.0
[R2-ospf-1-area-0.0.0.0]network 192.168.7.0 0.0.0.255
R3
[R3]ospf 1 router-id 3.3.3.3
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]network 192.168.1.1 0.0.0.0
[R3-ospf-1-area-0.0.0.0]network 192.168.7.0 0.0.0.255
R4:
[R4]ospf 1 router-id 4.4.4.4
[R4-ospf-1]area 0
[R4-ospf-1-area-0.0.0.0]network 192.168.5.1 0.0.0.0
[R4-ospf-1-area-0.0.0.0]network 6.0.0.0 0.0.0.255
R5:
[R5]ospf 1 router-id 5.5.5.5
[R5-ospf-1]area 0
[R5-ospf-1-area-0.0.0.0]net
[R5-ospf-1-area-0.0.0.0]network 192.168.4.1 0.0.0.0
[R5-ospf-1-area-0.0.0.0]network 5.0.0.0 0.0.0.255
将R1、R4、R5的接口类型改为Broadcast类型
[R1-Tunnel0/0/0]ospf network-type broadcast
[R4-Tunnel0/0/0]ospf network-type broadcast
[R5-Tunnel0/0/0]ospf network-type broadcast
修改R2,R3的优先级,把R2,R3的优先级改为0,让他们放弃选举
[R2-Tunnel0/0/1]ospf dr-priority 0
[R3-Tunnel0/0/1]ospf dr-priority 0
全网可通