Linux Tcp/ip config

Bud Guy

Senior member
Nov 4, 1999
235
0
0
What file and command do I need to set a systems ip in linux via a cmd prompt?

I've poked around but didn't find it. The linux box is red hat... can't remember the version of the top of my head though? I'm sure there a file that defines the ip, netmask, subnet mask, dns, blah...blah...blah.

Thanks in advance!
 

cleverhandle

Diamond Member
Dec 17, 2001
3,566
3
81
Ultimately, all networking is set up through ifconfig and route, but you generally don't run those commands manually. In Red Hat, you'll want to use their graphical networking setup tool if you've got an X display. If you're command-line only, you can run a stripped-down text version using netconfig. It's simple, but has all the basics.

If, for some reason, you don't want to use those tools (which are the recommended way to do things) there are text files somewhere in /etc (maybe /etc/default/networking?) that provide that information. But it's really easier to use the tools.

edit: added the bit about route
 

Bud Guy

Senior member
Nov 4, 1999
235
0
0
ok, cool! Thats what I was looking for. I'll look into that netconfig command.

Thanks
 

skyking

Lifer
Nov 21, 2001
22,725
5,851
146
in RH9, it is in /etc/sysconfig/networking/profiles/default, listed as ifcg-eth0 or whatever your ethenet adapter's ID is.
resolv.conf is also in that directory, as well as the hosts file
 

Bud Guy

Senior member
Nov 4, 1999
235
0
0
Thanks guys... 1 More question. I've found the ifcg-eth0 files that I need to modify, now if you don't mind what is the correct way to edit this file? do I do a vi? Anyone have any useful links to using vi if so?

Thanks a million! Shane
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
vi/vim is recommended since it's on every unix system. If you don't know it and you have vim installed run 'vimtutor'.
 

nweaver

Diamond Member
Jan 21, 2001
6,813
1
0
I love VI....I even got vi for windows....I had to search/replace a huge number of times on huge text files (like 150 MB+) And notepad was taking FOREVER(read 45 minutes)....winVI, 2 minutes.