Next: 9 OpenSSL
Up: Redhat FAQ
Previous: 7 Modem
Contents
Subsections
- By:
- Stephen Carville
- Revision:
- 12/13/02
Redhat 7.2 does not install linuxconf by default so you can use netconfig
- a curses based tool - or do it by hand.
- Change to the configuration directory
# cd /etc/sysconfig
- Edit the file network to add/change the GATEWAY.
NETWORKING=yes
HOSTNAME=chena
GATEWAY=192.168.124.28
- Change to the network-scripts directory
# /etc/sysconfig/network-scripts
- 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
- If necessary change /etc/hosts to reflect any change in IP
address
- If necessary, change /etc/resolv.conf to reflect any change
in DNS servers.
- Restart the networking
# service network restart
8.1.1 Adding a sub interface
- Change to /etc/sysconfig/network-scripts
# cd /etc/sysconfig/network-scripts
- Copy the config for the primary the sub interface will be added to
# cp ifcfg-eth0 ifcfg-eth0:1
- 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
- Restart the networking.
# service network restart
- 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
- 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
- If this needs to be permanent, add the ifconfig command to
the end of /etc/rc.d/rc.local.
Each line in /etc/sysconfig/static-routes defines a route
- To set a route for all interfaces:
any net <network> netmask <mask> gw <gateway>
- To set a route for a specific interface:
eth0 net <network> netmask <mask> gw <gateway>
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
- Config->Networking->Client Tasks->Basic Host Information
- Set Hostname + domain. Usually only the host name is needed here
- Scroll down to the appropiate Adapter Number. Usually Adapter 1
- Check Enabled.
- Check Manual.
- Enter the IP Address
- Enter the Netmask
- Accept the changes
- Config->Networking->Client Tasks->Nameserver Specification
- Select DNS is required for normal operation.
- Enter the Default Domain.
- Enter IP of Nameservers
- Accept the changes
- Config->Networking->Client Tasks->Routing and Gateways-<Set Defaults
- Set the default gateway
- Do not enable routing.
- Accept the changes
- Quit from Linuxconf. It is not necessary to activate the changes
- Restart the networking - Linuxconf does not always do this correctly
# /etc/rc.d/init.d/network restart
Next: 9 OpenSSL
Up: Redhat FAQ
Previous: 7 Modem
Contents
2005-03-20