评分并提供意见反馈 :
华为采用机器翻译与人工审校相结合的方式将此文档翻译成不同语言,希望能帮助您更容易理解此文档的内容。 请注意:即使是最好的机器翻译,其准确度也不及专业翻译人员的水平。 华为对于翻译的准确性不承担任何责任,并建议您参考英文文档(已提供链接)。
配置BOOTP客户端示例
配置思路
BOOTP客户端示例的配置思路如下:
- 在SwitchA上使能BOOTP客户端功能,实现SwitchA可以从DHCP服务器动态获取IP地址。
- 在SwitchB上创建DHCP服务器的全局地址池并配置相关属性。
操作步骤
- SwitchA上配置BOOTP客户端功能
# 创建VLAN10并将GE0/0/1接口加入到VLAN10中。
<HUAWEI> system-view [HUAWEI] sysname SwitchA [SwitchA] vlan 10 [SwitchA-vlan10] quit [SwitchA] interface gigabitethernet 0/0/1 [SwitchA-GigabitEthernet0/0/1] port link-type trunk [SwitchA-GigabitEthernet0/0/1] port trunk allow-pass vlan 10 [SwitchA-GigabitEthernet0/0/1] quit
# 在VLANIF10接口上使能BOOTP客户端功能。
[SwitchA] interface vlanif 10 [SwitchA-Vlanif10] ip address bootp-alloc
- 在SwitchB上创建DHCP服务器的全局地址池并配置相关属性
- 验证配置结果
# 在接口VLANIF10上执行display this命令,查看BOOTP客户端功能的配置情况。
[SwitchA-Vlanif10] display this # interface Vlanif10 ip address bootp-alloc # return
[SwitchA-Vlanif10] quit
# 当接口VLANIF10成功分配到IP地址,在SwitchA执行display dhcp client命令,查看开启BOOTP Client接口VLANIF10的客户端状态信息。
[SwitchA] display dhcp client BOOTP client lease information on interface Vlanif10 : Current machine state : Bound Internet address assigned via : BOOTP Physical address : 0018-8201-0987 IP address : 192.168.1.254 Subnet mask : 255.255.255.0 Gateway ip address : 192.168.1.126 Lease obtained at : 2008-11-06 23:04:47 DNS : 192.168.1.2
# 在SwitchB上执行display ip pool命令,查看IP地址池配置情况。
[SwitchB] display ip pool name pool1 Pool-name : pool1 Pool-No : 0 Lease : 1 Days 0 Hours 0 Minutes Domain-name : 192.168.1.2 DNS-server0 : - NBNS-server0 : - Netbios-type : - Position : Local Status : Unlocked Gateway-0 : 192.168.1.126 Network : 192.168.1.0 Mask : 255.255.255.0 VPN instance : -- Logging : Disable Conflicted address recycle interval: - Address Statistic: Total :253 Used :1 Idle :251 Expired :0 Conflict :0 Disabled :1 ----------------------------------------------------------------------------- Start End Total Used Idle(Expired) Conflict Disabled ----------------------------------------------------------------------------- 10.20.20.1 10.20.20.254 253 1 251(0) 0 1 -----------------------------------------------------------------------------
配置文件
SwitchA的配置文件
# sysname SwitchA # vlan batch 10 # interface Vlanif10 ip address bootp-alloc # interface GigabitEthernet0/0/1 port link-type trunk port trunk allow-pass vlan 10 # return
SwitchB的配置文件
# sysname SwitchB # vlan batch 10 # dhcp enable # dhcp server bootp dhcp server bootp automatic # ip pool pool1 gateway-list 192.168.1.126 network 192.168.1.0 mask 255.255.255.0 dns-list 192.168.1.2 # interface Vlanif10 ip address 192.168.1.1 255.255.255.0 dhcp select global # interface GigabitEthernet0/0/1 port link-type trunk port trunk allow-pass vlan 10 # return