华为创建于全局的DHCP设置
实验拓扑:
实验目的:配置DHCP,pc1和pc2自动分配网络参数
实验需求:两台PC机,一台二层交换机,一台路由器
实验步骤:
1、确保客户端与服务器之间的链路是互通的;
SW :创建 VLAN 10 将端口放入VLAN 10 ;
<Huawei>system-view
[Huawei]sysname sw
[sw]vlan 10
[sw-vlan10]exit
[sw-vlan10]q
[sw]port-group group-member gi0/0/1 gi0/0/2 gi0/0/3
[sw-port-group]
Jan 8 2018 17:35:46-08:00 sw DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25.
191.3.1 configurations have been changed. The current change number is 6, the ch
ange loop count is 0, and the maximum number of records is 4095.
[sw-port-group]port link-type access
[sw-GigabitEthernet0/0/1]port link-type access
[sw-GigabitEthernet0/0/2]port link-type access
[sw-GigabitEthernet0/0/3]port link-type access
[sw-port-group]port default vlan 10
[sw-GigabitEthernet0/0/1]port default vlan 10(将接口划入对应所在VLAN)
[sw-GigabitEthernet0/0/2]port default vlan 10
[sw-GigabitEthernet0/0/3]port default vlan 10
[sw-port-group]
[sw]
Gateway:在 Router 上为 VLAN 10 配置一个 网关IP 地址;
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname gateway
[gateway]vlan 10 (创建VLAN 10)
[Huawei-vlan10]quit
[gateway]interface Vlanif 10
[gateway-Vlanif10]undo shutdown (开启svi接口)
Info: Interface Vlanif10 is not shutdown.
[gateway-Vlanif10]ip address 192.168.10.254 255.255.255.0(设置网关IP地址)
[gateway-Vlanif10]quit
[gateway]
2、配置 DHCP 客户端;
进入 PC ,选择“自动获取”,点“应用
3、配置 DHCP 服务器;
#创建 IP 地址池;
ip pool VLAN-10
network 192.168.10.0 mask 255.255.255.0
gateway-list 192.168.10.254
dns-list 8.8.8.8
lease day 3
开启 DHCP 服务 ;
dhcp enable
在 接收 DHCP 报文的端口上,配置 DHCP 的选择方式 - global ;
interface gi0/0/0
dhcp select global // 表示的是当端口上收到 DHCP 报文以后
直接去 DHCP 服务器在全局配置的IP
地址池中选择一个可用的IP地址;
[gateway]ip pool vlan-10(创建IP地址池)
Info: It‘s successful to create an IP address pool.
[gateway-ip-pool-vlan-10]network 192.168.10.0 mask 255.255.255.0
[gateway-ip-pool-vlan-10]gateway-list 192.168.10.254(设置默认网关)
[gateway-ip-pool-vlan-10]dns-list 8.8.8.8(设置dns默认地址)
[gateway-ip-pool-vlan-10]lease day 3(设置有效使用时长)
[gateway-ip-pool-vlan-10]q
[gateway]dhcp enable (开启DHCP)
Info: The operation may take a few seconds. Please wait for a moment.done.
[gateway]interface GigabitEthernet 0/0/0
[gateway-GigabitEthernet0/0/0]dhcp select global
(开启在全局配置中寻找可用ip地址)
[gateway-GigabitEthernet0/0/0]
4.验证与测试
实验总结:
DHCP配置思路:
1.确保DHCP客户端与服务器之间的 DHCP 报文互通;
2.配置 DHCP 客户端
将PC配置为“自动获取IP地址”
3.配置 DHCP 服务器
移除掉不能自动分配出去的 IP 地址/段;
创建 IP 地址池
可用IP地址空间
默认网关
DNS服务器
4.开启 DHCP 服务;
验证、测试、保存
原文地址:http://blog.51cto.com/13557013/2059238