华为设备单臂路由实验

实验对象:一台路由器、一台交换机、两台PC机
实验环境:eNSP
实验原理: interface eth-trunk 1.10
dot1q termination vid 10(该接口属于vlan10)
ip add 192.168.10.1 24
arp broadcast enable(开启arp广播)

注意:在生产环境中,要先查看版本,保存信息,然后根据当前环境确定是否需要升级系统,这是个好习惯

实操:华为单臂路由和dhcp服务配置实验,简单有效_第1张图片
R1

The device is running!
system-view 
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R1
[R1]un in en
Info: Information center is disabled.
[R1]int Eth-Trunk 1
[R1-Eth-Trunk1]trunkport g 0/0/1 to 0/0/2
[R1-Eth-Trunk1]q
[R1]int Eth-Trunk 1.10
[R1-Eth-Trunk1.10]dot1q termination vid 10
[R1-Eth-Trunk1.10]ip add 192.168.10.1 24
[R1-Eth-Trunk1.10]un sh
Info: Interface Eth-Trunk1.10 is not shutdown.
[R1-Eth-Trunk1.10]arp broadcast enable 
[R1-Eth-Trunk1.10]un sh
Info: Interface Eth-Trunk1.10 is not shutdown.
[R1-Eth-Trunk1.10]q
[R1]int Eth-Trunk 1.20
[R1-Eth-Trunk1.20]dot1q termination vid 20
[R1-Eth-Trunk1.20]ip add 192.168.20.1 24
[R1-Eth-Trunk1.20]a b e
[R1-Eth-Trunk1.20]un sh
Info: Interface Eth-Trunk1.20 is not shutdown.
[R1-Eth-Trunk1.20]q
[R1]

LSW3

The device is running!

system-view 
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname SW1
[SW1]un in en
Info: Information center is disabled.
[SW1]int e 0/0/2
[SW1-Ethernet0/0/2]q
[SW1]vlan bat 10 20
Info: This operation may take a few seconds. Please wait for a moment...done.
[SW1]int e 0/0/2
[SW1-Ethernet0/0/2]p l a
[SW1-Ethernet0/0/2]p d v 20
[SW1-Ethernet0/0/2]un sh
Info: Interface Ethernet0/0/2 is not shutdown.
[SW1-Ethernet0/0/2]int e 0/0/3
[SW1-Ethernet0/0/3]p l a
[SW1-Ethernet0/0/3]p d v 10
[SW1-Ethernet0/0/3]un sh
Info: Interface Ethernet0/0/3 is not shutdown.  
[SW1-Ethernet0/0/3]q
[SW1]int Eth-Trunk 1
[SW1-Eth-Trunk1]trunkport g 0/0/1 to 0/0/2
Info: This operation may take a few seconds. Please wait for a moment...done.
[SW1-Eth-Trunk1]p l t
[SW1-Eth-Trunk1]p t a v a
[SW1-Eth-Trunk1]un sh
Info: Interface Eth-Trunk1 is not shutdown.
[SW1-Eth-Trunk1]

PC配置
实操:华为单臂路由和dhcp服务配置实验,简单有效_第2张图片

实操:华为单臂路由和dhcp服务配置实验,简单有效_第3张图片

实操:华为单臂路由和dhcp服务配置实验,简单有效_第4张图片

华为设备DHCP服务配置

需要的环境安装在之前的博客提及,需要了解的可以去看
实验对象:两台路由器,一台交换机,五台PC机
实验环境:eNSP
实验原理:华为设备的DHCP基本原理
第一步:客户端通过广播发送DHCP Discover 报文寻服务器端
第二步:服务器端通过单播发送DHCP Offer 报文向客户端提供IP地址等网络信息
第三步:客户端通过广播DHCP Request 报文告知服务器端本地选择使用哪个IP地址
第四步:服务器通过DHCP Ack报文告知客户端IP地址是合法可用的
其中是两个广播,两个单播,与linux的dhcp原理不同
实验拓扑:
实操:华为单臂路由和dhcp服务配置实验,简单有效_第5张图片
LSW1

The device is running!


