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 - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 09-30-2006, 04:00 AM   #1
tuxuser19
Member
 
Registered: Oct 2005
Posts: 67

Rep: Reputation: 15
Command line/tools in CentOS/RHEL ?


I am a typical Debian user. I installed CentOS for curiosity to see how Redhat works. Considering that CentOS is similar to RHEL-Which is good. I want to know where can I find the proper documentation on command line stuff for CentOS/RHEL?

For example, in Debian to configure network "interfaces" you go to
/etc/network/interfaces, where can I find this config file in CentOS/RHEL?

I want to know if there is any good documentation for these sought of config files in CentOS/RHEL?


Thank you.
P.S: Please dont advise me about GUI tools for configuring in RHEL.
 
Old 09-30-2006, 08:03 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
The networking stuff in RHEL is kept in /etc/sysconfig/network-scripts and /etc/sysconfig/networking.

In the former you will need to create "ifcfg-<nic>" for each NIC you want to configure. (e.g. ifcfg-eth0).

A good example file for an eth0:
DEVICE=eth0
BOOTPROTO=static
BROADCAST=10.0.18.255
HWADDR=000:B7:69:5B:78
IPADDR=10.0.22.60
NETMASK=255.255.252.0
NETWORK=10.0.22.0
ONBOOT=yes
TYPE=Ethernet
ETHTOOL_OPTS="autoneg off speed 100 duplex full"

You can have a look at the ifup script in this directory.

ifconfig of course can be used to configure NICs but I'm not sure if it automatically writes to the above files. I did most of my changes by either manual edits or using the GUIs.

ethtool can be used for configuring the NIC speed, duplex and negotiation. As can bee seen from the above I've input ethtool options so it will automatically set these items at boot for the NIC.

There is a file called:
/usr/sbin/system-config-network-tui

For doing the config. It will use text based user interface for the configs. I just pulled it up to verify it opened successfully in my PuTTY window but have never used it for actual config

Not sure if Centos has all the above.
 
Old 09-30-2006, 08:15 AM   #3
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
The CentOS-4 docs are at http://www.centos.org/docs/4/ and basically everything you'll find for recent RHEL should apply.


ifconfig of course can be used to configure NICs but I'm not sure if it automatically writes to the above files.
It does not automagically write to those files: it's not ifconfig's task.


Not sure if Centos has all the above.
On CentOS-3 these tools are named redhat-config-.*.
Don't know if it changed on CentOS-4.
 
Old 09-30-2006, 09:30 AM   #4
tuxuser19
Member
 
Registered: Oct 2005
Posts: 67

Original Poster
Rep: Reputation: 15
In fact, I did go through http://www.centos.org/docs/4/ but most of the information is through GUI based i.e through Gnome interface based which I didn't like it.

Thank you guys for the quick reply.
 
Old 10-01-2006, 06:28 PM   #5
tuxuser19
Member
 
Registered: Oct 2005
Posts: 67

Original Poster
Rep: Reputation: 15
The networking stuff in RHEL is kept in /etc/sysconfig/network-scripts and /etc/sysconfig/networking.

In the former you will need to create "ifcfg-<nic>" for each NIC you want to configure. (e.g. ifcfg-eth0).

---
So, what you say is if I have more than one NIC card then I can use a range through the script in /etc/sysconfig/networking folder? Then how do I configure suppose if I have 3 NIC's ?

One more strange thing I found in CentOS is there are some 'root' commands that wont work through Gnome's 'Terminal'. I have to login as root to one of the TTY, I meant ctl+alt+f* then the command will work. For example, 'lspci', 'ifup' etc... Is it a security feature in CentOS ?

Thank You.
 
Old 10-01-2006, 07:07 PM   #6
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Then how do I configure suppose if I have 3 NIC's ?
Then you'd have ifcfg-eth0, ifcfg-eth1 and ifcfg-eth2 in /etc/sysconfig/network-scripts/


One more strange thing I found in CentOS is there are some 'root' commands that wont work through Gnome's 'Terminal'.
I don't use Gnome or KDE and I think it's the fact that root $PATH is different from user (UID >= 500) $PATH in that /usr/bin and /usr/sbin precede /bin and /sbin is absent from it. So if you use a full path you'd have no problem in the case of "harmless" commands like lspci. In the case of ifup and such you'll have to configure the user is allowed to use those tools with Sudo or PAM+userhelper.
 
  


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
LXer: Standardize Your UNIX Command-Line Tools LXer Syndicated Linux News 0 08-22-2006 10:54 PM
C++ Interfacing with command line tools khermans Programming 2 04-14-2005 02:00 PM
writing gui wrappers for command line tools Genjix Programming 2 01-10-2005 09:25 AM
group command line tools m2azer Linux - General 4 10-31-2004 09:37 PM
how do I set a path for my java command line tools darkone66669 Linux - Newbie 1 04-19-2004 06:28 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 07:46 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