在RTA上配置DHCP服务器使PCA可以自动获取IP地址。
[H3C]int e0/1/0
[H3C-Ethernet0/1/0]ip add 192.168.1.1 24
[H3C-Ethernet0/1/0]undo shutdown
[H3C-Ethernet0/1/0]dhcp server ip-pool dhcp1 创建DHCP地址池
[H3C-dhcp-pool-dhcp1]network 192.168.1.0 mask 255.255.255.0 所要分布网段及掩码
[H3C-dhcp-pool-dhcp1]gateway-list 192.168.1.1 设置网关地址
[H3C-dhcp-pool-dhcp1]dns-list 11.11.11.2 设置DNS地址
[H3C-dhcp-pool-dhcp1]domain-name xiaofei 设置域名
[H3C]dhcp server forbidden-ip 192.168.1.1 192.168.1.5 添加排除地址
[H3C]dhcp enable 开启DHCP服务功能
将PCA设置为自动获取,此时成功获取动态分配的地址信息:
C:\Documents and Settings\xiaofei>ipconfig/all
Windows IP Configuration
Host Name . . . . . . . . . . . . : xiaofei-d44ab01
Primary Dns Suffix . . . . . . . :
Node Type . . . . . . . . . . . . : Unknown
IP Routing Enabled. . . . . . . . : No
WINS Proxy Enabled. . . . . . . . : No
DNS Suffix Search List. . . . . . : xiaofei
Ethernet adapter 本地连接:
Connection-specific DNS Suffix . : xiaofei
Description . . . . . . . . . . . : VMware Accelerated AMD PCNet Adapter
Physical Address. . . . . . . . . : 00-0C-29-B7-20-33
Dhcp Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
IP Address. . . . . . . . . . . . : 192.168.1.14
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.1.1
DHCP Server . . . . . . . . . . . : 192.168.1.1
DNS Servers . . . . . . . . . . . : 11.11.11.2
Lease Obtained. . . . . . . . . . : 2012年8月9日 10:52:12
Lease Expires . . . . . . . . . . : 2012年8月10日 10:52:12
PCA获取的不是前面的地址是因为排除了:
[H3C]disp dhcp server forbidden-ip
IP Range from 192.168.1.1 to 192.168.1.5