1.组网拓扑图(交换机-PC)
2.通过交换机开启DHCP功能,使PC自动获取192.168.10.0(vlan10)网段地址
2.使用命令
<H3C>system-view
[H3C]vlan 10(建立vlan10)
[H3C-vlan10]port GigabitEthernet 1/0/1(对应接口放到vlan10中)
[H3C]interface vlan 10 (进入vlan10)
[H3C-Vlan-interface10]ip address 192.168.10.1 24(配置ip地址)
[H3C]dhcp enable(开启dhcp服务)
[H3C]dhcp server forbidden-ip 192.168.10.100(配置不参与自动分配的IP地址)
[H3C]dhcp server ip-pool 1(建立地址池,配置DHCP地址池1,用来为192.168.1.0/24网段内的客户端分配IP地址)
[H3C-dhcp-pool-1]network 192.168.10.0 mask 255.255.255.0
[H3C-dhcp-pool-1]dns-list 114.114.114.114(dns)
[H3C-dhcp-pool-1]gateway-list 192.168.10.1(网关)
[H3C]save force(保存配置)
查看PC,ping网关地址