Static IP

Rick Stevens rstevens at vitalstream.com
Tue Apr 12 18:35:53 UTC 2005


Scott Mertens wrote:
> On Tue, 2005-04-12 at 10:55 -0700, Rick Stevens wrote:
> 
>>Scott Mertens wrote:
>>
>>>On Tue, 2005-04-12 at 10:21 -0700, Rick Stevens wrote:
>>>
>>>
>>>>Scott Mertens wrote:
>>>>
>>>>
>>>>>On Tue, 2005-04-12 at 10:00 -0700, Rick Stevens wrote:
>>>>>
>>>>>
>>>>>
>>>>>>Scott Mertens wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>>>New Linux User:  Red Hat Enterprise Linux ES release 4 (Nahant)
>>>>>>>
>>>>>>>I am in the process of setting up Printer sharing on this Linux box for
>>>>>>>WIN XP users. I think some of my problems might be resolved if I can set
>>>>>>>up a static IP for this box.  Currently it gets one from a Linksys
>>>>>>>router connected to ISP.
>>>>>>>
>>>>>>>How can I tell Linux to use a static IP, but use DNS and other info
>>>>>>>provided by ISP/Linksys router?
>>>>>>
>>>>>>First off, get into the router and write down the DNS info it uses.
>>>>>>Also check the router's "DHCP Pool" (those are the addresses that the
>>>>>>DHCP server will give out) and the router's IP address and netmask.
>>>>>>
>>>>>>Run "redhat-config-network" (or "RedHatIcon->System Settings->Network"
>>>>>
>>>>>>from the Gnome GUI) and configure the NIC for a fixed IP address.  You
>>>>>
>>>>>
>>>>>>will want to select a fixed IP that is NOT in the DHCP pool for the
>>>>>>router.  Your netmask will probably be 255.255.255.0, but use the one
>>>>>>you saw that the router was using.  Your default gateway will be the
>>>>>>router (usually 192.168.0.1) and you'll put in the DNS servers you
>>>>>>grabbed from the router.  That should be it.
>>>>>
>>>>>
>>>>>Thanks, I'll give that a try.
>>>>
>>>>Go for it, Scott.  We'll be waiting for a status report.
>>>
>>>
>>>Is there just a file I can edit?  My practice is to always make a backup
>>>of files before editing, and I'm not sure the GUI will do that.  Also
>>>running the following as you suggest throws an error.
>>>
>>>[root at RHServer01 ~]# redhat-config-network
>>>-bash: redhat-config-network: command not found
>>
>>That's odd.  Hmmm.  Try "system-config-network".  One or the other
>>should be in /usr/bin.
>>
>>Anyway, yes, you can edit files if you wish.  You're interested in
>>these two files:
>>
>>	/etc/sysconfig/network
>>	/etc/sysconfig/network-scripts/ifcfg-eth0
>>
>>/etc/sysconfig/network contains three lines generally.  Here's a typical
>>file:
>>
>>	NETWORKING=yes
>>	HOSTNAME=hostname.domainname.tld
>>	GATEWAY=xxx.xxx.xxx.xxx
>>
>>The values in there should be pretty obvious.  Put your desired hostname
>>as the value of the "HOSTNAME=" line, and the IP address of your gateway
>>in the "GATEWAY=" line (as I said, your gateway is probably
>>192.168.0.1, but use whatever the router's LAN port's address is).
>>
>>The second file, /etc/sysconfig/network-scripts/ifcfg-eth0, sets up the
>>specifics for your NIC.  The only data that is REQUIRED in that file
>>are the following:
>>
>>	DEVICE=eth0
>>	BOOTPROTO=static
>>	IPADDR=xxx.xxx.xxx.xxx
>>	NETMASK=yyy.yyy.yyy.yyy
>>	ONBOOT=yes
>>
>>Make sure you set the "DEVICE=" to the proper device.  If you only have
>>one NIC, then "eth0" is the right value (it should match the name of the
>>file).
>>
>>"BOOTPROTO=static" is what makes the device use a static IP rather than
>>one from DHCP (which is triggered by "BOOTPROTO=dhcp").  Obviously, you
>>put your desired IP address in the "IPADDR=" line and your netmask in
>>"NETMASK=".
>>
>>The final line, "ONBOOT=yes" tells the system to bring up this interface
>>at boot time.
>>
>>Once you've got all that set up, do "/etc/rc.d/init.d/network restart"
>>and the system should switch over to your new network settings.
> 
> 
> Thanks system-config-network did work.  And if this message goes
> through, the setup and file edits worked as well.

We see the message, so apparently they did.

Regarding the name of the script, Ah, HAH!  Sneaky of them!

HISTORY:  Red Hat Linux (RHL) 8.0 and 9 had those scripts named
"redhat-config-whatever".  Fedora Core 1 also used that nomenclature
(since it was going to be Red Hat Linux 10, before Red Hat decided to
go fully commercial).

Fedora Core 2 started using "system-config-whatever" to differentiate
it from RHL or RHEL.  I know that RHEL4 is based on Fedora Core 2, but
since Fedora isn't an "official" Red Hat product, I had (wrongly)
assumed they had reverted to calling them "redhat-config-whatever" to
pull them back into the Red Hat product range.  That's what I get for
making assumptions. Now I know better and I thank you for the education.

(I am now kicking myself--quite a feat for an old geezer like me)

> Great board for us beginners.  Appreciate all the help!!

"That's what we're here for!" (c)2005, Red Hat Install List  :-)
----------------------------------------------------------------------
- Rick Stevens, Senior Systems Engineer     rstevens at vitalstream.com -
- VitalStream, Inc.                       http://www.vitalstream.com -
-                                                                    -
-        Brain:  The organ with which we think that we think.        -
----------------------------------------------------------------------




More information about the Redhat-install-list mailing list