HOWTO Setup a Static IP

From Research
Revision as of 20:46, 5 September 2006 by Mmmark (talk | contribs) (→‎SUSE Linux)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

All our servers have static IP addresses because it's more fail reliable as does not depend on a DHCP server.

Gentoo

If you want to use the iproute2 module, make sure you emerge this package or networking will fail!!


File: /etc/conf.d/net.eth0 (or /etc/conf.d/net if the first does not exist)

config_eth0=( "209.87.56.xx/24" )
routes_eth0=( "default via 209.87.56.254" )

If you want to set a static IP to 2 or more bonded network cards, your config would look like this:

modules=( "iproute2" )
iproute_eth0=( "null" )
iproute_eth1=( "null" )
slaves_bond0="eth0 eth1"
ipaddr_bond0=( "209.87.56.16/24 brd 209.87.56.255" )
iproute_bond0=( "default via 209.87.56.254" )

SUSE Linux

Use yast.

Fedora Core

The networking file depends which version of Fedora Core you are using.

Fedora Core 1: /etc/sysconfig/networking/devices/ifcfg-eth0

Fedora Core 2+: /etc/sysconfig/network-scripts/ifcfg-eth0

Add these values to the file and remove all dhcp settings.

IPADDR=209.87.56.xx
NETWORK=209.87.56.0
NETMASK=255.255.255.0
GATEWAY=209.87.56.254