华为—网络类型,路由封装实验

实验环境:华为模拟器
实验要求:
在这里插入图片描述
1.搭建拓扑
在这里插入图片描述

2…配置IP地址:
1>R1的接口配置:

[Huawei]sys R1   //修改设备名称
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip add 192.168.1.1 24
[R1-GigabitEthernet0/0/0]int s4/0/0  //为串口模式
[R1-Serial4/0/0]ip add 12.1.1.1 24
//R1连接的终端设备自动获取IP地址,在R1上搭建dhcp池塘
[R1]dhcp en  //开启dhcp服务
[R1]ip pool 1  //创建‘1’的池塘
Info: It's successful to create an IP address pool.
[R1-ip-pool-1]network 192.168.1.0 mask 24  //下放IP地址范围
[R1-ip-pool-1]gateway-list 192.168.1.1 //网关地址
[R1-ip-pool-1]dns-list 8.8.8.8  //dns地址
[R1-ip-pool-1]q
[R1]int g0/0/0	
[R1-GigabitEthernet0/0/0]dhcp select global 

查看与R1连接的PC4是否拿到IP地址:
首先,点击dhcp,在点击应用;
在这里插入图片描述
在点‘命令行’:
在这里插入图片描述
2>R2接口配置:

[Huawei]sys R2
[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]ip add 192.168.2.1 24
[R2-GigabitEthernet0/0/0]int s4/0/0
[R2-Serial4/0/0]ip add 23.1.1.1 24
[R2-Serial4/0/0]q
[R2]dhcp enable 
[R2]ip pool 2	
[R2-ip-pool-2]network 192.168.2.0 mask 24
[R2-ip-pool-2]gateway-list 192.168.2.1
[R2-ip-pool-2]dns 8.8.8.8
[R2-ip-pool-2]q
[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]dhcp select global 

3>R3的接口配置:

[Huawei]sys R3
[R3]int s4/0/0
[R3-Serial4/0/0]ip add 34.1.1.1 24
[R3-Serial4/0/0]int g0/0/0
[R3-GigabitEthernet0/0/0]ip add 192.168.3.1 24
[R3-GigabitEthernet0/0/0]q

与R3连接的PC2手工配置IP地址:
在这里插入图片描述
测试ping通性
在这里插入图片描述
(可以ping 通)
4>R4的接口配置:

[Huawei]sys R4
[R4]int g0/0/0
[R4-GigabitEthernet0/0/0]ip add 45.1.1.1 24
[R4-GigabitEthernet0/0/0]int g0/0/1
[R4-GigabitEthernet0/0/1]ip add 192.168.4.1 24
[R4-GigabitEthernet0/0/1]q
[R4]dhcp enable 
[R4]ip pool 2
[R4-ip-pool-2]network 192.168.4.0 mask 24
[R4-ip-pool-2]gateway-list 192.168.4.1
[R4-ip-pool-2]dns-list 8.8.8.8
[R4-GigabitEthernet0/0/0]q
[R4-ip-pool-4]q
[R4-GigabitEthernet0/0/0]int g0/0/1
[R4-GigabitEthernet0/0/1]dhcp select global 
[R4-GigabitEthernet0/0/1]q

5>R5的接口配置:

[Huawei]sys ISP 
[ISP]int s3/0/0
[ISP-Serial3/0/0]ip add 12.1.1.2 24
[ISP-Serial3/0/0]int s3/0/1
[ISP-Serial3/0/1]ip add 23.1.1.2 24
[ISP-Serial3/0/1]int s4/0/0
[ISP-Serial4/0/0]ip add 34.1.1.2 24
[ISP-Serial4/0/0]int g0/0/0
[ISP-GigabitEthernet0/0/0]int lo 0  //创建‘0’的环回虚拟网卡
[ISP-LoopBack0]ip add 5.5.5.5 24

3.题目条件:
1)
在这里插入图片描述
认证:PAP—明文传输用户名和密码;
R5上配置:

[ISP]aaa  //主认证方——服务端
[ISP-aaa]local-user xixi password cipher 123
Info: Add a new user.
[ISP-aaa]local-user xixi service-type ppp  //服务类型
[ISP-aaa]q
[ISP]int s3/0/0  //连接客户端接口
[ISP-Serial3/0/0]link-protocol ppp  
[ISP-Serial3/0/0]ppp authentication-mode pap

R1配置:

[R1]int s4/0/0   //被认证方
[R1-Serial4/0/0]link-protocol ppp
[R1-Serial4/0/0]ppp pap local-user xixi password cipher 123 

在R1测试一下认证是否成功
在这里插入图片描述
(认证成功!)
2)
在这里插入图片描述
CHAP 加密传输用户名和密码
R5主认证方:

[ISP]aaa	
[ISP-aaa]local-user haha password cipher 123
Info: Add a new user.
[ISP-aaa]local-user haha service-type ppp
[ISP-aaa]q
[ISP]int s3/0/1
[ISP-Serial3/0/1]link-protocol ppp
[ISP-Serial3/0/1]ppp authentication-mode chap 

被认证方R2:

[R2]int s4/0/0
[R2-Serial4/0/0]link-protocol ppp
[R2-Serial4/0/0]ppp chap user haha
[R2-Serial4/0/0]ppp chap password cipher 123

在这里插入图片描述
(认证成功!)
3)
在这里插入图片描述
R5:

[ISP]int s4/0/0
[ISP-Serial4/0/0]link-protocol hd	
[ISP-Serial4/0/0]link-protocol hdlc 
Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]
:y

