Static IP

Kevin Hodle kevinh at aos5.com
Tue Feb 25 00:10:57 CST 2003


You can also change this with the 'yast' and 'yast2' utilities in SuSe.
If you want to go the old fashoined way, you can configure the IP info
the following way:

 ifconfig eth0 192.168.1.2 netmask 255.255.255.0
 route add default gw 192.168.1.1
 echo 'nameserver 192.168.192.1' > /etc/resolv.conf

To achieve the same effect using static info, you could also probably
edit the network rc's in /etc/rc.d, but im not sure what files SuSe uses
for this.  Failing that, just put the above lines in /etc/rc.d/rc.local
(executed last in the rc startup order).
 
Kevin Hodle
CCNA, Network+, A+
Alexander Open Systems
Network Operations Center
kevinh at aos5.com

-----Original Message-----
From: Duane Attaway [mailto:dattaway at dattaway.org] 
Sent: Monday, February 24, 2003 11:49 AM
To: Peter Amisano
Cc: Jason Clinton; Gene Dascher; Kclug
Subject: Re: Static IP

On Mon, 24 Feb 2003, Peter Amisano wrote:

> I set up a box while contracting with Sprint to pull an IP via DHCP.  
> I used SUSE Linux on a Sun box, but cannot remember what the SUSE menu

> system looks like(I was trying to help over the phone)
> 
> How can I set a set a static IP via the command line?

dhcpd seems to try and get the last number used if it is available, so
I'd 
set the dhcp cache file to what you want so it can request it.  For 
example, my /etc/dhcpc/dhcpcd-eth0.cache says:

root at satellite dattaway # cat /etc/dhcpc/dhcpcd-eth0.info
IPADDR=24.166.190.52 NETMASK=255.255.252.0 NETWORK=24.166.188.0
BROADCAST=255.255.255.255 GATEWAY=24.166.188.1 DOMAIN='kc.rr.com' ...

I can pretty much set IPADDR to what I want and if it available, I will 
get it.  Pretty handy if I have my laptop unconnect for long periods of 
time.

--
"It is the duty of a patriot to protect his country from its government"
-Thomas Paine
http://dattaway.org    




More information about the Kclug mailing list