Thursday, December 08, 2005

Enable ethernet interface to use DHCP via configuration file

  1. Login as normal user.
  2. Open a terminal and type su to login as root.
  3. cd to /etc/sysconfig/network-scripts/.
  4. Edit ifconfig-eth0 (change eth0 to the interface that will be configured).
  5. To force system to use the configuration do run /etc/sysconfig/network-scripts/ifdown eth0 to bring it down then run /etc/sysconfig/network-scripts/ifup eth0.

Below is the format of ifconfig-* for DHCP configuration
DEVICE=eth0
BOOTPRO=dhcp
ONBOOT=yes
TYPE=Ethernet
Below is the format of ifconfig-* for static configuration
DEVICE=eth0
IPADDR=192.168.1.2
NETMASK=255.255.255.0
NETWORK=192.168.1.0
BROADCAST=192.168.1.255
ONBOOT=yes
System Used: Fedora Core 3

0 Comments:

Post a Comment

<< Home