LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Red Hat (https://www.linuxquestions.org/questions/red-hat-31/)
-   -   Command line/tools in CentOS/RHEL ? (https://www.linuxquestions.org/questions/red-hat-31/command-line-tools-in-centos-rhel-488203/)

tuxuser19 09-30-2006 04:00 AM

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.

MensaWater 09-30-2006 08:03 AM

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=00:D0: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.

unSpawn 09-30-2006 08:15 AM

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.

tuxuser19 09-30-2006 09:30 AM

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.

tuxuser19 10-01-2006 06:28 PM

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.

unSpawn 10-01-2006 07:07 PM

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.


All times are GMT -5. The time now is 05:19 AM.