1、交换机开启dhcp服务
[Huawei] dhcp enable
2、配置用户网关,并在接口下开启dhcp全局模式
[Huawei] interface vlanif 10
[Huawei-Vlanif10] ip address 192.168.10.254 255.255.255.0
[Huawei-Vlanif10] dhcp select global 选择全局dhcp类型
[Huawei-Vlanif10] quit
3、创建地址池
[Huawei] ip pool vlan10
[Huawei-ip-pool-pool1] network 192.168.10.0 mask 255.255.255.0
[Huawei-ip-pool-pool1] dns-list 114.114.114.114 配置DNS
[Huawei-ip-pool-pool1] gateway-list 192.168.10.254 配置网关
[Huawei-ip-pool-pool1] lease day 3 设置租约
4、保留 192.168.10.1-192.168.10.10 不下发
[Huawei-ip-pool-pool1] excluded-ip-address 192.168.10.1 192.168.10.10
[Huawei] dis ip pool name vlan10 used 查看地址池ip使用情况
<Huawei>reset ip pool name pool1 192.168.2.1 回收IP地址192.168.2.1
5、 配置DHCP通过vlanif接口下的接口获取来获取地址
<Huawei> system-view 进入系统视图
[Huawei] interface Vlanif 20
[Huawei-Vlanif20]ip address 192.168.20.1 255.255.255.0 vlan地址
[Huawei-Vlanif20]dhcp select interface 选择基于接口的dhcp类型
[Huawei-Vlanif20]dhcp server excluded-ip-address 192.168.20.200 192.168.20.253 排除保
留的地址
[Huawei-Vlanif20] dhcp server static-bind ip-address 192.168.20.100 mac-address 5489-98b7-7378 绑定MAC静态IP
[Huawei-Vlanif20]dhcp server lease day 8 hour 0 minute 0 设置租约
[Huawei-Vlanif20]dhcp server dns-list 114.114.114.114 配置DNS
6、华为交换机配置dhcp中继
拓扑图
SW2配置:
vlan batch 10 20 50
dhcp enable
dhcp server group yukong
dhcp-server 10.3.50.50 0
interface Vlanif10
ip address 10.0.0.1 255.255.255.0
dhcp select relay
dhcp relay server-ip 10.3.50.50
interface Vlanif20
ip address 20.0.0.1 255.255.255.0
dhcp select relay
dhcp relay server-ip 10.3.50.50
interface Vlanif50
ip address 10.3.50.1 255.255.255.0
interface Vlanif10
ip address 10.0.0.1 255.255.255.0
dhcp select relay
dhcp relay server-ip 10.3.50.50
interface Vlanif20
ip address 20.0.0.1 255.255.255.0
dhcp select relay
dhcp relay server-ip 10.3.50.50
interface Vlanif50
ip address 10.3.50.1 255.255.255.0
interface GigabitEthernet0/0/1
port link-type access
port default vlan 10
interface GigabitEthernet0/0/2
port link-type access
port default vlan 20
interface GigabitEthernet0/0/3
port link-type access
port default vlan 50
AR1配置:
dhcp enable
ip pool vlan10
gateway-list 10.0.0.1
network 10.0.0.0 mask 255.255.255.0
dns-list 114.114.114.114
ip pool vlan20
gateway-list 20.0.0.1
network 20.0.0.0 mask 255.255.255.0
dns-list 114.114.114.114
interface GigabitEthernet0/0/0
ip address 10.3.50.50 255.255.255.0
dhcp select global
ip route-static 10.0.0.0 255.255.255.0 10.3.50.1文章来源:https://www.toymoban.com/news/detail-429918.html
ip route-static 20.0.0.0 255.255.255.0 10.3.50.1文章来源地址https://www.toymoban.com/news/detail-429918.html
到了这里,关于华为交换机DHCP配置的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!