hcip mgre与rip实验

要求:

hcip mgre与rip实验_第1张图片

 1.toop搭建

hcip mgre与rip实验_第2张图片

 2.IP地址规划

R1 g 0/0/1 192.168.1.1 24       s 4/0/0 188.0.0.2 24        t:10.0.0.1 24
R2

s 4/0/0 188.0.0.1 24       s 4/0/1 188.0.1.1 24

s 3/0/0 188.0.2.1 24        loop0 8.8.8.8 24        t:10.0.0.2 24

R3 g 0/0/1 192.168.2.1   24     s 4/0/0 188.0.1.2 24        t:10.0.0.3 24

R4

g 0/0/1 192.168.3.1  24      s 4/0/0 188.0.2.2 24
pc1 192.168.1.2 24
pc2 192.168.2.2 24
pc3 192.168.3.2 24

 3.配置ip及接口类型

R1

修改serial4/0/0类型为hdlc,配置IP地址

[R1]int g 0/0/1
[R1-GigabitEthernet0/0/1]ip add 192.168.1.1 24
[R1]int Serial 4/0/0
[R1-Serial4/0/0]link-protocol hdlc //修改类型
[R1-Serial4/0/0]ip add 188.0.0.2 24

R2

修改serial 4/0/0类型为hdlc, 配置ip ,配置环回

[R2]int s4/0/0
[R2-Serial4/0/0]link-protocol hdlc 
[R2-Serial4/0/0]ip address 188.0.0.1 24

[R2]int Serial 4/0/1
[R2-Serial4/0/1]ip address 188.0.1.1 24

[R2]int Serial 3/0/0
[R2-Serial3/0/0]ip address 188.0.2.1 24

[R2]interface LoopBack 0
[R2-LoopBack0]ip address 8.8.8.8 24

R3

[R3]int Serial 4/0/0
[R3-Serial4/0/0]ip add 188.0.1.1 24

[R3]int GigabitEthernet 0/0/1
[R3-GigabitEthernet0/0/1]ip add 192.168.2.1 24

R4

[R4]int Serial 4/0/0
[R4-Serial4/0/0]ip address 188.0.2.2 24

[R4]interface GigabitEthernet 0/0/1
[R4-GigabitEthernet0/0/1]ip address 192.168.3.1 24

pc1

hcip mgre与rip实验_第3张图片

 pc2, pc3, 同上

4.接口认证

R2-R3之间为PPP封装,pap认证,R2为主认证方

R2

[R2]aaa
[R2-aaa]local-user huawei password cipher 123456
[R2-aaa]local-user huawei service-type ppp

[R2]interface Serial 4/0/1
[R2-Serial4/0/1]ppp authentication-mode pap 

R3

[R3]int Serial 4/0/0
[R3-Serial4/0/0]ppp pap local-user huawei password cipher 123456

R2-R4之间为PPP封装,chap认证,R2为主认证方

R2

[R2]interface Serial 3/0/0
[R2-Serial3/0/0]ppp authentication-mode chap 

R3

[R4]int Serial 4/0/0
[R4-Serial4/0/0]ppp chap user huawei 
[R4-Serial4/0/0]ppp chap password cipher 123456

5.配置nat及缺省路由

R1

[R1]ip route-static 0.0.0.0 0 188.0.0.1
[R1]acl 2000
[R1-acl-basic-2000]rule permit source any 

[R1]interface Serial 4/0/0	
[R1-Serial4/0/0]nat outbound 2000

R3

[R3]ip route-static 0.0.0.0 0 188.0.1.1

[R3]acl 2000
[R3-acl-basic-2000]rule permit source any 

[R3]interface Serial 4/0/0
[R3-Serial4/0/0]nat outbound 2000

R4

[R4]ip route-static 0.0.0.0 0 188.0.2.1 

[R4]acl 2000
[R4-acl-basic-2000]rule permit source any 

[R4]interface Serial 4/0/0
[R4-Serial4/0/0]nat outbound 2000

