全局
<Huawei>u t m
Info: Current terminal monitor is off.
<Huawei>sy
Enter system view, return user view with Ctrl+Z.
[Huawei]sy R1
[R1]dhcp e
[R1]dhcp enable
Info: The operation may take a few seconds. Please wait for a moment.done.
[R1]ip poo
[R1]ip pool ntd
Info: It's successful to create an IP address pool.
[R1-ip-pool-ntd]netw
[R1-ip-pool-ntd]network 192.168.1.0 m
[R1-ip-pool-ntd]network 192.168.1.0 mask 24
[R1-ip-pool-ntd]ga
[R1-ip-pool-ntd]gateway-list 192.168.1.254
[R1-ip-pool-ntd]dns
[R1-ip-pool-ntd]dns-list 8.8.8.8
[R1-ip-pool-ntd]l
[R1-ip-pool-ntd]lease d
[R1-ip-pool-ntd]lease day 2
[R1-ip-pool-ntd]q
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip add
[R1-GigabitEthernet0/0/0]ip address 192.168.1.254 24
[R1-GigabitEthernet0/0/0]dhcp s
[R1-GigabitEthernet0/0/0]dhcp select g
[R1-GigabitEthernet0/0/0]dhcp ?
alarm Alarm
check Check
client DHCP client
option82 <Group> option82 command group
relay DHCP relay
select Select
server <Group> server command group
[R1-GigabitEthernet0/0/0]dhcp s
[R1-GigabitEthernet0/0/0]dhcp select ?
global Local server
interface Interface server pool
relay DHCP relay
[R1-GigabitEthernet0/0/0]dhcp select g
[R1-GigabitEthernet0/0/0]dhcp select global
[R1-GigabitEthernet0/0/0]
[R1-GigabitEthernet0/0/0]
<R1> 查看/显示地址池ntd的详细信息
<R1>dis ip pool name ntd all
Pool-name : ntd
Pool-No : 0
Lease : 2 Days 0 Hours 0 Minutes
Domain-name : -
DNS-server0 : 8.8.8.8
NBNS-server0 : -
Netbios-type : -
Position : Local Status : Unlocked
Gateway-0 : 192.168.1.254
Mask : 255.255.255.0
VPN instance : --
-----------------------------------------------------------------------------
Start End Total Used Idle(Expired) Conflict Disable
-----------------------------------------------------------------------------
192.168.1.1 192.168.1.254 253 3 250(0) 0 0
-----------------------------------------------------------------------------
Network section :
--------------------------------------------------------------------------
Index IP MAC Lease Status
--------------------------------------------------------------------------
0 192.168.1.1 - - Idle
1 192.168.1.2 - - Idle
2 192.168.1.3 - - Idle
3 192.168.1.4 - - Idle
4 192.168.1.5 - - Idle
5 192.168.1.6 - - Idle
6 192.168.1.7 - - Idle
7 192.168.1.8 - - Idle
8 192.168.1.9 - - Idle
9 192.168.1.10 - - Idle
10 192.168.1.11 - - Idle
11 192.168.1.12 - - Idle
12 192.168.1.13 - - Idle
13 192.168.1.14 - - Idle
14 192.168.1.15 - - Idle
15 192.168.1.16 - - Idle
16 192.168.1.17 - - Idle
17 192.168.1.18 - - Idle
18 192.168.1.19 - - Idle
19 192.168.1.20 - - Idle
20 192.168.1.21 - - Idle
21 192.168.1.22 - - Idle
22 192.168.1.23 - - Idle
23 192.168.1.24 - - Idle
24 192.168.1.25 - - Idle
25 192.168.1.26 - - Idle
基于接口的DHCP
<Huawei> u t m
Info: Current terminal monitor is off.
<Huawei>sy
Enter system view, return user view with Ctrl+Z.
[Huawei]sy R1
[R1]dhcp e
[R1]dhcp enable
Info: The operation may take a few seconds. Please wait for a moment.done.
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip add
[R1-GigabitEthernet0/0/0]ip address 192.168.1.254 24
[R1-GigabitEthernet0/0/0]dhcp s
[R1-GigabitEthernet0/0/0]dhcp select in
[R1-GigabitEthernet0/0/0]dhcp select interface
[R1-GigabitEthernet0/0/0]dhcp ser
[R1-GigabitEthernet0/0/0]dhcp servr d
[R1-GigabitEthernet0/0/0]dhcp server dns-list 8.8.8.8
[R1-GigabitEthernet0/0/0]dhcp ser
[R1-GigabitEthernet0/0/0]dhcp server l
[R1-GigabitEthernet0/0/0]dhcp server lease d
[R1-GigabitEthernet0/0/0]dhcp server lease day 2
排除,基于全局
The device is running!
<Huawei>u t m
Info: Current terminal monitor is off.
<Huawei>sy
Enter system view, return user view with Ctrl+Z.
[Huawei]sy r1
[r1]dhcp e
[r1]dhcp enable
Info: The operation may take a few seconds. Please wait for a moment.done.
[r1]ip pool ntd
Info: It's successful to create an IP address pool.
[r1-ip-pool-ntd]net
[r1-ip-pool-ntd]netw
[r1-ip-pool-ntd]network 192.168.10.0 ma
[r1-ip-pool-ntd]network 192.168.10.0 mask 24
[r1-ip-pool-ntd]g
[r1-ip-pool-ntd]gateway-list 192.168.10.254
[r1-ip-pool-ntd]dns
[r1-ip-pool-ntd]dns-list 8.8.8.8
[r1-ip-pool-ntd]ex
[r1-ip-pool-ntd]excluded-ip-address 192.168.10.240 192.168.10.253
[r1-ip-pool-ntd]q
[r1]int g0/0/0
[r1-GigabitEthernet0/0/0]ip add
[r1-GigabitEthernet0/0/0]ip address 192.168.10.254 24
[r1-GigabitEthernet0/0/0]dhcp s
[r1-GigabitEthernet0/0/0]dhcp select g
[r1-GigabitEthernet0/0/0]dhcp select global
查看名为ntd池可用ip地址,
[R1]dis ip pool name ntd used
Pool-name : ntd
Pool-No : 0
Lease : 1 Days 0 Hours 0 Minutes
Domain-name : -
DNS-server0 : 8.8.8.8
NBNS-server0 : -
Netbios-type : -
Position : Local Status : Unlocked
Gateway-0 : 192.168.10.254
Mask : 255.255.255.0
VPN instance : --
-----------------------------------------------------------------------------
Start End Total Used Idle(Expired) Conflict Disable 禁用
-----------------------------------------------------------------------------
192.168.10.1 192.168.10.254 253 0 239(0) 0 14
----------------------------------------------------------------------------
中继
R1 DHCP服务器
<Huawei>u t m
Info: Current terminal monitor is off.
<Huawei>sy
Enter system view, return user view with Ctrl+Z.
[Huawei]sy R1
[R1]dhcp e
[R1]dhcp enable
Info: The operation may take a few seconds. Please wait for a moment.done.
[R1]ip pool ntd
Info: It's successful to create an IP address pool.
[R1-ip-pool-ntd]net
[R1-ip-pool-ntd]network 192.168.1.0 m
[R1-ip-pool-ntd]network 192.168.1.0 mask 24
[R1-ip-pool-ntd]ge
[R1-ip-pool-ntd]g
[R1-ip-pool-ntd]gateway-list 192.168.1.254
[R1-ip-pool-ntd]dn
[R1-ip-pool-ntd]dns-list 8.8.8.8
[R1-ip-pool-ntd]q
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]dhcp sel
[R1-GigabitEthernet0/0/0]dhcp select g
[R1-GigabitEthernet0/0/0]dhcp select global //在接口下开启基于全局的dhcp
[R1-GigabitEthernet0/0/0]ip add
[R1-GigabitEthernet0/0/0]ip address 10.10.10.1 24
[R1-GigabitEthernet0/0/0]
<R1>sy
Enter system view, return user view with Ctrl+Z.
[R1]ip rou
[R1]ip route
[R1]ip route-static 192.168.1.0 24 10.10.10.2 下一跳路由
R2 DHCP中继
<Huawei>u t m
Info: Current terminal monitor is off.
<Huawei>sy
Enter system view, return user view with Ctrl+Z.
[Huawei]sy R2
[R2]dhcp e
Info: The operation may take a few seconds. Please wait for a moment.done.
[R2]int g0/0/01
[R2-GigabitEthernet0/0/1]ip add
[R2-GigabitEthernet0/0/1]ip address 192.168.1.254 24
[R2-GigabitEthernet0/0/1]q
[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]ip add
[R2-GigabitEthernet0/0/0]ip address 10.10.10.2 24
[R2-GigabitEthernet0/0/0]q
[R2]int g0/0/1
[R2-GigabitEthernet0/0/1]dhcp s
[R2-GigabitEthernet0/0/1]dhcp select relay
[R2-GigabitEthernet0/0/1]dhcp relay server-ip 10.10.10.1
[R2-GigabitEthernet0/0/1]