hcip 第二三章综合实验

本文详细记录了五台华为路由器(r1-r5)的配置过程,包括IP地址分配、DHCP服务、静态路由、RIP协议、PPP连接及GRE隧道设置,展示了网络设备的配置步骤和状态变化。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

实验拓扑图

请添加图片描述

代码

r1

[Huawei]sysname r1
[r1]int g0/0/0
[r1-GigabitEthernet0/0/0]ip add 192.168.1.254 24
Mar 27 2024 21:06:10-08:00 r1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[r1-GigabitEthernet0/0/0]q
[r1]int ser	
[r1]int Serial 4/0/0
[r1-Serial4/0/0]ip add 15.1.1.1 24
[r1-Serial4/0/0]q
[r1]dhcp enable
Info: The operation may take a few seconds. Please wait for a moment.done.
[r1]ip pool a
Info: It's successful to create an IP address pool.
[r1-ip-pool-a]network 192.168.1.0 mask 24
[r1-ip-pool-a]gateway-list 192.168.1.254
[r1-ip-pool-a]dns-list 114.114.114.114 8.8.8.8
[r1-ip-pool-a]q
[r1]int g0/0/0
[r1-GigabitEthernet0/0/0]dhcp select global 
[r1]int s4/0/0
[r1-Serial4/0/0]link-	
[r1-Serial4/0/0]link-protocol ppp
[r1-Serial4/0/0]ppp pap local-user gu password cipher 123456
[r1-Serial4/0/0]int t0/0/1
[r1-Tunnel0/0/1]ip add 10.1.1.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.1
[r1-Tunnel0/0/1]int t0/0/0
[r1-Tunnel0/0/0]ip add 10.1.2.1 24
[r1-Tunnel0/0/0]tunnel-protocol gre p2mp
[r1-Tunnel0/0/0]source 15.1.1.1
Mar 27 2024 21:44:30-08:00 r1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface Tunnel0/0/0 has entered the UP state. 
[r1-Tunnel0/0/0]
[r1-Tunnel0/0/0]nhrp entry multicast dynamic
[r1-Tunnel0/0/0]nhrp network-id 100
[r1-Tunnel0/0/0]q
[r1]ip route-static 0.0.0.0 0 15.1.1.2
[r1]
Mar 27 2024 21:50:11-08:00 r1 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface Tunnel0/0/1 has entered the UP state. 
[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-rip-1]silent-interface g0/0/0
[r1-rip-1]q
[r1]int t0/0/1
[r1-Tunnel0/0/1]rip authentication	
[r1-Tunnel0/0/1]rip authentication-mode md5 usual cip	
[r1-Tunnel0/0/1]rip authentication-mode md5 usual cipher 123456
[r1-Tunnel0/0/1]

r2

The device is running!

<Huawei>

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname r2
[r2]int g0/0/0
[r2-GigabitEthernet0/0/0]ip add 192.168.2.254 24
Mar 27 2024 21:11:01-08:00 r2 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[r2-GigabitEthernet0/0/0]q
[r2]int s4/0/0
[r2-Serial4/0/0]ip add 25.1.1.1 24
[r2-Serial4/0/0]q
[r2]dhcp enable
Info: The operation may take a few seconds. Please wait for a moment.done.
[r2]ip pool a
Info: It's successful to create an IP address pool.
[r2-ip-pool-a]ip pool b
Info: It's successful to create an IP address pool.
[r2-ip-pool-b]network 192.168.2.0 mask 24
[r2-ip-pool-b]gateway 192.168.2.254 
[r2-ip-pool-b]dns-list 114.114.114.114 8.8.8.8
[r2-ip-pool-b]q
[r2]int g0/0/0
[r2-GigabitEthernet0/0/0]dhcp select g
[r2-GigabitEthernet0/0/0]
[r2]int s4/0/0
[r2-Serial4/0/0]link-	
[r2-Serial4/0/0]link-protocol ppp
[r2-Serial4/0/0]ppp c	
[r2-Serial4/0/0]ppp chap user banana
[r2-Serial4/0/0]ppp chap pass	
[r2-Serial4/0/0]ppp chap password c	
[r2-Serial4/0/0]ppp chap password cipher 123456
[r2]int t0/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 serial 4/0/0
Mar 27 2024 21:46:50-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]
[r2-Tunnel0/0/0]nhrp network-id 100
[r2-Tunnel0/0/0]nhrp entry 10.1.1.1 15.1.1.1 register
[r2-Tunnel0/0/0]q
[r2]ip route-static 0.0.0.0 0 25.1.1.2
[r2]rip 1
[r2-rip-1]version 2
[r2-rip-1]network 192.168.2.0
[r2-rip-1]network 10.0.0.0
[r2-rip-1]silent-interface g0/0/0
[r2-rip-1]int t0/0/0
[r2-Tunnel0/0/0]rip authentication-mode md5 usual cipher 123456
[r2-Tunnel0/0/0]

r3

The device is running!

