(Answer) (Category) Linux on PowerPC FAQ-O-Matic : (Category) System Configuration : (Category) Networking :
How to configure static IP networking from command line?
SUMMARY: Easier how-to config. static IP networking via CL

SEARCH KEYWORDS: Configuring static-IP address networking via command line

The method presented below does not rely on the Red Hat start-up scripts but
rather uses standard system binaries, and is also somewhat clearer.  I have
tested it on an X-less installation of PM7300/200 running LinuxPPC 2k and it
works perfectly - your mileage may vary (though I would be interested if it
didn't work for you).

BEFORE YOU BEGIN:  You need to know your assigned static IP address, the subnet
mask or netmask, the IP address of your router/gateway device that serves your
LAN, your hostname and domain name, and your domain name server (DNS) serach
domain and IP addresses of your ISP's name servers.  If you have functional
TCP/IP networking on MacOS, you can find all this information in the TCP/IP
control panel (except the hostname -- which your ISP will have, and they should
let you change it to something that suits you). 

EXAMPLE:  My machine 'monkey' (hostname) is on the domain 'nuts.org' (domain
name).  I have been assigned IP address 119.119.119.119.  My subnet mask is
255.255.255.0 (netmask), and my domain router/gateway has IP address
119.119.119.1.  I hit two domain name servers (DNS) at 119.1.1.1 and 119.1.1.2. 

STEPS:
(1)  De-fuse the Red Hat networking scripts by editing
/etc/sysconfig/network-scripts/ifconfig-eth0 and possibly ifconfig-eth1 (if
they even exist) so that 'ONBOOT=no' (or simply remove the file(s)).

(2)  Append the following lines to the end of the /etc/rc.d/rc.local script:

/sbin/ifconfig eth0 199.119.119.119             <-- your static IP address
/sbin/ifconfig eth0 netmask 255.255.255.0       <-- your subnet mask
/sbin/route add default eth0
/sbin/route add default gw 119.119.119.1        <-- router/gateway
/bin/hostname monkey                                            <-- sets hostname
/bin/domainname nuts.org                                        <-- sets domainname

See the man files for ifconfig, route, hostname, and domainname for more
information.  If you have added an ethernet card or have a different network
interface you could change all the above lines to use that interface (i.e.,
eth1 or tap1 instead of eth0) or you could configure multiple interfaces.

(3)  Edit /etc/resolv.conf to include your DNS information:

search nuts.org                                 <-- optional search domain
nameserver 119.1.1.1                            <-- nameserver 1
nameserver 119.1.1.2                            <-- nameserver 2
 
The 'search ...' line makes life easier by automatically appending the given
search domain to any hostnames you might use.  As an example, rather than
'telnet donkey.nuts.org' you could just 'telnet donkey'.

(4)  Add your IP address, hostname, and hostname.domainname information to the
/etc/hosts file:

127.0.0.1 localhost localhost.localdomain
199.119.119.119 monkey monkey.nuts.org

(5)  That's it.  Reboot and test it using 'ping xxx.xxx.xxx.xxx' and then 'ping
hostname.domainname'.  If the latter doesn't work then your DNS information is
not properly set up (or you mistyped something). 

THANKS TO:  Michael Peters (for this method), Aaron Marasco, Simon Piette,
Vinai, rboder, & Steve Revilak for their comments and/or suggestions.
lemonds@hawaii.edu
[Append to This Answer]
Previous: (Answer) MacOS 8.5 freezes with netatalk
This document is: http://www.jonh.net/cgi-bin/lppcfom/fom?file=1045
[Search] [Appearance]
This is a Faq-O-Matic 2.717d.
Hosted by anduin.org and SourceForge Logo