Red Hat / Fedora Core IP Configuration Files

The Red Hat configuration tools store the configuration information in the file /etc/sysconfig/network.
They will also allow one to configure routing information.
  • File: /etc/sysconfig/network
    Static IP address Configuration: (Configure gateway address)
  • NETWORKING=yes
    HOSTNAME=my-hostname      - Hostname is defined here and by command hostname
    FORWARD_IPV4=true         - True for NAT firewall gateways and linux routers. 
                                False for everyone else - desktops and servers.
    GATEWAY="XXX.XXX.XXX.YYY" - Used if your network is connected to another network or the internet. 
                                Static IP configuration. Gateway not defined here for DHCP client.
                        
    OR for DHCP client configuration:
    NETWORKING=yes
    HOSTNAME=my-hostname      - Hostname is defined here and by command hostname
                        
    (Gateway is assigned by DHCP server.)
    OR for NIS client configuration:
    NETWORKING=yes
    HOSTNAME=my-hostname      - Hostname is defined here and by command hostname
    NISDOMAIN=NISProject1     - NIS domain to attach
    
                        
  • File (Red Hat/Fedora): /etc/sysconfig/network-scripts/ifcfg-eth0
    (S.u.s.e.: 
    /etc/sysconfig/network/ifcfg-eth-id-XX:XX:XX:XX:XX)
    This file used by the command scripts 
    ifup and ifdown
    Static IP address configuration:
    DEVICE=eth0
    BOOTPROTO=static
    BROADCAST=XXX.XXX.XXX.255
    IPADDR=XXX.XXX.XXX.XXX
    NETMASK=255.255.255.0
    NETWORK=XXX.XXX.XXX.0
    ONBOOT=yes                       - Will activate upon system boot
                        
    RHEL4/FC3 additions:
    • TYPE=Ethernet
    • HWADDR=XX:XX:XX:XX:XX:XX
    • GATEWAY=XXX.XXX.XXX.XXX
    OR for DHCP client configuration:
    DEVICE=eth0
    ONBOOT=yes
    BOOTPROTO=dhcp
                        
    RHEL4/FC3 additions:
    • IPV6INIT=no
    • USERCTL=no
    • PEERDNS=yes
    • TYPE=Ethernet
    • HWADDR=XX:XX:XX:XX:XX:XX
(Used by script /etc/sysconfig/network-scripts/ifup to bring the various network interfaces on-line) 
To disable DHCP change BOOTPROTO=dhcp to BOOTPROTO=none
In order for updated information in any of these files to take effect, one must issue the command: service network restart (or: /etc/init.d/network restart)