linux poison RSS
linux poison Email

How to configure DHCP Client

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.

The /etc/sysconfig/network file should contain the following line:

NETWORKING=yes

The /etc/sysconfig/network-scripts/ifcfg-eth0 file should contain the following lines:

DEVICE=eth0
BOOTPROTO=dhcp
ONBOOT=yes

A configuration file is needed for each device to be configured to use DHCP.

Other options
PEERDNS=, where is one of the following:
yes — Modify /etc/resolv.conf with information from the server. If using DHCP, then yes is the default.
no — Do not modify /etc/resolv.conf.

USERCTL=, where is one of the following:
yes — Non-root users are allowed to control this device.
no — Non-root users are not allowed to control this device.


3 comments:

awhan said...

couldn't find any such file on ubuntu 8.04

DevOps said...

Post is mainly for RHEL / Fedora / CentOS/OpenSuse

If you want to configure DHCP address on Ubuntu you need to edit the /etc/network/interfaces and you need to enter the following lines replace eth0 with your network interface card

sudo vi /etc/network/interfaces

# The primary network interface - use DHCP to find our address
auto eth0
iface eth0 inet dhcp

awhan said...

thank you nikesh

Post a Comment

Related Posts with Thumbnails