加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

redhat – 在RHEL 6上配置DHCP

发布时间:2020-12-13 17:09:31 所属栏目:Linux 来源:网络整理
导读:我有一个RHEL6的全新安装,我无法找到任何配置文件来为dhclient进行高级配置. 我试图在Ubuntu上找到类似dhclient.conf的东西,所以我可以修改诸如supersede domains,fqdn之类的选项, 也许它们应该在“/ etc / sysconfig / networking / devices / ifcfg-eth0”
我有一个RHEL6的全新安装,我无法找到任何配置文件来为dhclient进行高级配置.
我试图在Ubuntu上找到类似dhclient.conf的东西,所以我可以修改诸如supersede domains,fqdn之类的选项,
也许它们应该在“/ etc / sysconfig / networking / devices / ifcfg-eth0”上,在这种情况下,哪些设置与那些dhclient.conf配置相匹配?

解决方法

配置文件是/etc/dhcp/dhclient-${DEVICE}.conf,/??etc/dhclient-${DEVICE}.conf或/etc/dhcp/dhclient.conf中的一个.使用存在的第一个.

来自/ etc / sysconfig / network-scripts / ifup-eth(Fedora 14; RHEL6可能类似):

# allow users to use generic '/etc/dhcp/dhclient.conf' (as documented in manpage!)
# if per-device file doesn't exist or is empty
if [ -s /etc/dhcp/dhclient-${DEVICE}.conf ]; then
   DHCLIENTCONF="-cf /etc/dhcp/dhclient-${DEVICE}.conf";
elif [ -s /etc/dhclient-${DEVICE}.conf ]; then
   DHCLIENTCONF="-cf /etc/dhclient-${DEVICE}.conf";
else
   DHCLIENTCONF='';
fi;

从dhclient手册页:

-cf <config-file>
          Path to the client configuration file.  If unspecified,the default /etc/dhcp/dhclient.conf is used.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读