LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 01-06-2004, 11:28 AM   #1
jjd228
Member
 
Registered: Jan 2004
Distribution: RedHat 9
Posts: 41

Rep: Reputation: 15
TCP/IP settings... newbie


ive asked this question at times and have gotten numerous completely different answers. im running redhat 9....

if i do not want to use dhcp, but instead want to manually set my ip address, default gateway, subnet mask, and dns servers, how do i do this? or should i say, what is the most direct way? is there one file that holds all of this info? and how do i specify whether or not i want to use dhcp in the first place?
 
Old 01-06-2004, 11:38 AM   #2
GAVollink
Member
 
Registered: Apr 2002
Location: Bronx, NY
Distribution: Ubuntu
Posts: 371

Rep: Reputation: 34
On REDHAT (and AFAIK only RPM distros) the most DIRECT way is to edit the following file(s):

/etc/sysconfig/network-scripts/ifcfg-<device>

# file contents...
DEVICE=<device>
BOOTPROTO=static
IPADDR=192.168.1.2
NETMASK=255.255.255.0
ONBOOT=yes
TYPE=Ethernet

<device> most likely = eth0 (the first ethernet device)

If you want DHCP then REMOVE the lines for IPADDR and NETMASK and make the BOOTPROTO line as so:

BOOTPROTO=DHCP

And yes, there are several Graphical and Wizard ways of doing the EXACT SAME THING, although (AFAIU [nderstand]) they all edit the file(s) at the location above.
 
Old 01-06-2004, 12:04 PM   #3
jjd228
Member
 
Registered: Jan 2004
Distribution: RedHat 9
Posts: 41

Original Poster
Rep: Reputation: 15
ok. but that does nothing to set the default gateway or dns servers. what now?
 
Old 01-06-2004, 12:38 PM   #4
GAVollink
Member
 
Registered: Apr 2002
Location: Bronx, NY
Distribution: Ubuntu
Posts: 371

Rep: Reputation: 34
DNS Servers - /etc/resolv.conf
Gateway - /etc/sysconfig/netwok

Same applies - this is RedHat (and RPM based dist) specific. Different dists put this in different areas.
 
Old 01-06-2004, 12:47 PM   #5
jjd228
Member
 
Registered: Jan 2004
Distribution: RedHat 9
Posts: 41

Original Poster
Rep: Reputation: 15
ok my /etc/resolv.conf does indeed have my domain name and 2 dns servers. but /etc/sysconfig/network only has this:

NETWORKING=yes
HOSTNAME=myhostname.mydomainname.com

so im still not seeing where the gateway is coming from
 
Old 01-06-2004, 12:56 PM   #6
GAVollink
Member
 
Registered: Apr 2002
Location: Bronx, NY
Distribution: Ubuntu
Posts: 371

Rep: Reputation: 34
My /etc/sysconfig/network file has your two lines, plus GATEWAY= like so:

NETWORKING=yes
HOSTNAME=me.inside
GATEWAY=192.168.1.1
 
Old 01-06-2004, 01:01 PM   #7
jjd228
Member
 
Registered: Jan 2004
Distribution: RedHat 9
Posts: 41

Original Poster
Rep: Reputation: 15
well thats very odd because i dont have a gateway listed anywhere yet the network is working fine. this is exactly what i mean. this is also why people have so many frustrating problems with linux. theres never a clear answer to anything. but thank you for your help
 
Old 01-06-2004, 01:38 PM   #8
GAVollink
Member
 
Registered: Apr 2002
Location: Bronx, NY
Distribution: Ubuntu
Posts: 371

Rep: Reputation: 34
(double checking RedHat 9 machine while typing on RedHat ES3 machine)...

Yes and no... if you are currently using DHCP - gateway is handled automatically - I can't find any other place where GATEWAY would make sense on my RH 9 system though - but overwhelmingly - it's not set anywhere (but it shouldn't be). My RH9 one does use DHCP - my ES3 does not.

I'm sticking by my previous answer.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
super newbie: wlan settings in linux (slack) carboncopy Linux - Wireless Networking 1 08-25-2005 09:54 AM
Woody 3.0 Open Ports 1470/tcp/uaiact 1518/tcp/vpvd What for?How can I remove them? alexxxis Debian 5 07-05-2004 05:18 PM
Change clock settings? (newbie... sorry) zsejk Slackware 7 08-13-2003 05:51 PM
slightly OT; but newbie needs help with everydns.net settings lucastic Linux - Networking 0 08-10-2003 02:59 PM
close port 6000/tcp 515/tcp SchwipSchwap Linux - Newbie 1 09-12-2002 08:24 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 01:48 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration