How to Change Ip from Dynamic to Static

In Debain :
/etc/networking/interfaces

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

then /etc/init.d/networking restart

In Centos:
vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=Static
HWADDR=00:0C:29:81:90:33
ONBOOT=yes
IPADDR=192.168.1.1
NETMASK=255.255.255.0
NETWORK=192.168.1.0
GATEWAY=192.168.1.1
BROADCAST=192.168.1.255

then : /etc/network/restart

3 Responses to “How to Change Ip from Dynamic to Static”

  1. Jon says:

    Ubuntu is a derivative of Debian, right? Would this work there also?

  2. Fosiul says:

    Hi
    Yes it will work on Ubuntu as-well.

  3. Fosiul says:

    Also in Ubuntu check

    /etc/network/interfaces

    rest are Same as Before

Leave a Reply