next up previous contents
Next: 9 OpenSSL Up: Redhat FAQ Previous: 7 Modem   Contents

Subsections

8 Networking

By:
Stephen Carville
Revision:
12/13/02

8.1 Redhat 7.2

Redhat 7.2 does not install linuxconf by default so you can use netconfig - a curses based tool - or do it by hand.

  1. Change to the configuration directory
    # cd /etc/sysconfig
  2. Edit the file network to add/change the GATEWAY.
    NETWORKING=yes 
    HOSTNAME=chena 
    GATEWAY=192.168.124.28
  3. Change to the network-scripts directory
    # /etc/sysconfig/network-scripts
  4. Edit the appropiate ifcfg-<interface> file. An example file:
    DEVICE=eth0 
    BOOTPROTO=static 
    BROADCAST=192.168.124.255 
    IPADDR=192.168.124.230 
    NETMASK=255.255.255.0 
    NETWORK=192.168.124.0 
    ONBOOT=yes
  5. If necessary change /etc/hosts to reflect any change in IP address
  6. If necessary, change /etc/resolv.conf to reflect any change in DNS servers.
  7. Restart the networking
    # service network restart


8.1.1 Adding a sub interface

  1. Change to /etc/sysconfig/network-scripts
    # cd /etc/sysconfig/network-scripts
  2. Copy the config for the primary the sub interface will be added to
    # cp ifcfg-eth0 ifcfg-eth0:1
  3. Change the device name, ip address, netmask, and broadcast address in the config file as required:
    DEVICE=eth0:1 
    BOOTPROTO=static 
    BROADCAST=192.168.124.255 
    IPADDR=192.168.124.236 
    NETMASK=255.255.255.0 
    NETWORK=192.168.124.0 
    ONBOOT=yes
  4. Restart the networking.
    # service network restart

8.1.1.1 Second Method (Not recommended except for testing)

  1. Use the ifconfig command to add and configure the interface. For example, to add the address 192.168.124.17/24 as the first sub-interface on eth0:
    # ifconfig eth0:1 192.168.124.17 netmask 255.255.255.0 broadcast 192.168.124.255
  2. Check your work with ifconfig
    # ifconfig eth0:1

    eth0:1
    Link encap:Ethernet HWaddr 00:E0:98:8F:29:7D  
    inet addr:192.168.124.231 Bcast:192.168.124.255 Mask:255.255.255.0  
    UP BROADCAST NOTRAILERS RUNNING MTU:1500 Metric:1
  3. If this needs to be permanent, add the ifconfig command to the end of /etc/rc.d/rc.local.

8.1.2 Static Routes

Each line in /etc/sysconfig/static-routes defines a route

  1. To set a route for all interfaces: 
    any net <network> netmask <mask> gw <gateway>
  2. To set a route for a specific interface:
    eth0 net <network> netmask <mask> gw <gateway>

8.2 Redhat 7.0

If networking was not set up during install or needs to be changed, use Linuxconf to set basic system values. Become root and start linuxconf from a tty in text mode

#linuxconf -text

  1. Config->Networking->Client Tasks->Basic Host Information

    1. Set Hostname + domain. Usually only the host name is needed here
    2. Scroll down to the appropiate Adapter Number. Usually Adapter 1
    3. Check Enabled.
    4. Check Manual.
    5. Enter the IP Address
    6. Enter the Netmask
    7. Accept the changes
  2. Config->Networking->Client Tasks->Nameserver Specification

    1. Select DNS is required for normal operation.
    2. Enter the Default Domain.
    3. Enter IP of Nameservers
    4. Accept the changes
  3. Config->Networking->Client Tasks->Routing and Gateways-<Set Defaults

    1. Set the default gateway
    2. Do not enable routing.
    3. Accept the changes
  4. Quit from Linuxconf. It is not necessary to activate the changes
  5. Restart the networking - Linuxconf does not always do this correctly
    # /etc/rc.d/init.d/network restart


next up previous contents
Next: 9 OpenSSL Up: Redhat FAQ Previous: 7 Modem   Contents
2005-03-20