华为路由器配置DHCP服务及给指定PC分配固定IP地址

华为路由器配置DHCP服务及给指定PC分配固定IP地址_第1张图片

 DHCP服务器配置:

#
 sysname DHCP
 dhcp enable   #开启DHCP服务
#
ip pool vlan10
 gateway-list 192.168.10.254 
 network 192.168.10.0 mask 255.255.255.0 
 static-bind ip-address 192.168.10.20 mac-address 5489-9891-342f  //给指定PC分配固定IP地址
 excluded-ip-address 192.168.10.250 192.168.10.253 
 dns-list 10.10.10.10 
#
ip pool vlan20                        #创建地址池
 gateway-list 192.168.20.254          #设置网关
 network 192.168.20.0 mask 255.255.255.0 #配置网段
 excluded-ip-address 192.168.20.250 192.168.20.253 #保留IP地址
 dns-list 20.20.20.20                    #配置DNS
#
ip pool vlan30
 gateway-list 192.168.30.254 
 network 192.168.30.0 mask 255.255.255.0 
 excluded-ip-address 192.168.30.250 192.168.30.253 
 dns-list 30.30.30.30 
#端口的配置
interface GigabitEthernet0/0/0
 ip address 192.168.50.254 255.255.255.0 
 dhcp select global   开启DHCP全局模式

ip route-static 0.0.0.0 0.0.0.0 192.168.50.251   #配置静态路由
 

DHCP中继LSW1

u t m
sys
[Huawei]sys SW5    
[SW5]vlan batch 10 20 30 50

[SW5]int g0/0/1
[SW5-GigabitEthernet0/0/1]p l a
[SW5-GigabitEthernet0/0/1]p d v 50
[SW5-GigabitEthernet0/0/1]q
[SW5]port-group group-member g0/0/2 to g0/0/4
[SW5-port-group]p l t
[SW5-GigabitEthernet0/0/2]p l t
[SW5-GigabitEthernet0/0/3]p l t
[SW5-GigabitEthernet0/0/4]p l t
[SW5-port-group]p t a v a
[SW5-GigabitEthernet0/0/2]p t a v a
[SW5-GigabitEthernet0/0/3]p t a v a
[SW5-GigabitEthernet0/0/4]p t a v a

[SW5]int vlanif50
[SW5-Vlanif50]ip add 192.168.50.251 24
[SW5-Vlanif50]q
    
[SW5]dhcp enable 
[SW5]int vlanif10
[SW5-Vlanif10]dhcp select relay     
[SW5-Vlanif10]dhcp relay server-ip 192.168.50.254
[SW5-Vlanif10]q

[SW5]int vlanif20
[SW5-Vlanif20]ip add 192.168.20.251 24
[SW5-Vlanif20]dhcp select relay 
[SW5-Vlanif20]dhcp relay server-ip 192.168.50.254
[SW5-Vlanif20]q

[SW5]int vlanif30
[SW5-Vlanif30]ip add 192.168.30.251 24
[SW5-Vlanif30]dhcp selec relay    
[SW5-Vlanif30]dhcp relay server-ip 192.168.50.254
[SW5-Vlanif30]q

其他交换机基础配置

创建VLAN   batch  10 20 30 

配置端口模式  access  或者 trunk

以交换机LSW2为例:

u t m
Info: Current terminal monitor is off.
sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys SW1
[SW1]vlan ba    
[SW1]vlan batch 10 20 30
[SW1]int g0/0/1
[SW1-GigabitEthernet0/0/1]p l a
[SW1-GigabitEthernet0/0/1]p d  v 10
[SW1-GigabitEthernet0/0/1]int g0/0/2
[SW1-GigabitEthernet0/0/2]p l t
[SW1-GigabitEthernet0/0/2]p t a v a

最后终端设备获取IP地址等网络参数

华为路由器配置DHCP服务及给指定PC分配固定IP地址_第2张图片

华为路由器配置DHCP服务及给指定PC分配固定IP地址_第3张图片

华为路由器配置DHCP服务及给指定PC分配固定IP地址_第4张图片

华为路由器配置DHCP服务及给指定PC分配固定IP地址_第5张图片

你可能感兴趣的:(网络运维与安全,华为,tcp/ip,网络)