Static IP Configuration (Debian or Red Hat)

  • For Debian
    Modify /etc/network/interfaces

    # /etc/network/interfaces — configuration file for ifup(8), ifdown(8)

    # The loopback interface
    auto lo
    iface lo inet loopback

    # The first network card – this entry was created during the Debian installation
    # (network, broadcast and gateway are optional)
    auto eth0

    iface eth0 inet static
    address 192.168.1.10
    netmask 255.255.255.0
    network 192.168.1.0
    broadcast 192.168.1.255
    gateway 192.168.1.1

  • For Red Hat
    Modify /etc/sysconfig/network-scripts/ifcfg-eth*

    DEVICE=eth0
    BOOTPROTO=static
    ONBOOT=yes
    IPADDR=192.168.1.10
    NETMASK=255.255.255.0
    GATEWAY=192.168.1.1

Run /etc/init.d/networking restart to apply these changes