RedHat Networking
<p>
This section discusses connecting a Linux system to a
network and/or the Internet.
</p><ul>
<li><a href“#netconfig”>Configuring the network settings the easy way</a>
</li><li><a href
“#setup”>Setting your hostname, IP address, netmask, gateway, DNS server via files</a>
</li><li><a href“#ifconfig”>Using ifconfig and route</a>
</li><li><a href
“#trouble”>Troubleshooting</a>
</li></ul>
<hr>
<a name“netconfig”></a>
<h3>Configuring the network settings the easy way</h3>
Configuring your network is very easy with Red Hat Linux and
much of it (if not all of it) is done when you install Linux.
<p>
You can change the network configuration by clicking
on the Red Hat in the bottom left corner of your screen,
then System Settings–>Network. You will be guided
through the steps to configuring your network.
<a href
“http://www.redhat.com/docs/manuals/linux/RHL-9-Manual/custom-guide/ch-network-config.html” target“_blank”>The process id described here</a> and an
example is shown next:
</p><p>
</p><center>
<img src
“images/network.png” alt“linux network configuration”>
</center>
<hr>
<a name
“setup”>
</a><h3><a name“setup”>Setting your hostname, IP address, netmask, gateway, DNS
server via files</a></h3>
<a name
“setup”>It is sometimes helpful to know what is going on behind the scenes
or if you want to modify the network configuration via changing
files.
</a><p>
<a name“setup”>For example, assume you want to modify the network configuration
by modifying files with the following:
</a></p><ul>
<li><a name
“setup”>hostname: summer
</a></li><li><a name“setup”>domainname: acme.com
</a></li><li><a name
“setup”>Static IP address: 192.168.12.21
</a></li><li><a name“setup”>Netmask: 255.255.255.0
</a></li><li><a name
“setup”>Gateway: 192.168.12.254
</a></li><li><a name“setup”>Primary DNS server: 192.168.12.21
</a></li><li><a name
“setup”>Secondary DNS server: 192.168.12.23
</a></li></ul>
<a name“setup”>Networking is set up in 4 files:
</a><ul>
<li><a name
“setup”>/etc/sysconfig/network
</a></li><li><a name“setup”>/etc/sysconfig/network-scripts/ifcfg-eth0
</a></li><li><a name
“setup”>/etc/resolv.conf
</a></li></ul>
<a name“setup”>First, add your host to the /etc/hosts file:
</a><div class
“example”>
<a name''"setup"># The next line "127.0.0.1" is needed. Do not remove it. 127.0.0.1 localhost.localdomain localhost **192.168.12.21 summer** </a>
</div>
<a name“setup”>Your /etc/sysconfig/network file would be:
</a><div class
“examplebold”>
<a name''"setup">NETWORKING''yes HOSTNAME''summer GATEWAY''192.168.12.254 </a>
</div>
<a name“setup”>Your /etc/sysconfig/network-scripts/ifcfg-eth0:
</a><div class
“examplebold”>
<a name''"setup">DEVICE''eth0 BOOTPROTO''static BROADCAST''192.168.12.255 IPADDR''192.168.12.21 NETMASK''255.255.255.0 NETWORK''192.168.12.0 ONBOOT''yes </a>
</div>
<a name“setup”>DNS servers are set in: /etc/resolv.conf. An example:
</a><div class
“examplebold”>
<a name''"setup">domain //acme.com// search //acme.com// nameserver //192.168.12.21// nameserver //192.168.12.23// </a>
</div>
<hr>
<a name“ifconfig”></a>
<h3>Using ifconfig and route</h3>
You normally would not need to use ifconfig or
route unless you
want to change your IP address, disable the Ethernet interface, etc.
change your gateway, etc.
This is sometimes helpful, so the information is here.
To set an ip address:
<div class
“examplebold”>
ifconfig eth0 192.168.12.56 netmask 255.255.255.0 up
</div>
<p>
To set a default route or gateway (“gw” “gateway”):
</p><div class
“examplebold”>
route add default gw 192.168.12.1 eth0
</div>
<hr>
<a name“trouble”></a>
<h3>Troubleshooting</h3>
If your system is saying there is no Ethernet card found,
make sure the card is in the kernel.
<p>
Type:
</p><div class
“example”>
**modprobe eth0 dmesg | less **//Look for any info about eth0 to help track down the problem. //** cat /etc/modules.conf** //Look for a line line this:// **alias eth0 driver-name-like-wdi** or **3c503**
</div>
– Main.FredPettis - 2010-06-24