6.配置MGRE

R1、R2 、R3构建MGRE环境,仅R1IP地址固定, 则令R1为中心站点

R1

[R1]interface Tunnel 0/0/0
[R1-Tunnel0/0/0]tunnel-protocol gre p2mp 
[R1-Tunnel0/0/0]ip add 10.0.0.1 24
[R1-Tunnel0/0/0]source 188.0.0.2 
[R1-Tunnel0/0/0]nhrp network-id 10

R2

[R2]interface Tunnel 0/0/0
[R2-Tunnel0/0/0]  tunnel-protocol gre p2mp
 [R2-Tunnel0/0/0] source Serial4/0/0
[R2-Tunnel0/0/0] ip address 10.0.0.2 255.255.255.0 
[R2-Tunnel0/0/0]nhrp network-id 10
[R2-Tunnel0/0/0]nhrp entry 10.0.0.1 188.0.0.2 register 

 R3

[R3]interface Tunnel 0/0/0
[R3-Tunnel0/0/0]tunnel-protocol gre p2mp
[R3-Tunnel0/0/0]source Serial4/0/0
[R3-Tunnel0/0/0]ip address 10.0.0.2 255.255.255.0 
[R3-Tunnel0/0/0]nhrp network-id 10
[R3-Tunnel0/0/0]nhrp entry 10.0.0.1 188.0.0.2 register 

7.在MGRE中起RIP

R1

[R1]rip 1
[R1-rip-1]version 2
[R1-rip-1]network 192.168.1.0
[R1-rip-1]network 10.0.0.0

[R1-Tunnel0/0/0]nhrp entry multicast dynamic 
[R1-Tunnel0/0/0]undo rip split-horizon 

R2

[R2]rip 1
[R2-rip-1]version 2
[R2-rip-1]network 10.0.0.0

[R2-Tunnel0/0/0]nhrp entry multicast dynamic 

R3

[R3]rip 1
[R3-rip-1]version 2
[R3-rip-1]network 192.168.2.0
[R3-rip-1]network 10.0.0.0

[R3-Tunnel0/0/0]nhrp entry multicast dynamic 

关于R4的全网通问题

在r1 r3 r4 之间打一条隧道

R1

[R1]interface Tunnel 0/0/1
[R1-Tunnel0/0/1]tunnel-protocol gre 
[R1-Tunnel0/0/1]ip address 20.0.0.1 24
[R1-Tunnel0/0/1]source 188.0.0.2
[R1-Tunnel0/0/1]destination 188.0.2.2

[R1]ip route-static 192.168.3.0 24 20.0.0.4

R3

[R3]interface Tunnel 0/0/1
[R3-Tunnel0/0/1]ip address 30.0.0.3 24
[R3-Tunnel0/0/1]tunnel-protocol gre 	
[R3-Tunnel0/0/1]source Serial 4/0/0
[R3-Tunnel0/0/1]destination 188.0.2.2

[R3]ip route-static 192.168.3.0 24 30.0.0.4

R4

[R4]interface Tunnel 0/0/1
[R4-Tunnel0/0/1]tunnel-protocol gre 
[R4-Tunnel0/0/1]ip add 20.0.0.4 24
[R4-Tunnel0/0/1]source Serial 4/0/0
[R4-Tunnel0/0/1]destination 188.0.0.1

[R4]interface Tunnel 0/0/2	
[R4-Tunnel0/0/2]tunnel-protocol gre
[R4-Tunnel0/0/2]ip add 30.0.0.4 24 	
[R4-Tunnel0/0/2]source Serial 4/0/0
[R4-Tunnel0/0/2]destination 188.0.1.2 

[R4]ip route-static 192.168.1.0 24 Tunnel 0/0/1
[R4]ip route-static 192.168.2.0 24 Tunnel 0/0/2

测试

pc1

hcip mgre与rip实验_第4张图片

 

你可能感兴趣的:(hcip,网络)