dhclient.conf错过了centos

centos 6我需要从一个DHCP服务器的值:

cat /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0 HWADDR=00:50:56:27:0E:C8 TYPE=Ethernet UUID=20924b21-e92a-4944-a054-06d1967155c1 ONBOOT=yes NM_CONTROLLED=yes BOOTPROTO=dhcp PEERDNS=yes 

dhclient只取IP(不是gw,不是dns,不是主机名)。

没有任何dhclient.conf甚至没有一个示例文件。

创build

 /etc/dhcp/dhclient-eth0.conf 

并把这些行:

 send host-name = gethostname(); request subnet-mask, broadcast-address, time-offset, routers, domain-name, domain-name-servers, domain-search, host-name, dhcp6.name-servers, dhcp6.domain-search, netbios-name-servers, netbios-scope, interface-mtu, rfc3442-classless-static-routes, ntp-servers; ifdown eth0 ifup eth0 

如果你不想要网关/路由器:

请求子网掩码,广播地址,时间偏移,
接口的MTU;