R3:

[R3]int s4/0/0
[R3-Serial4/0/0]link-protocol hdlc
Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]
:y

4)
在这里插入图片描述
GRE-通用路由封装 ,属于点到点网络类型;
首先公网得通:

[R1]ip route-static 0.0.0.0 0  12.1.1.2
[R2]ip route-static 0.0.0.0 0 23.1.1.2
[R3]ip route-static 0.0.0.0 0 34.1.1.2
[R4]ip route-static 0.0.0.0 0 45.1.1.2

R1上配置:

[R1]int Tunnel 0/0/0  //创建通道接口
[R1-Tunnel0/0/0]ip add 10.1.1.1 24  //配置IP地址
[R1-Tunnel0/0/0]tunnel-protocol gre  //定义封装方式
定义具体的封装内容
[R1-Tunnel0/0/0]source 12.1.1.1 
[R1-Tunnel0/0/0]destination 45.1.1.1

R4上的配置:

[R4]int Tunnel 0/0/0
[R4-Tunnel0/0/0]ip add 10.1.1.2 24
[R4-Tunnel0/0/0]tunnel-protocol gre
[R4-Tunnel0/0/0]source 45.1.1.1
[R4-Tunnel0/0/0]destination 12.1.1.1

R1与R4之间GRE搭建成功!
在这里插入图片描述
5)
在这里插入图片描述
R1为中心站点:

[R1]int Tunnel 0/0/1  //创建tunnel口
[R1-Tunnel0/0/1]ip add 10.1.2.1 24 //配置IP地址 
[R1-Tunnel0/0/1]tunnel-protocol gre p2mp //修改接口模式为点到多点
[R1-Tunnel0/0/1]source 12.1.1.1  //再定义公有的源IP地址;
[R1-Tunnel0/0/1]nhrp entry multicast dynamic //本地成为nhrp中心,同时进行伪广播
[R1-Tunnel0/0/1]nhrp network-id 100 //
默认为0号,该网段内所有节点tunnel接口必须为相同域

分支站点:

[R2]int Tunnel 0/0/0
[R2-Tunnel0/0/0]ip add 10.1.2.2 24	
[R2-Tunnel0/0/0]tunnel-protocol gre p2mp 
[R2-Tunnel0/0/0]source s4/0/0
[R2-Tunnel0/0/0]nhrp network-id 100
[R2-Tunnel0/0/0]nhrp entry 10.1.2.1 12.1.1.1 register 
R3的配置命令
[R3]int Tunnel 0/0/0
[R3-Tunnel0/0/0]ip add 10.1.2.3 24	
[R3-Tunnel0/0/0]tunnel-protocol gre p2mp 
[R3-Tunnel0/0/0]source s4/0/0
[R3-Tunnel0/0/0]nhrp network-id 100
[R3-Tunnel0/0/0]nhrp entry 10.1.2.1 12.1.1.1 register 

测试MGRE是否搭建成功:
在这里插入图片描述
(成功!)
6)
在这里插入图片描述
开启rip 协议:
R1

[R1]rip 1
[R1-rip-1]ver 2
[R1-rip-1]undo summary 
[R1-rip-1]network 10.0.0.0
[R1-rip-1]network 192.168.1.0

R2:

[R2]rip 1 
[R2-rip-1]ver 2
[R2-rip-1]undo summary 
[R2-rip-1]network 192.168.2.0 
[R2-rip-1]network 10.0.0.0

R3:

[R3]rip 1
[R3-rip-1]ver 2
[R3-rip-1]undo summary 
[R3-rip-1]network 192.168.3.0
[R3-rip-1]network 10.0.0.0

R4:

[R4]rip 1
[R4-rip-1]ver 2
[R4-rip-1]undo summary 
[R4-rip-1]network 192.168.4.0
[R4-rip-1]network 10.0.0.0

R1和R4的私有网段是通的!
在这里插入图片描述
R2和R1的私有网段是通的!
在这里插入图片描述
问题:
R2和R3之间不通:
在这里插入图片描述
R2上没有R3的路由表
在这里插入图片描述
原因:由于RIP的水平分割性质,从此口进不能从此口出;
r2上没有r3的路由表;
解决方法:在r1上关闭水平分割

[R1]int Tunnel 0/0/1
[R1-Tunnel0/0/1]undo rip s	
[R1-Tunnel0/0/1]undo rip split-horizon

在这里插入图片描述
ping通了!
在这里插入图片描述
7)
在这里插入图片描述
分别把R1,R2,R3,R4看做私网的边界路由器,做一对多的nat地址转换;
R1:

[R1]acl 2000
[R1-acl-basic-2000]rule 5 permit source 192.168.1.0 0.0.0.255
[R1-acl-basic-2000]q
[R1]int s4/0/0
[R1-Serial4/0/0]nat outbound 2000

R2:

[R2]acl 2000
[R2-acl-basic-2000]rule 5 permit source 192.168.2.0 0.0.0.255
[R2-acl-basic-2000]q
[R2]int s4/0/0
[R2-Serial4/0/0]nat outbound 2000

R3:

[R3]acl 2000
[R3-acl-basic-2000]rule 5 permit source 192.168.3.0 0.0.0.255
[R3-acl-basic-2000]q
[R3]int s4/0/0
[R3-Serial4/0/0]nat outbound 2000

R4:

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

R4下的PC1,pingR5的环回:
在这里插入图片描述
R1下的PC4,pingR5的环回:
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/m0_47218990/article/details/121378931
今日推荐