DHCP接口地址池配置
拓扑
- PC配置DHCP点击应用。
路由器配置命令
<Huawei>sy
Enter system view, return user view with Ctrl+Z.
[Huawei]int g0/0/1
[Huawei-GigabitEthernet0/0/1]ip address 10.1.1.1 24
[Huawei-GigabitEthernet0/0/1]q
[Huawei]dhcp enable
Info: The operation may take a few seconds. Please wait for a moment.done.
[Huawei]int g0/0/1
[Huawei-GigabitEthernet0/0/1]dhcp select interface
[Huawei-GigabitEthernet0/0/1]dhcp server dns-list 8.8.8.8
[Huawei-GigabitEthernet0/0/1]dhcp server lease day 3
查看配置
测试
DHCP全局地址池配置
拓扑
- PC配置DHCP点击应用。
路由器配置
<Huawei>sy
Enter system view, return user view with Ctrl+Z.
[Huawei] int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip address 10.1.1.1 24
[Huawei-GigabitEthernet0/0/0]q
[Huawei]dhcp enable
Info: The operation may take a few seconds. Please wait for a moment.done.
[Huawei]ip pool pool1
Info: It's successful to create an IP address pool.
[Huawei-ip-pool-pool1]network 10.1.1.0 m 24
[Huawei-ip-pool-pool1]gateway-list 10.1.1.1
[Huawei-ip-pool-pool1]q
[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]dhcp select global
查看配置
测试
交换机配置DHCP服务
以全局地址池为例
配置PC为DHCP
交换机配置命令
<Huawei>sy
Enter system view, return user view with Ctrl+Z.
[Huawei]vlan 10
[Huawei-vlan10]q
[Huawei]int v 10
[Huawei-Vlanif10]ip address 100.1.1.1 24
[Huawei-Vlanif10]q
[Huawei]int g0/0/1
[Huawei-GigabitEthernet0/0/1]port link-type access
[Huawei-GigabitEthernet0/0/1]port default vlan 10
[Huawei-GigabitEthernet0/0/1]q
[Huawei]dhcp enable
Info: The operation may take a few seconds. Please wait for a moment.done.
[Huawei]ip pool pool2
Info:It's successful to create an IP address pool.
[Huawei-ip-pool-pool2]network 100.1.1.0 m 24
[Huawei-ip-pool-pool2]gateway-list 100.1.1.1
[Huawei-ip-pool-pool2]dns-list 8.8.8.8
[Huawei-ip-pool-pool2]q
[Huawei]int v 10
[Huawei-Vlanif10]dhcp select global