eNSP--IP--MGRE和GRE的实验

实验要求

  1. R5为ISP,只能进行IP地址配置,其所有地址均配为公有IP地址;
  2. R1和R5间使用PPP的PAP认证,R5为主认证方;

R2与R5之间使用ppp的CHAP认证,R5为主认证方;

R3与R5之间使用HDLC封装;

  1. R1、R2、R3构建一个MGRE环境,R1为中心站点,R1、R4间为点到点的GRE;
  2. .整个私有网络基本RIP全网可达,
  3. 所有Pc设置私有IP为源IP,可以访问R5环回,达到全网通。

实验思路

  1. 按要求配置好IP地址
  2. 在r1、r2、r3、r4上配置缺省路由让公网通
  3. R5为主认证方,R被验证方使用PPP的PAP认证。

R5为主认证,R2为被验证方使用ppp的CHAP认证。

  1. 在R3、R5上改变成hdlc的封装方式。
  2. 建立隧道,R1与R2、R3是用MGRE,R1和R4使用GRE,
  3. 在R1-4上用rip实现全网可达,但要开启R1的类广播,在R1-4上要关闭水平分割。
  4. 分别在R1-4上配置net,让私网可以访问公网上R5的环回。

实验步骤:

按照如图配置IP地址并且查看相关的表(这里以R3为例)

Dis IP in br

  1. 配置缺省路由让公网联通

[r1]ip route-static 0.0.0.0 0 15.1.1.5

[r2]ip route-static 0.0.0.0 0 25.1.1.5

[r3]ip route-static 0.0.0.0 0 35.1.1.5

[r4]ip route-static 0.0.0.0 0 45.1.1.5

 Ping一下看是否联通(这里以R1ping R4为例)

  1. ppp的认证

Pap的

R5认证方

[r5]aaa

[r5-aaa]local-user dbb password cipher 123456

Info: Add a new user.

[r5-aaa]local-user dbb service-type ppp

[r5]inter s 4/0/1

[r5-Serial4/0/1]ppp authentication-mode pap

R1被认证方

[r1-Serial4/0/0]ppp

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

用shutdown关闭接口在ubdo shutdown ping一下看是否验证成功

Chcp的

由于R5已经创建好了一个local-user dbb 这里直接用

R5认证方

[r5-Serial4/0/0]ppp authentication-mode chap

R2被认证方

[r2-Serial4/0/0]ppp chap user dbb

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

用shutdown关闭接口在ubdo shutdown ping一下看是否验证成功

  1. 隧道的建立

对于mgre

中心站点R1

[r1]inter Tunnel 0/0/0

[r1-Tunnel0/0/0]ip add 10.1.1.1 24

[r1-Tunnel0/0/0]tunnel-protocol gre p2mp

[r1-Tunnel0/0/0]source 10.1.1.1

[r1-Tunnel0/0/0]undo source 这里要注意IP地址不是隧道地址,而是公网地址

[r1-Tunnel0/0/0]source 15.1.1.1

[r1-Tunnel0/0/0]nhrp  network-id 100

其余站点R2、R3

[r2]inter Tunnel 0/0/0

[r2-Tunnel0/0/0]ip add 10.1.1.2 24

[r2-Tunnel0/0/0]tunnel-protocol gre p2mp

[r2-Tunnel0/0/0]source 10.1.1.2

[r2-Tunnel0/0/0]undo source 这里注意源地址后面接的是相连的接口,因为公网地址随时会变

[r2-Tunnel0/0/0]source Serial 4/0/0

Jul 23 2024 22:11:03-08:00 r2 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP on the interface Tunnel0/0/0 has entered the UP state.

[r2-Tunnel0/0/0]nhrp network-id 100

[r2-Tunnel0/0/0]nhrp entry 10.1.1.1 15.1.1.1 register

[r3]inter 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 Serial  4/0/0

Jul 23 2024 22:11:30-08:00 r3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP on the interface Tunnel0/0/0 has entered the UP state.

[r3-Tunnel0/0/0]nhrp network-id 100

[r3-Tunnel0/0/0]nhrp entry 10.1.1.1 15.1.1.1 register

对于gre

R1

[r1]inter Tunnel 0/0/1

[r1-Tunnel0/0/1]ip add 10.1.2.1 24

[r1-Tunnel0/0/1]tunnel-protocol gre

[r1-Tunnel0/0/1]source 15.1.1.1

[r1-Tunnel0/0/1]destination 45.1.1.4

Jul 23 2024 22:29:38-08:00 r1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP on the interface Tunnel0/0/1 has entered the UP state

R4

[r4]inter Tunnel 0/0/1

[r4-Tunnel0/0/1]ip add 10.1.2.4 24

[r4-Tunnel0/0/1]tunnel-protocol gre

[r4-Tunnel0/0/1]source 45.1.1.4

[r4-Tunnel0/0/1]destination 15.1.1.1

Jul 23 2024 22:30:57-08:00 r4 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP on the interface Tunnel0/0/1 has entered the UP state.

  1. 用rip实现全网可达

 [r1]rip

[r1-rip-1]v 2

[r1-rip-1]network 192.168.1.0

[r1-rip-1]network 10.1.1.0这里注意这个IP地址属于A类所以不可以这样宣告

Error: The network address is invalid, and the specified address must be major-net address without any subnets.

[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-4配置一样在这里以r2为例

[r2]rip

[r2-rip-1]v 2

[r2-rip-1]network  192.168.2.0

[r2-rip-1]network  10.0.0.0

[r2]inter tu 0/0/0

[r2-Tunnel0/0/0]undo rip split-horizon

用pc3ping一

下看是否可以全网通

  1. 最后用net实现私网与公网通(这里以R1为例,r2-4的配置与r1一样)

[r1]acl 2000

[r1-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.255

[r1]inter  s 4/0/0

[r1-Serial4/0/0]nat outbound 2000

用pc2平一下r5的环回5.5.5.5看一下是否通

  • 20
    点赞
  • 16
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值