<Huawei>
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname r3
[r3]int g0/0/0
[r3-GigabitEthernet0/0/0]ip add 192.168.3.254
                                              ^
Error:Incomplete command found at '^' position.
[r3-GigabitEthernet0/0/0]ip add 192.168.3.254 24
Mar 27 2024 21:15:32-08:00 r3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[r3-GigabitEthernet0/0/0]q
[r3]int s4/0/0
[r3-Serial4/0/0]ip add 35.1.1.1 24
[r3-Serial4/0/0]q
[r3]dhcp enable 
Info: The operation may take a few seconds. Please wait for a moment.done.
[r3]ip pool c
Info: It's successful to create an IP address pool.
[r3-ip-pool-c]network 192.168.3.0 mask 24
[r3-ip-pool-c]gateway 192.168.3.254 
[r3-ip-pool-c]dns-list 114.114.114.114 8.8.8.8
[r3-ip-pool-c]q
[r3]int g0/0/0
[r3-GigabitEthernet0/0/0]dhcp select global
[r3-GigabitEthernet0/0/0]
Enter system view, return user view with Ctrl+Z.
[r3]int s4/0/0
[r3-Serial4/0/0]link-p	
[r3-Serial4/0/0]link-protocol hdlc
Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]
:y
Mar 27 2024 21:39:43-08:00 r3 %%01IFNET/4/CHANGE_ENCAP(l)[0]:The user performed 
the configuration that will change the encapsulation protocol of the link and th
en selected Y. 
[r3-Serial4/0/0]
[r3-Serial4/0/0]
Mar 27 2024 21:39:43-08:00 r3 %%01PPP/4/PHYSICALDOWN(l)[1]:On the interface Seri
al4/0/0, PPP link was closed because the status of the physical layer was Down. 

[r3-Serial4/0/0]
Mar 27 2024 21:39:43-08:00 r3 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol PPP
 on the interface Serial4/0/0 has entered the DOWN state. 
[r3-Serial4/0/0]
Mar 27 2024 21:39:43-08:00 r3 %%01IFNET/4/LINK_STATE(l)[3]:The line protocol PPP
 IPCP on the interface Serial4/0/0 has entered the DOWN state. 
[r3-Serial4/0/0]
Mar 27 2024 21:39:43-08:00 r3 %%01IFPDT/4/IF_STATE(l)[4]:Interface Serial4/0/0 h
as turned into DOWN state.
[r3-Serial4/0/0]
Mar 27 2024 21:39:43-08:00 r3 %%01IFPDT/4/IF_STATE(l)[5]:Interface Serial4/0/0 h
as turned into UP state.
[r3-Serial4/0/0]
Mar 27 2024 21:39:43-08:00 r3 %%01IFNET/4/LINK_STATE(l)[6]:The line protocol IP 
on the interface Serial4/0/0 has entered the UP state. 
[r3-Serial4/0/0]
[r3]int t0/0/0
[r3-Tunnel0/0/0]ip add 10.1.2.3 24
[r3-Tunnel0/0/0]tunnel	
[r3-Tunnel0/0/0]tunnel-protocol gre p2mp
[r3-Tunnel0/0/0]  
[r3]int t0/0/0
[r3-Tunnel0/0/0]source serial 4/0/0
Mar 27 2024 21:49:16-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]
[r3-Tunnel0/0/0]nhrp network-id 100
[r3-Tunnel0/0/0]nhrp entry 10.1.1.1 15.1.1.1 register
[r3-Tunnel0/0/0]q
[r3]ip route-static 0.0.0.0 0 35.1.1.2
[r3]
[r3]rip 1
[r3-rip-1]version 2
[r3-rip-1]network 192.168.3.0 
[r3-rip-1]network 10.0.0.0
[r3-rip-1]silent-interface g0/0/0
[r3-rip-1]int t0/0/0
[r3-Tunnel0/0/0]rip authentication-mode md5 usual cipher 123456

r4

The device is running!

