Red Hat/Centos Edit interface settings by editing the “/etc/sysconfig/network-scrips/ifcfg-eth0” file. The following settings will configure an interface to have a static IP address:

DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
NETMASK=255.255.255.0
IPADDR=192.168.1.27
USERCTL=no

The following settings will configure an interface to use DHCP:

DEVICE=eth0
BOOTPROTO=dhcp
ONBOOT=yes

Some additional details from http://www.centos.org/docs/5/html/5.1/Deployment_Guide/s2-networkscripts-interfaces-eth0.html

BOOTPROTO= where is one of the following:

none — No boot-time protocol should be used. bootp — The BOOTP protocol should be used. dhcp — The DHCP protocol should be used.

BROADCAST=<address> where <address> is the broadcast address. This directive is deprecated, as the value is calculated automatically with ifcalc.

DEVICE= where is the name of the physical device

HWADDR= where is the hardware address of the Ethernet device in the form AA:BB:CC:DD:EE:FF. This directive is useful for machines with multiple NICs to ensure that the interfaces are assigned the correct device names regardless of the configured load order for each NIC's module. This directive should not be used in conjunction with MACADDR.

IPADDR=<address> where <address> is the IP address.

MACADDR= where is the hardware address of the Ethernet device in the form AA:BB:CC:DD:EE:FF. This directive is used to assign a MAC address to an interface, overriding the one assigned to the physical NIC. This directive should not be used in conjunction with

NETMASK= where is the netmask value.

ONBOOT= where is one of the following: yes — This device should be activated at boot-time. no — This device should not be activated at boot-time.

Debian Edit interface settings by editing the “/etc/network/interfaces” file. The following settings will configure an interface to have a static IP address:

iface eth0 inet static
address 192.168.1.5
netmask 255.255.255.0
gateway 192.168.1.254

The following settings will configure an interface to use DHCP:

auto eth0
iface eth0 inet dhcp

Some additional details from http://www.debian.org/doc/manuals/debian-reference/ch05.en.html

“auto " or "allow-auto " start interface upon start of the system

“allow-hotplug " start interface when the kernel detects a hotplug event from the interface

Lines started with “iface " define the network configuration Lines started with "mapping " define mapping value of for the matching

Lines started with iface stanza has the following syntax.

iface <config_name> <address_family> <method_name>
<option1> <value1>
<option2> <value2>
...