Setting Static IP for Host

Pros and cons

There is no obvious speed disadvantage in using DHCP. The use of static IP is, however, mandatory in some server setups, such as DHCP server and DNS server. Some may argue that static IP makes it possible to get on-line when the router is down. That is true if only one host is connecting to the internet.

Webmin method

wbm-351: Webmin log in
Log in to Webmin (https://localhost:10000).


wbm-011: Webmin home page
Click Networking icon.

wbm-021: Webmin Networking page
Click Network Configuration link.


wbm-051: Network Interfaces page
Click Network Interfaces link.

Look for Interface activated at boot time

Click eth0 link.


wbm-461: Bootup Interfaces page
Check (tick) the radio button next to Static.

Key in your preferred private IP, e.g. 192.168.1.101.

Click Save and apply.


wbm-071: Network Configuration page
Return to Network Configuration page.

Click Apply Configuration .


Alternative

The alternative is to locate ifcfg.eth0 in /etc/sysconfig (could be further in) and edit it to:
You have to be root to do this.
DEVICE=eth0
BOOTPROTO=static
IPADDR=192.168.1.101
NETMASK=255.255.255.0
NETWORK=192.168.1.0
BROADCAST=192.168.1.255
ONBOOT=yes
METRIC=10

Restart network:

# /etc/init.d/network restart

or
# /etc/rc.d/init.d/network restart