December 5, 2013

Managing Network in RHEL 6

Tools

The simplest way to manage network settings is to use the system-config-network tool or the non-graphical variant system-config-network-tui

To start, stop, status all our network devices

$ service network [start|stop|status|restart]

Other useful tools are:

ifconfigDisplay our network settings.
pingUsed for check network connectivity
route -nDisplay routing and Gateway
tracerouteDisplay network routing to a host.
netstat -nrDisplay open ports.

Configuration

Main network configuration file is /etc/sysconfig/network-scripts/ifcfg-<name>.

Hostname

$ hostname 
tester1.example.com

Routing

Local routing for e.g. localhost, but also for static routing.

$ cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

Main routing configuration file. Any changes will be overwritten, unless disabled in above sysconfig network-scripts with PEERDNS=no.

$ cat /etc/resolv.conf 
$ Generated by NetworkManager
search example.com
nameserver 192.168.1.1

Reference

  • network-scripts: /usr/share/doc/initscripts-<version>/sysconfig.txt

No comments: