搜索

此内容没有您所选择的语言版本。

16.3. Configuring a DHCPv4 Client

download PDF
To configure a DHCP client manually, modify the /etc/sysconfig/network file to enable networking and the configuration file for each network device in the /etc/sysconfig/network-scripts directory. In this directory, each device should have a configuration file named ifcfg-eth0, where eth0 is the network device name.
Make sure that the /etc/sysconfig/network-scripts/ifcfg-eth0 file contains the following lines:
DEVICE=eth0
BOOTPROTO=dhcp
ONBOOT=yes
To use DHCP, set a configuration file for each device.
Other options for the network script include:
  • DHCP_HOSTNAME — Only use this option if the DHCP server requires the client to specify a host name before receiving an IP address.
  • PEERDNS=<answer>, where <answer> is one of the following:
    • yes — Modify /etc/resolv.conf with information from the server. This is the default.
    • no — Do not modify /etc/resolv.conf.
If you prefer using a graphical interface, see Chapter 10, NetworkManager for instructions on using NetworkManager to configure a network interface to use DHCP.

Note

For advanced configurations of client DHCP options such as protocol timing, lease requirements and requests, dynamic DNS support, aliases, as well as a wide variety of values to override, prepend, or append to client-side configurations, see the dhclient and dhclient.conf man pages.
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.