Welcome, Guest. Please login or register.
Did you miss your activation email?
February 24, 2006, 02:56:38 AM
Home Help Search Login Register
News: No News Is Good News

+  linuxfornewbies.org
|-+  HowTo's
| |-+  Networking
| | |-+  Static IP Addressing configuration
« previous next »
Pages: [1] Print
Author Topic: Static IP Addressing configuration  (Read 334 times)
Vern Heesch
Administrator
Newbie
*****
Posts: 23



View Profile
Static IP Addressing configuration
« on: June 30, 2005, 01:04:35 AM »

This howto is intended to provide the information needed to set up Static IP Addressing. I use Mandrake linux and am not sure how closely other distro's follow the same file naming scheme.

Setting up Static IP Addressing involves checking and/or editing 4 files. You may want to make copies of your current files just so you have them to fall back on if something goes wrong. The files are:

/etc/resolv.conf
/etc/hosts
/etc/sysconfig/network
/etc/sysconfig/network-scripts/ifcfg-eth0


(your ifcfg file may differ, eth0, eth1, wlan0, etc.)

These are the fields required for the /etc/sysconfig/network-scripts/ifcfg-eth0 file:
(this is an example, replace values appropriately for your network. This example includes wireless, if you don't have wireless leave out those fields)

DEVICE=eth1
BOOTPROTO=static
IPADDR=192.168.0.2
NETMASK=255.255.255.0
NETWORK=192.168.0.0
BROADCAST=192.168.0.255
ONBOOT=yes
MII_NOT_SUPPORTED=yes
WIRELESS_MODE=Managed
WIRELESS_ESSID=any
WIRELESS_ENC_KEY=""


Next is the /etc/sysconfig/network file:

HOSTNAME=something-cool
NETWORKING=yes
GATEWAY=192.168.0.1
GATEWAYDEV=eth1


The /etc/hosts file needs the IP and Hostname added to it:

127.0.0.1               localhost
192.168.0.2           something-cool


Last is the /etc/resolv.conf file which contains the DNS IP's:

nameserver 205.221.122.145
nameserver 205.221.122.142


Once the 4 files have been checked and edited, simply restart the network as root:

service network restart

I hope this was helpful and clear enough to understand what needs to be done to use Static IP Addressing.
Logged
Pages: [1] Print 
« previous next »
Jump to:  


Login with username, password and session length

Powered by MySQLPowered by PHP linuxfornewbies.org | Powered by SMF 1.0.5.
© 2001-2005, Lewis Media. All Rights Reserved.
Valid XHTML 1.0!Valid CSS!