sys 
system-view 
Enter system view, return user view with Ctrl+Z.
[Huawei]sysn    
[Huawei]sysname SW1
[SW1]int e 0/0/1
[SW1-Ethernet0/0/1]p l a
[SW1-Ethernet0/0/1]p d v 10
Error: The VLAN does not exist.
[SW1-Ethernet0/0/1]q
[SW1]vlan bat 10 20 
Info: This operation may take a few seconds. Please wait for a moment...done.
[SW1]int e0/0/1
[SW1-Ethernet0/0/1]p d v 10
[SW1-Ethernet0/0/1]un sh
Info: Interface Ethernet0/0/1 is not shutdown.
[SW1-Ethernet0/0/1]int e0/0/2
[SW1-Ethernet0/0/2]p l a
[SW1-Ethernet0/0/2]p d v 20
[SW1-Ethernet0/0/2]un sh
Info: Interface Ethernet0/0/2 is not shutdown.
[SW1-Ethernet0/0/2]int e0/0/3
[SW1-Ethernet0/0/3]p l a
[SW1-Ethernet0/0/3]p d v 10
[SW1-Ethernet0/0/3]un sh
Info: Interface Ethernet0/0/3 is not shutdown.
[SW1-Ethernet0/0/3]int e0/0/4
[SW1-Ethernet0/0/4]p l a
[SW1-Ethernet0/0/4]p d v 20
[SW1-Ethernet0/0/4]un sh
Info: Interface Ethernet0/0/4 is not shutdown.
[SW1-Ethernet0/0/4]un sh
Info: Interface Ethernet0/0/4 is not shutdown.
[SW1-Ethernet0/0/4]int e0/0/1
[SW1-Ethernet0/0/1] p l t
Error: Please renew the default configurations.
[SW1-Ethernet0/0/1]dis this
#
interface Ethernet0/0/1
 port link-type access
 port default vlan 10
#
return
[SW1-Ethernet0/0/1]int g0/0/1
[SW1-GigabitEthernet0/0/1]p l t
[SW1-GigabitEthernet0/0/1]port t a v a
[SW1-GigabitEthernet0/0/1]un sh
Info: Interface GigabitEthernet0/0/1 is not shutdown.

R1 ————使用子接口模式配置dhcp

The device is running!

sys 
system-view 
Enter system view, return user view with Ctrl+Z.
[Huawei]sys 
[Huawei]sysname R1
[R1]dhcp enable 
Info: The operation may take a few seconds. Please wait for a moment.done.  
[R1]vlan bat 10 20
Info: This operation may take a few seconds. Please wait for a moment...done.
[R1]    
[R1]int g0/0/1.10
[R1-GigabitEthernet0/0/1.10]        
[R1-GigabitEthernet0/0/1.10]dot1q termination vid 10
[R1-GigabitEthernet0/0/1.10]ip address 192.168.10.1 24
[R1-GigabitEthernet0/0/1.10]
Dec 10 2019 17:09:57-08:00 R1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/1.10 has entered the UP state.  
[R1-GigabitEthernet0/0/1.10]display this
#
interface GigabitEthernet0/0/1.10
 dot1q termination vid 10
 ip address 192.168.10.1 255.255.255.0
#
return
[R1-GigabitEthernet0/0/1.10]a b e
[R1-GigabitEthernet0/0/1.10]dis this
#
interface GigabitEthernet0/0/1.10
 dot1q termination vid 10
 ip address 192.168.10.1 255.255.255.0
 arp broadcast enable
