configuring tcp/ip
in redhat linux
Logged in as root
you can run the Network Configuration tool. # netconfig
It is a text based wizard style interface, It's pretty easy so there is
no explanation given here. Alternativly, you can manually edit several
configuration files and learn something while your at it. I like the second
choice myself. Here is a list of files that make up your TCP/IP networking
component on a RedHat 6.x through 7.x box.
/etc/hosts
< info about your machine goes here
/etc/resolv.conf < dns servers go here
/etc/sysconfig/network < hostname and gateway info goes here
/etc/sysconfig/network-scripts/ifcfg-eth0 < setup info for your
ethernet card goes here
The example below
is suggesting that your machine is on the 155.99.235 network, substitute
these numbers for the actual ip addresses that you would be using. Here
are details on each file:
/etc/hosts
127.0.0.1 localhost.localdomain
localhost
155.99.235.14 some.name.com
If you look at the file contents it should be pretty self explanitory.
127.0.0.1 is an ip address that is used internally, usually refered to
as localhost. Following along on line 1, the rest of the info is for internally
referenced traffic. The second line is for the actual ip address of the
machine and the actual hostname.
/etc/resolv.conf
search name.com
nameserver 155.99.235.1
nameserver 155.99.235.2
The first line is actually not needed. It is self defined, search name.com
if name.com was the actual domain that your Linux box is residing on.
The second and third lines specify the nameservers to use for DNS lookups.
(DNS Servers)
/etc/sysconfig/network
NETWORKING=yes
HOSTNAME=server.example.com
GATEWAY=155.99.235.10
I will not explain this one as it appears pretty self labeled.
/etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=static
BROADCAST=155.99.235.255
IPADDR=155.99.235.14
NETMASK=255.255.255.0
NETWORK=155.99.235.0
ONBOOT=yes
This is the configuration for your network card. The first ethernet card
in a Linux box is "eth0" thus the first line. BOOTPROTO= could
be static, or dhcp, BROADCAST - NETWORK seems pretty obvious, and ONBOOT=yes
means start up TCP/IP automatically when the machine boots.
related topics
binding multiple ip addresses to
one nic

|