Setting Up a CentOS / Red Hat Linux DHCP Client
Q. How do I setup my Red Hat / CentOS / Fedora Linux system to get IP address and other information via a DHCP server for eth0 interface?
A. You can edit eth0 configuration file to switch between static and dhcp networking configuration under RHEL / Fedora or CentOS Linux. Simply edit /etc/sysconfig/network-scripts/ifcfg-eth0 file.
Backup existing static configuration
First backup existing network configuration file using cp command:
# cp /etc/sysconfig/network-scripts/ifcfg-eth0 /root/ifcfg-eth0.bak
Configuring a DHCP Client
Setting up a Linux for dhcp can be done by editing file using a text editor such as vi:
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
Following is sample static configuration:
DEVICE=eth0
BOOTPROTO=static
HWADDR=00:19:D1:2A:BA:A8
IPADDR=10.10.29.66
NETMASK=255.255.255.192
ONBOOT=yes
Replace static configuration with DHCP:
DEVICE=eth0
BOOTPROTO=dhcp
HWADDR=00:19:D1:2A:BA:A8
ONBOOT=yes
Save and close the file. Just restart network service:
# /etc/init.d/network restart
Please note that you need a configuration file for each device that you want to configure to use DHCP.
Subscribe to our free e-mail newsletter or RSS feed to get all updates.
You can Email this page to a friend.
Related Linux / UNIX FAQ:
- How do I find out my DHCP server address?
- Configuring Linux Static DHCP Clients by Sending Host Name
- Configure Linux DHCP client ( dhclient ) to persistently look for an IP address lease
- Linux Force DHCP client (dhclient) to renew ip address
- /etc/network/interfaces Ubuntu Linux networking example
Leave a Reply
We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Please do not use the comment form to ask for help / question. Ask your question on the excellent Linux tech support forum. Thank you very much for stopping by our site!
Tags: /etc/sysconfig/network-scripts/ifcfg-eth0, centos dhcp configuration, configuration file, cp command, dhcp client, dhcp howto, dhcp server, fedora dhcp configuration, fedora linux, how to configure dhcp, interface, Linux, linux dhcp client configuration, linux dhcp client setup, linux dhcp configuration, network configuration, network scripts, networking configuration, red hat dhcp, red hat linux, redhat dhcp configuration, sysconfig, vi command ~ Last updated on: March 15, 2008



Recent Comments
Today ~ 2 Comments
Today ~ 9 Comments
Today ~ 2 Comments
Today ~ 1 Comment
Today ~ 2 Comments