<Huawei>
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname r4
[r4]int g0/0/0
[r4-GigabitEthernet0/0/0]ip add 192.168.4.254 24
Mar 27 2024 21:19:09-08:00 r4 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[r4-GigabitEthernet0/0/0]q
[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.254 24
[r4-GigabitEthernet0/0/1]
Mar 27 2024 21:22:37-08:00 r4 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the UP state. 
[r4-GigabitEthernet0/0/1]q    
[r4]ip pool d
Info: It's successful to create an IP address pool.
[r4-ip-pool-d]network 192.168.4.0 mask 24
[r4-ip-pool-d]gateway 192.168.4.254
[r4-ip-pool-d]q
[r4]int g0/0/0
[r4-GigabitEthernet0/0/0]dhcp select g
Error: Please enable DHCP in the global view first.
[r4-GigabitEthernet0/0/0]int g0/0/1
[r4-GigabitEthernet0/0/1]dhcp select g
Error: Please enable DHCP in the global view first.
[r4-GigabitEthernet0/0/1]q
[r4]ip pool d
[r4-ip-pool-d]dns-list 114.114.114.114 8.8.8.8
[r4-ip-pool-d]q
[r4]int g0/0/1
[r4-GigabitEthernet0/0/1]q
[r4]dhcp enable
Info: The operation may take a few seconds. Please wait for a moment.done.
[r4]int g0/0/1
[r4-GigabitEthernet0/0/1]dhcp select global
[r4-GigabitEthernet0/0/1]
[r4]int t0/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 15.1.1.1
Enter system view, return user view with Ctrl+Z.
[r4]ip route-static 0.0.0.0 0 45.1.1.2
[r4]
Mar 27 2024 21:50:56-08:00 r4 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface Tunnel0/0/0 has entered the UP state. 
[r4]rip 1
[r4-rip-1]version 2 
[r4-rip-1]network 192.168.4.0
[r4-rip-1]network 10.0.0.0
[r4-rip-1]silent	
[r4-rip-1]silent-interface g0/0/1
[r4-rip-1]int t0/0/0
[r4-Tunnel0/0/0]rip authentication-mode md5 usual cipher 123456
[r4-Tunnel0/0/0]

  Please check whether system data has been changed, and save data in time

  Configuration console time out, please press any key to log on

r5

The device is running!

<Huawei>
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]
[Huawei]sysname r5
[r5]int s3/0/0
[r5-Serial3/0/0]ip add 15.1.1.2 24
[r5-Serial3/0/0]
Mar 27 2024 21:31:20-08:00 r5 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol PPP
 IPCP on the interface Serial3/0/0 has entered the UP state. 
[r5-Serial3/0/0]int s3/0/1
[r5-Serial3/0/1]ip add 25.1.1.2 24
[r5-Serial3/0/1]
Mar 27 2024 21:31:44-08:00 r5 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol PPP
 IPCP on the interface Serial3/0/1 has entered the UP state. 
[r5-Serial3/0/1]int s4/0/0
[r5-Serial4/0/0]ip add 35.1.1.2 24
[r5-Serial4/0/0]
Mar 27 2024 21:32:22-08:00 r5 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol PPP
 IPCP on the interface Serial4/0/0 has entered the UP state. 
[r5-Serial4/0/0]int g0/0/0
[r5-GigabitEthernet0/0/0]ip add 45.1.1.2 24
Mar 27 2024 21:32:43-08:00 r5 %%01IFNET/4/LINK_STATE(l)[3]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[r5-GigabitEthernet0/0/0]q
[r5]int l0
[r5-LoopBack0]ip add 5.5.5.5 24
[r5-LoopBack0]q
[r5]aaa
[r5-aaa]local-user gu privilege level 15 password cipher 123456
Info: Add a new user.
[r5-aaa]local-user gu service-type ppp
[r5-aaa]q
[r5]int s3/0/0
[r5-Serial3/0/0]link-protocol ppp
[r5-Serial3/0/0]ppp authentication-mode pap
[r5-Serial3/0/0]q
[r5]aaa
[r5-aaa]local-user banana privilege level 15 password cipher 123456
Info: Add a new user.
[r5-aaa]local-user banana service-type ppp
[r5-aaa]int s3/0/1
[r5-Serial3/0/1]link-protocol ppp
[r5-Serial3/0/1]ppp authen	
[r5-Serial3/0/1]ppp au	
[r5-Serial3/0/1]ppp authentication-mode chap
[r5-Serial3/0/1]
Mar 27 2024 21:39:43-08:00 r5 %%01IFNET/4/LINK_STATE(l)[4]:The line protocol PPP
 on the interface Serial4/0/0 has entered the DOWN state. 
[r5-Serial3/0/1]
Mar 27 2024 21:39:43-08:00 r5 %%01IFNET/4/LINK_STATE(l)[5]:The line protocol PPP
 IPCP on the interface Serial4/0/0 has entered the DOWN state. 
[r5-Serial3/0/1]int s4/0/0
[r5-Serial4/0/0]link-	
[r5-Serial4/0/0]link-protocol hdlc
Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]
:y
Mar 27 2024 21:40:18-08:00 r5 %%01IFNET/4/CHANGE_ENCAP(l)[6]:The user performed 
the configuration that will change the encapsulation protocol of the link and th
en selected Y. 
[r5-Serial4/0/0]
[r5-Serial4/0/0]
Mar 27 2024 21:40:18-08:00 r5 %%01IFPDT/4/IF_STATE(l)[7]:Interface Serial4/0/0 h
as turned into DOWN state.
[r5-Serial4/0/0]
Mar 27 2024 21:40:19-08:00 r5 %%01IFPDT/4/IF_STATE(l)[8]:Interface Serial4/0/0 h
as turned into UP state.
[r5-Serial4/0/0]
Mar 27 2024 21:40:19-08:00 r5 %%01IFNET/4/LINK_STATE(l)[9]:The line protocol IP 
on the interface Serial4/0/0 has entered the UP state. 
[r5-Serial4/0/0]

结果

在这里插入图片描述

在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值