#
return
[R1-GigabitEthernet0/0/1.10]    
[R1-GigabitEthernet0/0/1.10]un sh
Info: Interface GigabitEthernet0/0/1.10 is not shutdown.
[R1-GigabitEthernet0/0/1.10]int g0/0/1.20
[R1-GigabitEthernet0/0/1.20]dot1q te vid 20 
[R1-GigabitEthernet0/0/1.20]ip address 192.168.20.1 24
[R1-GigabitEthernet0/0/1.20]
Dec 10 2019 17:11:21-08:00 R1 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface GigabitEthernet0/0/1.20 has entered the UP state.  
[R1-GigabitEthernet0/0/1.20]a b e
[R1-GigabitEthernet0/0/1.20]un sh
Info: Interface GigabitEthernet0/0/1.20 is not shutdown.
[R1-GigabitEthernet0/0/1.20]q
[R1]int g0/0/1.10
[R1-GigabitEthernet0/0/1.10]dhcp select interface       
[R1-GigabitEthernet0/0/1.10]dhcp server dns-list 2.2.2.2 8.8.8.8
[R1-GigabitEthernet0/0/1.10]q
[R1]int g0/0/1.20   
[R1-GigabitEthernet0/0/1.20]dhcp select interface 
[R1-GigabitEthernet0/0/1.20]dhcp server dns-list 2.2.2.2 8.8.8.8    
[R1-GigabitEthernet0/0/1.20]q
[R1]int g0/0/3
[R1-GigabitEthernet0/0/3]ip add 12.0.0.1 24
Dec 10 2019 17:14:41-08:00 R1 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP 
on the interface GigabitEthernet0/0/3 has entered the UP state. 
[R1-GigabitEthernet0/0/3]un sh
Info: Interface GigabitEthernet0/0/3 is not shutdown.
[R1-GigabitEthernet0/0/3]q  
[R1]ip route-static 0.0.0.0 0.0.0.0 12.0.0.2

R2 ————全局配置模式配置pool dhcp地址池

The device is running!

sys 
system-view 
Enter system view, return user view with Ctrl+Z.
[Huawei]sys 
[Huawei]sysname R2
[R2]int g 0/0/3
[R2-GigabitEthernet0/0/3]ip add 12.0.0.2 24
[R2-GigabitEthernet0/0/3]
Dec 10 2019 17:18:53-08:00 R2 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/3 has entered the UP state. 
[R2-GigabitEthernet0/0/3]un sh
Info: Interface GigabitEthernet0/0/3 is not shutdown.
[R2-GigabitEthernet0/0/3]int g 0/0/0
[R2-GigabitEthernet0/0/0]ip add 15.0.0.1 24
[R2-GigabitEthernet0/0/0]un sh
Info: Interface GigabitEthernet0/0/0 is not shutdown.                              
[R2]ip pool 15
Info:It's successful to create an IP address pool.
[R2-ip-pool-15]network 15.0.0.0 mask 24
[R2-ip-pool-15]gateway-list 15.0.0.1
[R2-ip-pool-15]dns-list 8.8.8.8 2.2.2.2 
[R2-ip-pool-15]q
[R2]int e0/0/0
[R2-Ethernet0/0/0]dis this
#
interface Ethernet0/0/0
#
return
[R2-Ethernet0/0/0]int g 0/0/0
[R2-GigabitEthernet0/0/0]dis this
#
interface GigabitEthernet0/0/0
 ip address 15.0.0.1 255.255.255.0
#
return
[R2-GigabitEthernet0/0/0]undo ip address 15.0.0.1 255.255.255.0
dis this
#
interface GigabitEthernet0/0/0
#
return
[R2-GigabitEthernet0/0/0]int e0/0/0
[R2-Ethernet0/0/0]ip add 15.0.0.1 24
Dec 10 2019 17:25:03-08:00 R2 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface Ethernet0/0/0 has entered the UP state.    
[R2-Ethernet0/0/0]un sh
Info: Interface Ethernet0/0/0 is not shutdown.
[R2-Ethernet0/0/0]dhcp select global 
Error: Please enable DHCP in the global view first.
[R2-Ethernet0/0/0]q
Info: The operation may take a few seconds. Please wait for a moment.done.
[R2]dhcp enable 
[R2]int e0/0/0
[R2-Ethernet0/0/0]dhcp select global
[R2-Ethernet0/0/0]q
[R2]ip route-static 192.168.0.0 16 12.0.0.1

在PC机中获取ip地址
实操:华为单臂路由和dhcp服务配置实验,简单有效_第6张图片

实操:华为单臂路由和dhcp服务配置实验,简单有效_第7张图片

实操:华为单臂路由和dhcp服务配置实验,简单有效_第8张图片

实操:华为单臂路由和dhcp服务配置实验,简单有效_第9张图片

实操:华为单臂路由和dhcp服务配置实验,简单有效_第10张图片
PC之间互ping
实操:华为单臂路由和dhcp服务配置实验,简单有效_第11张图片

实操:华为单臂路由和dhcp服务配置实验,简单有效_第12张图片

实操:华为单臂路由和dhcp服务配置实验,简单有效_第13张图片