MGRE,GRE简单配置

目录

 一、配置接口地址

二、R1和R5之间的ppp的pap认证

三、配置缺省路由

四、R1,R2,R3构建MGRE环境

五、RIP配置

六、配置ACL使得PC可以访问R5环回

七、配置四台电脑的IP地址

​八、实验结果


MGRE,GRE简单配置_第1张图片

首先根据题目意思先划分网段如下图

MGRE,GRE简单配置_第2张图片

 一、配置接口地址

[r1-Serial4/0/1]ip address 15.0.0.1 24
[r1-GigabitEthernet0/0/0]ip address 192.168.1.1 24


[r2-GigabitEthernet0/0/0]ip address 192.168.2.1 24
[r2-Serial4/0/1]ip address 25.0.0.1 24

[r3-GigabitEthernet0/0/0]ip address 192.168.3.1 24
[r3-Serial4/0/1]ip address 35.0.0.1 24

[r4-GigabitEthernet0/0/0]ip address 45.0.0.1 24
[r4-GigabitEthernet0/0/1]ip address 192.168.4.1 24

[r5-GigabitEthernet0/0/0]ip address 45.0.0.2 
[r5-Serial4/0/0]ip address 35.0.0.2 24
[r5-Serial3/0/1]ip address 25.0.0.2 24
[r5-Serial3/0/0]ip address 15.0.0.2 24
[r5-LoopBack0]ip address 5.5.5.5 24

二、R1和R5之间的ppp的pap认证

[r5-aaa]local-user csj password cipher 123456
[r5-aaa]local-user csj service-type ppp
[r5-Serial3/0/0]ppp authentication-mode pap


[r1-Serial4/0/1]ppp pap local-user csj password cipher 123456

        R2和R5之间的ppp的chap认证


[r5-aaa]local-user csj service 
[r5-aaa]local-user csj service-type ppp
[r5-Serial3/0/1]ppp authentication-mode chap


[r2-Serial4/0/1]ppp chap user csj
[r2-Serial4/0/1]ppp chap password cipher 123456

        R3和R5之间的HDLC封装

[r5-Serial4/0/0]link-protocol hdlc

[r3-Serial4/0/1]link-protocol hdlc
Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]
:Y

三、配置缺省路由

[r1]ip route-static 0.0.0.0 0 15.0.0.2
[r2]ip route-static 0.0.0.0 0 25.0.0.2
[r3]ip route-static 0.0.0.0 0 35.0.0.2
[r4]ip route-static 0.0.0.0 0 45.0.0.2

四、R1,R2,R3构建MGRE环境

[r1]int Tunnel 0/0/0
[r1-Tunnel0/0/0]ip address 10.1.1.1 24
[r1-Tunnel0/0/0]tunnel-protocol gre p2mp
[r1-Tunnel0/0/0]source 15.0.0.1
[r1-Tunnel0/0/0]nhrp entry multicast dynamic 
[r1-Tunnel0/0/0]undo rip split-horizon 
[r1-Tunnel0/0/0]nhrp network-id 100


[r2]int Tunnel 0/0/0
[r2-Tunnel0/0/0]ip address 10.1.1.2 24
[r2-Tunnel0/0/0]tunnel-protocol gre p2mp
[r2-Tunnel0/0/0]source s4/0/1
[r2-Tunnel0/0/0]nhrp network-id 100
[r2-Tunnel0/0/0]nhrp entry 10.1.1.1 15.0.0.1 register

[r3]int Tunnel 0/0/0
[r3-Tunnel0/0/0]ip add 10.1.1.3 24
[r3-Tunnel0/0/0]tunnel-protocol gre p2mp
[r3-Tunnel0/0/0]source s4/0/1
[r3-Tunnel0/0/0]nhrp network-id 100
[r3-Tunnel0/0/0]nhrp entry 10.1.1.1 15.0.0.1 register 


       R1和R4构建GRE环境

[r1]int Tunnel 0/0/1
[r1-Tunnel0/0/1]ip address 10.1.2.1 24
[r1-Tunnel0/0/1]tunnel-protocol gre
[r1-Tunnel0/0/1]source 15.0.0.1
[r1-Tunnel0/0/1]destination 45.0.0.1


[r4]int Tunnel 0/0/1
[r4-Tunnel0/0/1]ip address 10.1.2.2 24
[r4-Tunnel0/0/1]tunnel-protocol gre
[r4-Tunnel0/0/1]source 45.0.0.1	
[r4-Tunnel0/0/1]destination 15.0.0.1

五、RIP配置

[r1-rip-1]version 2	
[r1-rip-1]un summary
[r1-rip-1]network 192.168.1.0
[r1-rip-1]network 10.0.0.0

[r2-rip-1]version 2
[r2-rip-1]un summary
[r2-rip-1]network 192.168.2.0
[r2-rip-1]network 10.0.0.0

[r3-rip-1]version 2
[r3-rip-1]un summary
[r3-rip-1]network 192.168.3.0 
[r3-rip-1]network 10.0.0.0

[r4-rip-1]version 2
[r4-rip-1]un summary
[r4-rip-1]network 192.168.4.0
[r4-rip-1]network 10.0.0.0

六、配置ACL使得PC可以访问R5环回

[r1]acl 2000
[r1-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.255
[r1-acl-basic-2000]int s4/0/1
[r1-Serial4/0/1]nat outbound 2000

[r2]acl 2000
[r2-acl-basic-2000]rule permit source 192.168.2.0 0.0.0.255
[r2-acl-basic-2000]int s4/0/1
[r2-Serial4/0/1]nat outbound 2000

[r3]acl 2000
[r3-acl-basic-2000]rule permit source 192.168.3.0 0.0.0.255
[r3-acl-basic-2000]int s4/0/1
[r3-Serial4/0/1]nat outbound 2000

[r4]acl 2000
[r4-acl-basic-2000]rule permit source 192.168.4.0 0.0.0.255
[r4-acl-basic-2000]int g0/0/0
[r4-GigabitEthernet0/0/0]nat outbound 2000

七、配置四台电脑的IP地址

        MGRE,GRE简单配置_第3张图片

MGRE,GRE简单配置_第4张图片

MGRE,GRE简单配置_第5张图片

MGRE,GRE简单配置_第6张图片八、实验结果

MGRE,GRE简单配置_第7张图片 

MGRE,GRE简单配置_第8张图片 

MGRE,GRE简单配置_第9张图片 

MGRE,GRE简单配置_第10张图片 

 

 

 

 

 

你可能感兴趣的:(安全)