[CCP14 Home: (Frames | No Frames)]
CCP14 Mirrors: [UK] | [CA] | [US] | [AU]

(This Webpage Page in No Frames Mode)

Collaborative Computational Project Number 14

for Single Crystal and Powder Diffraction

CCP14

Moving IP addresses and services to a redundant secondary internet server under Linux

The CCP14 Homepage is at http://www.ccp14.ac.uk

[Back to CCP14 Web/Config Main Page] | [Setting up Virtual IP Addresses in Linux]

Under Development

Why note this info down

(Many internet HOW-To's on this subject are not applicable to Redhat 7.3 in using the route command)

The aim here is to have two cheap (but powerful) PC based servers. The first PC is the primary server and the second is the backup server (on the same IP network) that becomes live via running scripts if the primary server starts giving problems. The secondary mirrors the primary at regular intervals throughout the day using rsync.

If the primary server plays up or suffers a hardware fault:

  1. crontab file is disabled on the primary server
  2. The internet deamons are disabled on the primary server
  3. The the Virtual IP addresses disabled on the system
  4. The Virtual IP addresses are enabled on the secondary server
  5. Deamons are started on the secondary server which then becomes "live"
  6. crontab file is enabled on the secondary so it starts doing all the automatic mirroring and the automatic CCP14 website housekeeping.

Using a script on each server, this should take less than 30 seconds to swap over from primary to secondary server. The advantage of using Virtual IP addresses is that the network card can still be running on both servers on their base addresses without conflicting with each other.

While it is possible to automate this via "high availability linux" software, this is initially being done manually under the concept of KISS (Keep It Simple Stupid) and to allow the servers to be located in different parts of the building under different power supplies.


If you cannot connect to IP addresses after you transfer them

(Summary: some systems and routers seem to be stubbornly holding onto the old IP-MAC address combination in the arp caches. This issue has not been 100% resolved yet and could be due to nuances with the Birkbeck College routers (as some internal computers see the changes immediately - but not external - and/or it could be related to recent kernel upgrades that affect the ethernet drivers). Swapping from mill2/hume2 to mill/hume seems to go OK - but not going visa-versa if mill/hume and been "ccp14live" for quite a while.)

Note that if some IP addresses are slow to allow connections on the ccp14live machine. Go into arp on the ccp14dead machine and check if it might be stubbornly holding onto some of the IP addresses in the arp cache.

arp -e

Use the various arp commands to delete any offfending IP addresses. When this is done (a reboot of the ccp14dead machine may be required?), then the ccp14live machine should then be able to take connections on the offending IP address.

e.g,:

arp -e

[ccp14@mill bin]# arp -e
Address                  HWtype  HWaddress           Flags Mask            Iface
carna.cryst.bbk.ac.uk    ether   00:90:27:77:76:BC   C                     eth0
dldata.cryst.bbk.ac.uk   ether   00:01:03:41:16:49   C                     eth0
ftp.ccp14.cryst.bbk.ac.  ether   00:01:03:41:16:45   C                     eth1
redhat.ccp14.cryst.bbk.  ether   00:01:03:41:16:45   C                     eth1
debian.ccp14.cryst.bbk.  ether   00:01:03:41:16:45   C                     eth1
freebsd.ccp14.cryst.bbk  ether   00:01:03:41:16:45   C                     eth1
cerebus.ccp14.cryst.bbk  ether   00:01:03:41:16:45   C                     eth1
ccp14dev.ccp14.cryst.bb  ether   00:01:03:41:16:45   C                     eth1
popper.cryst.bbk.ac.uk   ether   00:02:B3:60:09:53   C                     eth0
ns-l1.cryst.bbk.ac.uk    ether   08:00:2B:86:29:38   C                     eth0

Then something like:

arp --delete dldata.cryst.bbk.ac.uk
ping  -vc1 -w 2 dldata.cryst.bbk.ac.uk

arp --delete debian.ccp14.ac.uk
ping  -vc1 -w 2 debian.ccp14.ac.uk
arp --delete debian.ccp14.cryst.bbk.ac.uk
ping  -vc1 -w 2 debian.ccp14.cryst.bbk.ac.uk

arp --delete ftp.ccp14.ac.uk
ping  -vc1 -w 2  ftp.ccp14.ac.uk
arp --delete ftp.ccp14.cryst.bbk.ac.uk
ping  -vc1 -w 2  ftp.ccp14.cryst.bbk.ac.uk

arp --delete redhat.ccp14.ac.uk
ping  -vc1 -w 2 redhat.ccp14.ac.uk
arp --delete redhat.ccp14.cryst.bbk.ac.uk
ping  -vc1 -w 2 redhat.ccp14.cryst.bbk.ac.uk

arp --delete freebsd.ccp14.ac.uk
ping  -vc1 -w 2 freebsd.ccp14.ac.uk
arp --delete freebsd.ccp14.cryst.bbk.ac.uk
ping  -vc1 -w 2 freebsd.ccp14.cryst.bbk.ac.uk

arp --delete cerebus.ccp14.ac.uk
ping  -vc1 -w 2 cerebus.ccp14.ac.uk
arp --delete cerebus.ccp14.cryst.bbk.ac.uk
ping  -vc1 -w 2 cerebus.ccp14.cryst.bbk.ac.uk

arp --delete ccp14dev.ccp14.ac.uk
ping  -vc1 -w 2 ccp14dev.ccp14.ac.uk
arp --delete ccp14dev.ccp14.cryst.bbk.ac.uk
ping  -vc1 -w 2 ccp14dev.ccp14.cryst.bbk.ac.uk

or:

arp --delete dldata.cryst.bbk.ac.uk

arp --delete debian.ccp14.ac.uk
arp --delete debian.ccp14.cryst.bbk.ac.uk

arp --delete ftp.ccp14.ac.uk
arp --delete ftp.ccp14.cryst.bbk.ac.uk

arp --delete redhat.ccp14.ac.uk
arp --delete redhat.ccp14.cryst.bbk.ac.uk

arp --delete freebsd.ccp14.ac.uk
arp --delete freebsd.ccp14.cryst.bbk.ac.uk

arp --delete cerebus.ccp14.ac.uk
arp --delete cerebus.ccp14.cryst.bbk.ac.uk

arp --delete ccp14dev.ccp14.ac.uk
arp --delete ccp14dev.ccp14.cryst.bbk.ac.uk


While not recommended, it is possible to manually (and permanently) add the address and MAC into the arp cache:

e.g., on mill2/hume2:

arp -H ether -i eth1 --set ftp.ccp14.cryst.bbk.ac.uk 00:01:03:41:16:45
arp -H ether -i eth1 --set  ccp14dev.ccp14.cryst.bbk.ac.uk 00:01:03:41:16:45
arp -H ether -i eth1 --set  cerebus.ccp14.cryst.bbk.ac.uk 00:01:03:41:16:45


/etc/rc.d/rc.ccp14live (copied to /etc/rc.d/rc.local) startup script that sets Virtual IP addresses and runs the deamons at boot time

#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local

#--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
#--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+

#Start sshd secureshell deamon

echo "Starting sshd secureshell deamon - startup in /etc/rc.d/rc.local"

/usr/local/sbin/sshd

#--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
#--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+

#Not working on Redhat 7.3 (did on 7.2)
# Make the Atapi  CD-ROM and DVDRAM look like a SCSI Device
# so you can then write to the DVDRAM using cdrecord:
# SuSE Linux 7.0: Writing CDs with ATAPI writers
# http://sdb.suse.de/en/sdb/html/mkrapp-cdwriting-7.0.html
# Latest CDrecord with DVD support
# http://www.fokus.gmd.de/research/cc/glone/employees/joerg.schilling/private/cdrecord.html
#/sbin/modprobe ide-scsi

#--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
#--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+

ping -vc1 -w 2 193.61.35.93

     if [  $? -eq 1 ]; then
           echo "ping 193.61.35.93 dldata.cryst.bbk.ac.uk is not alive and pingable - continue with ccp14live script"
        else
           echo "warning 193.61.35.93 dldata.cryst.bbk.ac.uk is alive and pingable! - exiting ccp14live script"
             exit 127
        fi


ping -vc1 -w 2 193.61.32.164

     if [  $? -eq 1 ]; then
           echo "ping 193.61.32.164 debian.ccp14.cryst.bbk.ac.uk is not pingable - continue with ccp14live script"
        else
           echo "warning 193.61.32.164 debian.ccp14.cryst.bbk.ac.uk is alive and pingable! - exiting ccp14live script"
             exit 127
        fi

ping -vc1 -w 2 193.61.32.162

     if [  $? -eq 1 ]; then
           echo "ping 193.61.32.162 ftp.ccp14.cryst.bbk.ac.uk is not pingable - continue with ccp14live script"
        else
           echo "warning 193.61.32.162 ftp.ccp14.cryst.bbk.ac.uk is alive and pingable! - exiting ccp14live script"
             exit 127
        fi

ping -vc1 -w 2 193.61.32.163

     if [  $? -eq 1 ]; then
           echo "ping 193.61.32.163 redhat.ccp14.cryst.bbk.ac.uk is not pingable - continue with ccp14live script"
        else
           echo "warning 193.61.32.163 redhat.ccp14.cryst.bbk.ac.uk is alive and pingable! - exiting ccp14live script"
             exit 127
        fi

ping -vc1 -w 2 193.61.32.165

     if [  $? -eq 1 ]; then
           echo "ping 193.61.32.165 freebsd.ccp14.cryst.bbk.ac.uk is not pingable - continue with ccp14live script"
        else
           echo "warning 193.61.32.165 freebsd.ccp14.cryst.bbk.ac.uk is alive and pingable! - exiting ccp14live script"
             exit 127
        fi

ping -vc1 -w 2 193.61.32.166

     if [  $? -eq 1 ]; then
           echo "ping 193.61.32.166 cerebus.ccp14.cryst.bbk.ac.uk is not pingable - continue with ccp14live script"
        else
           echo "warning 193.61.32.166 cerebus.ccp14.cryst.bbk.ac.uk is alive and pingable! - exiting ccp14live script"
             exit 127
        fi

ping -vc1 -w 2 193.61.32.167

     if [  $? -eq 1 ]; then
           echo "ping 193.61.32.167 ccp14dev.ccp14.cryst.bbk.ac.uk is not pingable - continue with ccp14live script"
        else
           echo "warning 193.61.32.167 ccp14dev.ccp14.cryst.bbk.ac.uk is alive and pingable! - exiting ccp14live script"
             exit 127
        fi

#setting up IP alias interfaces

echo "Setting up IP Aliases - script in /etc/rc.d/rc.local"

echo "Internal network aliases"

#mill.cryst.bbk.ac.uk is eth0 (Internal network)
#dldata.cryst.bbk.ac.uk
echo "Setting dldata.cryst.bbk.ac.uk 193.61.35.93 IP Aliases internal network"
/sbin/ifconfig eth0:1 193.61.35.93  netmask 255.255.254.0
# /sbin/route add -host 193.61.35.93  dev eth0:1

echo "Ping the gateways and DNS once to clear the ARP cache"

sleep 1

ping -vc1 -w 3 -I 193.61.35.93 193.61.34.245
ping -vc1 -w 3 -I 193.61.35.93 193.61.32.245
ping -vc1 -w 3 -I 193.61.35.93 193.61.34.17
ping -vc1 -w 3 -I 193.61.35.93 193.61.35.38

echo "Ping the internal and external broadcast address once to clear the ARP cache"

sleep 1

ping -vc1 -b -w 3 -I 193.61.35.93 193.61.35.255
ping -vc1 -b -w 3 -I 193.61.35.93 193.61.32.255

sleep 1

#debian.ccp14.cryst.bbk.ac.uk
#This is the important one that all the web virtual addresses use
echo "Setting debian.ccp14.cryst.bbk.ac.uk 193.61.32.164 IP Aliases"
echo "This is the important one that all the web virtual addresses use"
/sbin/ifconfig eth1:1 193.61.32.164
# /sbin/route add -host 193.61.32.164  dev eth1:1

echo "Ping the gateways and DNS once to clear the ARP cache"

sleep 1

ping -vc1 -w 3 -I 193.61.32.164 193.61.34.245
ping -vc1 -w 3 -I 193.61.32.164 193.61.32.245
ping -vc1 -w 3 -I 193.61.32.164 193.61.34.17
ping -vc1 -w 3 -I 193.61.32.164 193.61.35.38

echo "Ping the internal and external broadcast address once to clear the ARP cache"

sleep 1

ping -vc1 -b -w 3 -I 193.61.32.164 193.61.35.255
ping -vc1 -b -w 3 -I 193.61.32.164 193.61.32.255

sleep 1


#hume.cryst.bbk.ac.uk is eth1 (external network)
#ftp.ccp14.cryst.bbk.ac.uk
echo "Setting ftp.ccp14.cryst.bbk.ac.uk 193.61.32.162 IP Aliases"
/sbin/ifconfig eth1:2 193.61.32.162
# /sbin/route add -host 193.61.32.162  dev eth1:2

echo "Ping the gateways and DNS once to clear the ARP cache"

sleep 1

ping -vc1 -w 3 -I 193.61.32.162 193.61.34.245
ping -vc1 -w 3 -I 193.61.32.162 193.61.32.245
ping -vc1 -w 3 -I 193.61.32.162 193.61.34.17
ping -vc1 -w 3 -I 193.61.32.162 193.61.35.38

echo "Ping the internal and external broadcast address once to clear the ARP cache"

sleep 1

ping -vc1 -b -w 3 -I 193.61.32.162 193.61.35.255
ping -vc1 -b -w 3 -I 193.61.32.162 193.61.32.255

sleep 1

#redhat.ccp14.cryst.bbk.ac.uk
echo "Setting redhat.ccp14.cryst.bbk.ac.uk 193.61.32.163 IP Aliases"
/sbin/ifconfig eth1:3 193.61.32.163
# /sbin/route add -host 193.61.32.163  dev eth1:3

echo "Ping the gateways and DNS once to clear the ARP cache"

sleep 1

ping -vc1 -w 3 -I 193.61.32.163 193.61.34.245
ping -vc1 -w 3 -I 193.61.32.163 193.61.32.245
ping -vc1 -w 3 -I 193.61.32.163 193.61.34.17
ping -vc1 -w 3 -I 193.61.32.163 193.61.35.38

echo "Ping the internal and external broadcast address once to clear the ARP cache"

sleep 1

ping -vc1 -b -w 3 -I 193.61.32.163 193.61.35.255
ping -vc1 -b -w 3 -I 193.61.32.163 193.61.32.255

sleep 1

#freebsd.ccp14.cryst.bbk.ac.uk
echo "Setting freebsd.ccp14.cryst.bbk.ac.uk 193.61.32.165 IP Aliases"
/sbin/ifconfig eth1:4 193.61.32.165
# /sbin/route add -host 193.61.32.165  dev eth1:4

echo "Ping the gateways and DNS once to clear the ARP cache"

sleep 1

ping -vc1 -w 3 -I 193.61.32.165 193.61.34.245
ping -vc1 -w 3 -I 193.61.32.165 193.61.32.245
ping -vc1 -w 3 -I 193.61.32.165 193.61.34.17
ping -vc1 -w 3 -I 193.61.32.165 193.61.35.38

echo "Ping the internal and external broadcast address once to clear the ARP cache"

sleep 1

ping -vc1 -b -w 3 -I 193.61.32.165 193.61.35.255
ping -vc1 -b -w 3 -I 193.61.32.165 193.61.32.255

sleep 1

#cerebus.ccp14.cryst.bbk.ac.uk
echo "Setting cerebus.ccp14.cryst.bbk.ac.uk 193.61.32.166 IP Aliases"
/sbin/ifconfig eth1:5 193.61.32.166
# /sbin/route add -host 193.61.32.166  dev eth1:5

echo "Ping the gateways and DNS once to clear the ARP cache"

sleep 1

ping -vc1 -w 3 -I 193.61.32.166 193.61.34.245
ping -vc1 -w 3 -I 193.61.32.166 193.61.32.245
ping -vc1 -w 3 -I 193.61.32.166 193.61.34.17
ping -vc1 -w 3 -I 193.61.32.166 193.61.35.38

echo "Ping the internal and external broadcast address once to clear the ARP cache"

sleep 1

ping -vc1 -b -w 3 -I 193.61.32.166 193.61.35.255
ping -vc1 -b -w 3 -I 193.61.32.166 193.61.32.255

sleep 1

#ccp14dev.ccp14.cryst.bbk.ac.uk
echo "Setting ccp14dev.ccp14.cryst.bbk.ac.uk 193.61.32.167 IP Aliases"
/sbin/ifconfig eth1:6 193.61.32.167
# /sbin/route add -host 193.61.32.167  dev eth1:6

echo "Ping the gateways and DNS once to clear the ARP cache"

sleep 1

ping -vc1 -w 3 -I 193.61.32.167 193.61.34.245
ping -vc1 -w 3 -I 193.61.32.167 193.61.32.245
ping -vc1 -w 3 -I 193.61.32.167 193.61.34.17
ping -vc1 -w 3 -I 193.61.32.167 193.61.35.38

echo "Ping the internal and external broadcast address once to clear the ARP cache"

sleep 1

ping -vc1 -b -w 3 -I 193.61.32.167 193.61.35.255
ping -vc1 -b -w 3 -I 193.61.32.167 193.61.32.255

sleep 1

#--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
#--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+

#Start samba smbd nmbd

echo "Starting samba smbd nmbd deamon - startup in /etc/rc.d/rc.local"
echo "config file for samba in /usr/local/samba/lib/"

/usr/local/samba/bin/smbd -D
/usr/local/samba/bin/nmbd -D

#--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
#--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+

#Start Apache 2 webserver

echo "Starting apache webserver - startup in /etc/rc.d/rc.local"

/usr/local/apache2/bin/apachectl  start


#--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
#--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+

#Start Proftpd ftp server ftp deamon

echo "Starting apache webserver - startup in /etc/rc.d/rc.local"

/usr/local/sbin/proftpd

#--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
#--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+

#Start rsync server deamon

echo "Starting rsync server deamon - startup in /etc/rc.d/rc.local"

/usr/local/bin/rsync --daemon

/usr/local/bin/ccp14dead - Script for killing the internet deamons and IP addresses in Runtime

#!/bin/sh

    if [ "`whoami`" != "root" ]; then
                     echo "This script can only run for the root user"
                      exit 127
              else
                    echo "You are running as root, thus this script can continue"
              fi


 if [ "`ifconfig | grep eth0:1`"  = ""  ]; then
       echo "can't kill eth0:1 as it is not up - thus exit or problems will happen"
       exit 127
    else
       echo "eth0:1 is already up - continuing to run the ccp14dead script"
    fi

 if [ "`ifconfig | grep eth1:1`"  = ""  ]; then
       echo "can't kill eth1:1 as it is not up - thus exit or problems will happen"
       exit 127
    else
       echo "eth1:1 is already up - continuing to run the ccp14dead script"
    fi

 if [ "`ifconfig | grep eth1:2`"  = ""  ]; then
       echo "can't kill eth1:2 as it is not up - thus exit or problems will happen"
       exit 127
    else
       echo "eth1:2 is already up - continuing to run the ccp14dead script"
    fi

 if [ "`ifconfig | grep eth1:3`"  = ""  ]; then
       echo "can't kill eth1:3 as it is not up - thus exit or problems will happen"
       exit 127
    else
       echo "eth1:3 is already up - continuing to run the ccp14dead script"
    fi

 if [ "`ifconfig | grep eth1:4`"  = ""  ]; then
       echo "can't kill eth1:4 as it is not up - thus exit or problems will happen"
       exit 127
    else
       echo "eth1:4 is already up - continuing to run the ccp14dead script"
    fi

 if [ "`ifconfig | grep eth1:5`"  = ""  ]; then
       echo "can't kill eth1:5 as it is not up - thus exit or problems will happen"
       exit 127
    else
       echo "eth1:5 is already up - continuing to run the ccp14dead script"
    fi

 if [ "`ifconfig | grep eth1:6`"  = ""  ]; then
       echo "can't kill eth1:6 as it is not up - thus exit or problems will happen"
       exit 127
    else
       echo "eth1:6 is already up - continuing to run the ccp14dead script"
    fi


# Keep sshd secure shell going as it is not connected to any
# virtual IP addresses - only base IP addresses for the internet
# cards - check internel card

# Kill Samba
killall -9 smbd
killall -9 nmbd

# Kill Apache
/usr/local/apache2/bin/apachectl  stop

# Kill proftpd ftp deamon
killall -9 proftpd

# Kill rsync deamon
killall -9 rsync

echo "Sleep for 2 seconds"

sleep 2

echo "Killing Enternal network aliases and virtual IP addresses"

#ccp14dev.ccp14.cryst.bbk.ac.uk
# echo "Setting ccp14dev.ccp14.cryst.bbk.ac.uk 193.61.32.167 IP Aliases"
# /sbin/ifconfig eth1:6 193.61.32.167
# /sbin/route add -host 193.61.32.167  dev eth1:6
#
#delete route and IP for ccp14dev.ccp14.cryst.bbk.ac.uk 193.61.32.167
# /sbin/route del -host 193.61.32.167 dev eth1:6
/sbin/ifconfig eth1:6 del  193.61.32.167

#cerebus.ccp14.cryst.bbk.ac.uk
# echo "Setting cerebus.ccp14.cryst.bbk.ac.uk 193.61.32.166 IP Aliases"
# /sbin/ifconfig eth1:5 193.61.32.166
# /sbin/route add -host 193.61.32.166  dev eth1:5
#
#delete route and IP for cerebus.ccp14.cryst.bbk.ac.uk 193.61.32.166
# /sbin/route del -host 193.61.32.166 dev eth1:5
/sbin/ifconfig eth1:5 del  193.61.32.166

#freebsd.ccp14.cryst.bbk.ac.uk
# echo "Setting freebsd.ccp14.cryst.bbk.ac.uk 193.61.32.165 IP Aliases"
# /sbin/ifconfig eth1:4 193.61.32.165
# /sbin/route add -host 193.61.32.165  dev eth1:4
#
#delete route and IP for freebsd.ccp14.cryst.bbk.ac.uk 193.61.32.165
# /sbin/route del -host 193.61.32.165 dev eth1:4
/sbin/ifconfig eth1:4 del  193.61.32.165

#redhat.ccp14.cryst.bbk.ac.uk
# echo "Setting redhat.ccp14.cryst.bbk.ac.uk 193.61.32.163 IP Aliases"
# /sbin/ifconfig eth1:3 193.61.32.163
# /sbin/route add -host 193.61.32.163  dev eth1:2
#
#delete route and IP for redhat.ccp14.cryst.bbk.ac.uk 193.61.32.163
# /sbin/route del -host 193.61.32.163 dev eth1:3
/sbin/ifconfig eth1:3 del  193.61.32.163

#ftp.ccp14.cryst.bbk.ac.uk
# echo "Setting ftp.ccp14.cryst.bbk.ac.uk 193.61.32.162 IP Aliases"
# /sbin/ifconfig eth1:2 193.61.32.162
# /sbin/route add -host 193.61.32.162  dev eth1:1
#
#delete route and IP for ftp.ccp14.cryst.bbk.ac.uk 193.61.32.162
# /sbin/route del -host 193.61.32.162 dev eth1:2
/sbin/ifconfig eth1:2 del  193.61.32.162

#debian.ccp14.cryst.bbk.ac.uk
#This is the important one that all the main web virtual addresses use
# echo "Setting debian.ccp14.cryst.bbk.ac.uk 193.61.32.164 IP Aliases"
# echo "This is the important one that all the web virtual addresses use"
# /sbin/ifconfig eth1:1 193.61.32.164
# /sbin/route add -host 193.61.32.164  dev eth1:1
#
#delete route and IP for debian.ccp14.cryst.bbk.ac.uk 193.61.32.164
# /sbin/route del -host 193.61.32.164 dev eth1:1
/sbin/ifconfig eth1:1 del  193.61.32.164

echo "Internal network aliases"

#mill.cryst.bbk.ac.uk is eth0 (Internal network)
#dldata.cryst.bbk.ac.uk
# echo "Setting dldata.cryst.bbk.ac.uk 193.61.35.93 IP Aliases internal network"
# /sbin/ifconfig eth0:1 193.61.35.93
# /sbin/route add -host 193.61.35.93  dev eth0:1
#
#delete route and IP for dldata.cryst.bbk.ac.uk 193.61.35.93
# /sbin/route del -host 193.61.35.93 dev eth0:1
/sbin/ifconfig eth0:1 del  193.61.35.93


echo "Done - deamons killed (except sshd) and virtual IPs cancelled"

#--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
#--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+

# copy ccp14dead  crontab and startup files to where they have to be

/bin/cp /etc/rc.d/rc.ccp14dead /etc/rc.d/rc.local

echo "Done - copied /etc/rc.d  rc.ccp14dead to rc.local"

/bin/cp ~root/.crontabccp14dead /var/spool/cron/root

echo "Copied root crontab file ~root/.crontabccp14dead to /var/spool/cron/root"

/bin/cp ~ccp14/.crontabccp14mirrordead /var/spool/cron/ccp14

echo "Copied ccp14 crontab file ~ccp14/.crontabccp14mirrordead to /var/spool/cron/ccp14"

# =======================================================
# =======================================================

echo "Do some arp stuff to make sure arp cache is reset - due to previous problems"

arp --delete dldata.cryst.bbk.ac.uk

arp --delete debian.ccp14.ac.uk
arp --delete debian.ccp14.cryst.bbk.ac.uk

arp --delete ftp.ccp14.ac.uk
arp --delete ftp.ccp14.cryst.bbk.ac.uk

arp --delete redhat.ccp14.ac.uk
arp --delete redhat.ccp14.cryst.bbk.ac.uk

arp --delete freebsd.ccp14.ac.uk
arp --delete freebsd.ccp14.cryst.bbk.ac.uk

arp --delete cerebus.ccp14.ac.uk
arp --delete cerebus.ccp14.cryst.bbk.ac.uk

arp --delete ccp14dev.ccp14.ac.uk
arp --delete ccp14dev.ccp14.cryst.bbk.ac.uk

echo "Have run the arp clear commands"

/usr/local/bin/ccp14live - script for making CCP14live in Runtime

#!/bin/sh
#
    if [ "`whoami`" != "root" ]; then
                     echo "This script can only run for the root user"
                      exit 127
              else
                    echo "You are running as root, thus this script can continue"
              fi


     if [ "`ifconfig | grep eth0:1`"  = ""  ]; then
           echo "eth0:1 is not up"
        else
           echo "eth0:1 is already up - exiting as ccp14 is already alive on this machine"
             exit 127
         fi

     if [ "`ifconfig | grep eth1:1`"  = ""  ]; then
           echo "eth1:1 is not up"
        else
           echo "eth1:1 is already up - exiting as ccp14 is already alive on this machine"
             exit 127
         fi

     if [ "`ifconfig | grep eth1:2`"  = ""  ]; then
           echo "eth1:2 is not up"
        else
           echo "eth1:2 is already up - exiting as ccp14 is already alive on this machine"
             exit 127
         fi

     if [ "`ifconfig | grep eth1:3`"  = ""  ]; then
           echo "eth1:3 is not up"
        else
           echo "eth1:3 is already up - exiting as ccp14 is already alive on this machine"

             exit 127
         fi


     if [ "`ifconfig | grep eth1:4`"  = ""  ]; then
           echo "eth1:4 is not up"
        else
           echo "eth1:4 is already up - exiting as ccp14 is already alive on this machine"
             exit 127
         fi


     if [ "`ifconfig | grep eth1:5`"  = ""  ]; then
           echo "eth1:5 is not up"
        else
           echo "eth1:5 is already up - exiting as ccp14 is already alive on this machine"
             exit 127
         fi


     if [ "`ifconfig | grep eth1:6`"  = ""  ]; then
           echo "eth1:6 is not up"
        else
           echo "eth1:6 is already up - exiting as ccp14 is already alive on this machine"
             exit 127
         fi

sleep 1

#--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
#--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+

ping -vc1 -w 2 193.61.35.93

     if [  $? -eq 1 ]; then
           echo "ping 193.61.35.93 dldata.cryst.bbk.ac.uk is not alive and pingable - continue with ccp14live script"
        else
           echo "warning 193.61.35.93 dldata.cryst.bbk.ac.uk is alive and pingable! - exiting ccp14live script"
             exit 127
        fi


ping -vc1 -w 2 193.61.32.164

     if [  $? -eq 1 ]; then
           echo "ping 193.61.32.164 debian.ccp14.cryst.bbk.ac.uk is not pingable - continue with ccp14live script"
        else
           echo "warning 193.61.32.164 debian.ccp14.cryst.bbk.ac.uk is alive and pingable! - exiting ccp14live script"
             exit 127
        fi

ping -vc1 -w 2 193.61.32.162

     if [  $? -eq 1 ]; then
           echo "ping 193.61.32.162 ftp.ccp14.cryst.bbk.ac.uk is not pingable - continue with ccp14live script"
        else
           echo "warning 193.61.32.162 ftp.ccp14.cryst.bbk.ac.uk is alive and pingable! - exiting ccp14live script"
             exit 127
        fi

ping -vc1 -w 2 193.61.32.163

     if [  $? -eq 1 ]; then
           echo "ping 193.61.32.163 redhat.ccp14.cryst.bbk.ac.uk is not pingable - continue with ccp14live script"
        else
           echo "warning 193.61.32.163 redhat.ccp14.cryst.bbk.ac.uk is alive and pingable! - exiting ccp14live script"
             exit 127
        fi

ping -vc1 -w 2 193.61.32.165

     if [  $? -eq 1 ]; then
           echo "ping 193.61.32.165 freebsd.ccp14.cryst.bbk.ac.uk is not pingable - continue with ccp14live script"
        else
           echo "warning 193.61.32.165 freebsd.ccp14.cryst.bbk.ac.uk is alive and pingable! - exiting ccp14live script"
             exit 127
        fi

ping -vc1 -w 2 193.61.32.166

     if [  $? -eq 1 ]; then
           echo "ping 193.61.32.166 cerebus.ccp14.cryst.bbk.ac.uk is not pingable - continue with ccp14live script"
        else
           echo "warning 193.61.32.166 cerebus.ccp14.cryst.bbk.ac.uk is alive and pingable! - exiting ccp14live script"
             exit 127
        fi

ping -vc1 -w 2 193.61.32.167

     if [  $? -eq 1 ]; then
           echo "ping 193.61.32.167 ccp14dev.ccp14.cryst.bbk.ac.uk is not pingable - continue with ccp14live script"
        else
           echo "warning 193.61.32.167 ccp14dev.ccp14.cryst.bbk.ac.uk is alive and pingable! - exiting ccp14live script"
             exit 127
        fi


#--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
#--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+

#setting up IP alias interfaces


echo "Setting up IP Aliases - script in /etc/rc.d/rc.local"

echo "Internal network aliases"

#mill.cryst.bbk.ac.uk is eth0 (Internal network)
#dldata.cryst.bbk.ac.uk
echo "Setting dldata.cryst.bbk.ac.uk 193.61.35.93 IP Aliases internal network"
/sbin/ifconfig eth0:1 193.61.35.93  netmask 255.255.254.0
# /sbin/route add -host 193.61.35.93  dev eth0:1

echo "Ping the gateways and DNS once to clear the ARP cache"

sleep 1

ping -vc1 -w 3 -I 193.61.35.93 193.61.34.245
ping -vc1 -w 3 -I 193.61.35.93 193.61.32.245
ping -vc1 -w 3 -I 193.61.35.93 193.61.34.17
ping -vc1 -w 3 -I 193.61.35.93 193.61.35.38

echo "Ping the internal and external broadcast address once to clear the ARP cache"

sleep 1

ping -vc1 -b -w 3 -I 193.61.35.93 193.61.35.255
ping -vc1 -b -w 3 -I 193.61.35.93 193.61.32.255

sleep 1

#debian.ccp14.cryst.bbk.ac.uk
#This is the important one that all the web virtual addresses use
echo "Setting debian.ccp14.cryst.bbk.ac.uk 193.61.32.164 IP Aliases"
echo "This is the important one that all the web virtual addresses use"
/sbin/ifconfig eth1:1 193.61.32.164
# /sbin/route add -host 193.61.32.164  dev eth1:1

echo "Ping the gateways and DNS once to clear the ARP cache"

sleep 1

ping -vc1 -w 3 -I 193.61.32.164 193.61.34.245
ping -vc1 -w 3 -I 193.61.32.164 193.61.32.245
ping -vc1 -w 3 -I 193.61.32.164 193.61.34.17
ping -vc1 -w 3 -I 193.61.32.164 193.61.35.38

echo "Ping the internal and external broadcast address once to clear the ARP cache"

sleep 1

ping -vc1 -b -w 3 -I 193.61.32.164 193.61.35.255
ping -vc1 -b -w 3 -I 193.61.32.164 193.61.32.255

sleep 1


#hume.cryst.bbk.ac.uk is eth1 (external network)
#ftp.ccp14.cryst.bbk.ac.uk
echo "Setting ftp.ccp14.cryst.bbk.ac.uk 193.61.32.162 IP Aliases"
/sbin/ifconfig eth1:2 193.61.32.162
# /sbin/route add -host 193.61.32.162  dev eth1:2

echo "Ping the gateways and DNS once to clear the ARP cache"

sleep 1

ping -vc1 -w 3 -I 193.61.32.162 193.61.34.245
ping -vc1 -w 3 -I 193.61.32.162 193.61.32.245
ping -vc1 -w 3 -I 193.61.32.162 193.61.34.17
ping -vc1 -w 3 -I 193.61.32.162 193.61.35.38

echo "Ping the internal and external broadcast address once to clear the ARP cache"

sleep 1

ping -vc1 -b -w 3 -I 193.61.32.162 193.61.35.255
ping -vc1 -b -w 3 -I 193.61.32.162 193.61.32.255

sleep 1

#redhat.ccp14.cryst.bbk.ac.uk
echo "Setting redhat.ccp14.cryst.bbk.ac.uk 193.61.32.163 IP Aliases"
/sbin/ifconfig eth1:3 193.61.32.163
# /sbin/route add -host 193.61.32.163  dev eth1:3

echo "Ping the gateways and DNS once to clear the ARP cache"

sleep 1

ping -vc1 -w 3 -I 193.61.32.163 193.61.34.245
ping -vc1 -w 3 -I 193.61.32.163 193.61.32.245
ping -vc1 -w 3 -I 193.61.32.163 193.61.34.17
ping -vc1 -w 3 -I 193.61.32.163 193.61.35.38

echo "Ping the internal and external broadcast address once to clear the ARP cache"

sleep 1

ping -vc1 -b -w 3 -I 193.61.32.163 193.61.35.255
ping -vc1 -b -w 3 -I 193.61.32.163 193.61.32.255

sleep 1

#freebsd.ccp14.cryst.bbk.ac.uk
echo "Setting freebsd.ccp14.cryst.bbk.ac.uk 193.61.32.165 IP Aliases"
/sbin/ifconfig eth1:4 193.61.32.165
# /sbin/route add -host 193.61.32.165  dev eth1:4

echo "Ping the gateways and DNS once to clear the ARP cache"

sleep 1

ping -vc1 -w 3 -I 193.61.32.165 193.61.34.245
ping -vc1 -w 3 -I 193.61.32.165 193.61.32.245
ping -vc1 -w 3 -I 193.61.32.165 193.61.34.17
ping -vc1 -w 3 -I 193.61.32.165 193.61.35.38

echo "Ping the internal and external broadcast address once to clear the ARP cache"

sleep 1

ping -vc1 -b -w 3 -I 193.61.32.165 193.61.35.255
ping -vc1 -b -w 3 -I 193.61.32.165 193.61.32.255

sleep 1

#cerebus.ccp14.cryst.bbk.ac.uk
echo "Setting cerebus.ccp14.cryst.bbk.ac.uk 193.61.32.166 IP Aliases"
/sbin/ifconfig eth1:5 193.61.32.166
# /sbin/route add -host 193.61.32.166  dev eth1:5

echo "Ping the gateways and DNS once to clear the ARP cache"

sleep 1

ping -vc1 -w 3 -I 193.61.32.166 193.61.34.245
ping -vc1 -w 3 -I 193.61.32.166 193.61.32.245
ping -vc1 -w 3 -I 193.61.32.166 193.61.34.17
ping -vc1 -w 3 -I 193.61.32.166 193.61.35.38

echo "Ping the internal and external broadcast address once to clear the ARP cache"

sleep 1

ping -vc1 -b -w 3 -I 193.61.32.166 193.61.35.255
ping -vc1 -b -w 3 -I 193.61.32.166 193.61.32.255

sleep 1

#ccp14dev.ccp14.cryst.bbk.ac.uk
echo "Setting ccp14dev.ccp14.cryst.bbk.ac.uk 193.61.32.167 IP Aliases"
/sbin/ifconfig eth1:6 193.61.32.167
# /sbin/route add -host 193.61.32.167  dev eth1:6

echo "Ping the gateways and DNS once to clear the ARP cache"

sleep 1

ping -vc1 -w 3 -I 193.61.32.167 193.61.34.245
ping -vc1 -w 3 -I 193.61.32.167 193.61.32.245
ping -vc1 -w 3 -I 193.61.32.167 193.61.34.17
ping -vc1 -w 3 -I 193.61.32.167 193.61.35.38

echo "Ping the internal and external broadcast address once to clear the ARP cache"

sleep 1

ping -vc1 -b -w 3 -I 193.61.32.167 193.61.35.255
ping -vc1 -b -w 3 -I 193.61.32.167 193.61.32.255

sleep 1

#--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
#--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+

#Start samba smbd nmbd

echo "Starting samba smbd nmbd deamon - startup in /etc/rc.d/rc.local"
echo "config file for samba in /usr/local/samba/lib/"

/usr/local/samba/bin/smbd -D
/usr/local/samba/bin/nmbd -D

#--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
#--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+

#Start Apache 2 webserver

echo "Starting apache webserver - startup in /etc/rc.d/rc.local"

/usr/local/apache2/bin/apachectl  start


#--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
#--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+

#Start Proftpd ftp server ftp deamon

echo "Starting apache webserver - startup in /etc/rc.d/rc.local"

/usr/local/sbin/proftpd

#--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
#--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+

#Start rsync server deamon

echo "Starting rsync server deamon - startup in /etc/rc.d/rc.local"

/usr/local/bin/rsync --daemon

echo "Started rsync server deamon - startup in /etc/rc.d/rc.local"

/bin/cp /etc/rc.d/rc.ccp14live /etc/rc.d/rc.local

echo "Done - copied /etc/rc.d  rc.ccp14dead to rc.local"

#--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
#--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+

#Be paranoid about the arp cache

echo "Be paranoid about the arp cache"

arp --delete dldata.cryst.bbk.ac.uk
ping  -vc1 -w 2 dldata.cryst.bbk.ac.uk

arp --delete debian.ccp14.ac.uk
ping  -vc1 -w 2 debian.ccp14.ac.uk
arp --delete debian.ccp14.cryst.bbk.ac.uk
ping  -vc1 -w 2 debian.ccp14.cryst.bbk.ac.uk

arp --delete ftp.ccp14.ac.uk
ping  -vc1 -w 2  ftp.ccp14.ac.uk
arp --delete ftp.ccp14.cryst.bbk.ac.uk
ping  -vc1 -w 2  ftp.ccp14.cryst.bbk.ac.uk

arp --delete redhat.ccp14.ac.uk
ping  -vc1 -w 2 redhat.ccp14.ac.uk
arp --delete redhat.ccp14.cryst.bbk.ac.uk
ping  -vc1 -w 2 redhat.ccp14.cryst.bbk.ac.uk

arp --delete freebsd.ccp14.ac.uk
ping  -vc1 -w 2 freebsd.ccp14.ac.uk
arp --delete freebsd.ccp14.cryst.bbk.ac.uk
ping  -vc1 -w 2 freebsd.ccp14.cryst.bbk.ac.uk

arp --delete cerebus.ccp14.ac.uk
ping  -vc1 -w 2 cerebus.ccp14.ac.uk
arp --delete cerebus.ccp14.cryst.bbk.ac.uk
ping  -vc1 -w 2 cerebus.ccp14.cryst.bbk.ac.uk

arp --delete ccp14dev.ccp14.ac.uk
ping  -vc1 -w 2 ccp14dev.ccp14.ac.uk
arp --delete ccp14dev.ccp14.cryst.bbk.ac.uk
ping  -vc1 -w 2 ccp14dev.ccp14.cryst.bbk.ac.uk

echo "Finished being paranoid about the arp cache"

man ifconfig - for enabled and disabling Virtual IP addresses

[root@mill rc.d]# ifconfig --help
Usage:
  ifconfig [-a] [-i] [-v] [-s] <interface> [[<AF>] <address>]
  [add <address>[/<prefixlen>]]
  [del <address>[/<prefixlen>]]
  [[-]broadcast [<address>]]  [[-]pointopoint [<address>]]
  [netmask <address>]  [dstaddr <address>]  [tunnel <address>]
  [outfill <NN>] [keepalive <NN>]
  [hw <HW> <address>]  [metric <NN>]  [mtu <NN>]
  [[-]trailers]  [[-]arp]  [[-]allmulti]
  [multicast]  [[-]promisc]
  [mem_start <NN>]  [io_addr <NN>]  [irq <NN>]  [media <type>]
  [txqueuelen <NN>]
  [[-]dynamic]
  [up|down] ...

IFCONFIG(8)         Linux Programmer's Manual         IFCONFIG(8)

NAME
       ifconfig - configure a network interface

SYNOPSIS
       ifconfig [interface]
       ifconfig interface [aftype] options | address ...

DESCRIPTION
       Ifconfig  is used to configure the kernel-resident network
       interfaces.  It is used at boot time to set up  interfaces
       as  necessary.  After that, it is usually only needed when
       debugging or when system tuning is needed.

       If no arguments are given, ifconfig displays the status of
       the  currently  active  interfaces.  If a single interface
       argument is given, it displays the  status  of  the  given
       interface  only; if a single -a argument is given, it dis-
       plays the status of all interfaces, even  those  that  are
       down.  Otherwise, it configures an interface.

Address Families
       If  the  first argument after the interface name is recog-
       nized as the name of  a  supported  address  family,  that
       address  family  is  used  for decoding and displaying all
       protocol addresses.  Currently supported address  families
       include  inet  (TCP/IP, default), inet6 (IPv6), ax25 (AMPR
       Packet Radio), ddp (Appletalk Phase 2), ipx  (Novell  IPX)
       and netrom (AMPR Packet radio).
       interface
              The  name  of  the  interface.   This  is usually a
              driver name followed by a unit number, for  example
              eth0 for the first Ethernet interface.

       up     This flag causes the interface to be activated.  It
              is implicitly specified if an address  is  assigned
              to the interface.

       down   This  flag  causes the driver for this interface to
              be shut down.

       [-]arp Enable or disable the use of the  ARP  protocol  on
              this interface.

       [-]promisc
              Enable  or  disable  the  promiscuous  mode  of the
              interface.  If selected, all packets on the network
              will be received by the interface.

       [-]allmulti
              Enable or disable all-multicast mode.  If selected,
              all  multicast  packets  on  the  network  will  be
              received by the interface.

       metric N
              This parameter sets the interface metric.

       mtu N  This parameter sets the Maximum Transfer Unit (MTU)
              of an interface.

       dstaddr addr
              Set the remote IP address for a point-to-point link
              (such  as  PPP).  This keyword is now obsolete; use
              the pointopoint keyword instead.

       netmask addr
              Set the IP network mask for this  interface.   This
              value defaults to the usual class A, B or C network
              mask (as derived from the  interface  IP  address),
              but it can be set to any value.

       add addr/prefixlen
              Add an IPv6 address to an interface.

       del addr/prefixlen
              Remove an IPv6 address from an interface.

       tunnel aa.bb.cc.dd
              Create  a new SIT (IPv6-in-IPv4) device, tunnelling
              to the given destination.

       irq addr
              Set the interrupt line used by  this  device.   Not
              all  devices  can dynamically change their IRQ set-
              ting.

       io_addr addr
              Set the start address in I/O space for this device.

       mem_start addr
              Set  the  start  address  for shared memory used by
              this device.  Only a few devices need this.

       media type
              Set the physical port or medium type to be used  by
              the  device.   Not all devices can change this set-
              ting, and those that can vary in what  values  they
              support.  Typical values for type are 10base2 (thin
              Ethernet), 10baseT (twisted-pair 10Mbps  Ethernet),
              AUI  (external transceiver) and so on.  The special
              medium type of auto can be used to tell the  driver
              to  auto-sense  the  media.  Again, not all drivers
              can do this.

       [-]broadcast [addr]
              If the address argument is given, set the  protocol
              broadcast  address  for this interface.  Otherwise,
              set (or  clear)  the  IFF_BROADCAST  flag  for  the
              interface.

       [-]pointopoint [addr]
              This  keyword enables the point-to-point mode of an
              interface, meaning that it is a direct link between
              two machines with nobody else listening on it.
              If the address argument is also given, set the pro-
              tocol address of the other side of the  link,  just
              like the obsolete dstaddr keyword does.  Otherwise,
              set or  clear  the  IFF_POINTOPOINT  flag  for  the
              interface.

       hw class address
              Set  the hardware address of this interface, if the
              device driver supports this operation.  The keyword
              must  be followed by the name of the hardware class
              and the printable ASCII equivalent of the  hardware
              address.    Hardware  classes  currently  supported
              include ether (Ethernet), ax25 (AMPR AX.25), ARCnet
              and netrom (AMPR NET/ROM).

       multicast
              Set  the  multicast  flag  on  the  interface. This
              should not normally be needed as  the  drivers  set
              the flag correctly themselves.

       address
              The IP address to be assigned to this interface.

       txqueuelen length
              Set the length of the transmit queue of the device.
              It is useful to set this to small values for slower
              devices  with a high latency (modem links, ISDN) to
              prevent fast bulk transfers from disturbing  inter-
              active traffic like telnet too much.

NOTES
       Since  kernel  release 2.2 there are no explicit interface
       statistics for alias interfaces  anymore.  The  statistics
       printed for the original address are shared with all alias
       addresses on the same  device.  If  you  want  per-address
       statistics  you  should  add explicit accounting rules for
       the address using the ipchains(8) command.

NOTES
       Since  kernel  release 2.2 there are no explicit interface
       statistics for alias interfaces  anymore.  The  statistics
       printed for the original address are shared with all alias
       addresses on the same  device.  If  you  want  per-address
       statistics  you  should  add explicit accounting rules for
       the address using the ipchains(8) command.

       Interrupt problems with Ethernet device drivers fail  with
       EAGAIN.   See  http://cesdis.gsfc.nasa.gov/linux/misc/irq-
       conflict.html for more information.

FILES
       /proc/net/socket
       /proc/net/dev
       /proc/net/if_inet6

BUGS
       While appletalk DDP and IPX addresses  will  be  displayed
       they cannot be altered by this command.

SEE ALSO
       route(8), netstat(8), arp(8), rarp(8), ipchains(8)

AUTHORS
       Fred N. van Kempen, [waltje@uwalt.nl.mugnet.org]
       Alan Cox, [Alan.Cox@linux.org]
       Phil Blundell, [Philip.Blundell@pobox.com]
       Andi Kleen

net-tools                 14 August 2000              IFCONFIG(8)


man route - for enabled and disabling Virtual IP addresses

[root@mill rc.d]# route --help
Usage: route [-nNvee] [-FC] [<AF>]           List kernel routing tables
       route [-v] [-FC] {add|del|flush} ...  Modify routing table for AF.

       route {-h|--help} [<AF>]              Detailed usage syntax for specified
 AF.
       route {-V|--version}                  Display version/author and exit.

        -v, --verbose            be verbose
        -n, --numeric            don't resolve names
        -e, --extend             display other/more information
        -F, --fib                display Forwarding Information Base (default)
        -C, --cache              display routing cache instead of FIB

  <AF>=Use '-A <af>' or '--<af>'; default: inet
  List of possible address families (which support routing):
    inet (DARPA Internet) inet6 (IPv6) ax25 (AMPR AX.25)
    netrom (AMPR NET/ROM) ipx (Novell IPX) ddp (Appletalk DDP)
    x25 (CCITT X.25)


ROUTE(8)            Linux Programmer's Manual            ROUTE(8)

NAME
       route - show / manipulate the IP routing table

SYNOPSIS
       route [-CFvnee]

       route  [-v]  [-A  family] add [-net|-host] target [netmask
              Nm] [gw Gw] [metric N] [mss M] [window W] [irtt  I]
              [reject] [mod] [dyn] [reinstate] [[dev] If]

       route  [-v]  [-A  family]  del [-net|-host] target [gw Gw]
              [netmask Nm] [metric N] [[dev] If]

       route  [-V] [--version] [-h] [--help]

DESCRIPTION
       Route manipulates the kernel's  IP  routing  tables.   Its
       primary  use  is to set up static routes to specific hosts
       or networks via an interface after it has been  configured
       with the ifconfig(8) program.

       When  the  add or del options are used, route modifies the
       routing tables.  Without these options, route displays the
       current contents of the routing tables.

OPTIONS
       -A family
              use  the  specified  address family (eg `inet'; use
              `route --help' for a full list).

       -F     operate on the kernel's FIB (Forwarding Information
              Base) routing table.  This is the default.

       -C     operate on the kernel's routing cache.

       -v     select verbose operation.

       -n     show  numerical  addresses  instead  of  trying  to
              determine symbolic host names. This  is  useful  if
              you  are  trying to determine why the route to your
              nameserver has vanished.

       -e     use netstat(8)-format for  displaying  the  routing
              table.  -ee will generate a very long line with all
              parameters from the routing table.

       del    delete a route.

       add    add a new route.

       target the destination network or host. You can provide IP
              addresses  in dotted decimal or host/network names.

       -net   the target is a network.

       -host  the target is a host.

       netmask NM
              when adding a network  route,  the  netmask  to  be
              used.

       gw GW  route  packets  via a gateway.  NOTE: The specified
              gateway must be reachable first. This usually means
              that you have to set up a static route to the gate-
              way beforehand. If you specify the address  of  one
              of your local interfaces, it will be used to decide
              about the interface to which the packets should  be
              routed to. This is a BSDism compatibility hack.

       metric M
              set  the metric field in the routing table (used by
              routing daemons) to M.

       mss M  set the TCP Maximum Segment Size (MSS) for  connec-
              tions  over  this route to M bytes.  The default is
              the device MTU minus headers, or a lower  MTU  when
              path  mtu  discovery  occured.  This setting can be
              used to force smaller TCP packets on the other  end
              when  path  mtu  discovery  does  not work (usually
              because of misconfigured firewalls that block  ICMP
              Fragmentation Needed)

       window W
              set  the  TCP window size for connections over this
              route to W bytes. This is typically  only  used  on
              AX.25  networks  and  with drivers unable to handle
              back to back frames.

       irtt I set the initial round trip time (irtt) for TCP con-
              nections   over   this   route  to  I  milliseconds
              (1-12000). This is typically  only  used  on  AX.25
              networks.  If omitted the RFC 1122 default of 300ms
              is used.

       reject install a blocking route, which will force a  route
              lookup  to  fail.  This is for example used to mask
              out networks before using the default route.   This
              is NOT for firewalling.

       mod, dyn, reinstate
              install  a  dynamic  or modified route. These flags
              are for diagnostic purposes, and are generally only
              set by routing daemons.

       dev If force the route to be associated with the specified
              device, as the kernel will otherwise try to  deter-
              mine  the  device  on  its own (by checking already
              existing  routes  and  device  specifications,  and
              where  the  route is added to). In most normal net-
              works you won't need this.

              If dev If is the last option on the  command  line,
              the  word  dev may be omitted, as it's the default.
              Otherwise the order of the route modifiers  (metric
              - netmask - gw - dev) doesn't matter.

EXAMPLES
       route add -net 127.0.0.0
              adds  the  normal  loopback  entry,  using  netmask
              255.0.0.0 (class A net, determined from the  desti-
              nation address) and associated with the "lo" device
              (assuming this device was  prviously  set  up  cor-
              rectly with ifconfig(8)).

       route add -net 192.56.76.0 netmask 255.255.255.0 dev eth0
              adds a route to the network 192.56.76.x via "eth0".
              The Class C netmask modifier is not  really  neces-
              sary  here  because  192.* is a Class C IP address.
              The word "dev" can be omitted here.

       route add default gw mango-gw
              adds a default route (which  will  be  used  if  no
              other route matches).  All packets using this route
              will be gatewayed through  "mango-gw".  The  device
              which  will actually be used for that route depends
              on how we can reach "mango-gw" - the  static  route
              to "mango-gw" will have to be set up before.

       route add ipx4 sl0
              Adds  the  route  to  the  "ipx4" host via the SLIP
              interface (assuming that "ipx4" is the SLIP  host).

       route add -net 192.57.66.0 netmask 255.255.255.0 gw ipx4
              This command adds the net "192.57.66.x" to be gate-
              wayed through the former route to the  SLIP  inter-
              face.

       route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0
              This  is  an  obscure one documented so people know
              how to do it. This sets all of the class D  (multi-
              cast)  IP routes to go via "eth0". This is the cor-
              rect normal configuration line with a  multicasting
              kernel.

       route add -net 10.0.0.0 netmask 255.0.0.0 reject
              This  installs  a  rejecting  route for the private
              network "10.x.x.x."

OUTPUT
       The output of the kernel routing table is organized in the
       following columns

       Destination
              The destination network or destination host.

       Gateway
              The gateway address or '*' if none set.

       Genmask
              The    netmask    for    the    destination    net;
              '255.255.255.255'  for  a  host   destination   and
              '0.0.0.0' for the default route.

       Flags  Possible flags include
              U (route is up)
              H (target is a host)
              G (use gateway)
              R (reinstate route for dynamic routing)
              D (dynamically installed by daemon or redirect)
              M (modified from routing daemon or redirect)
              A (installed by addrconf)
              C (cache entry)
              !  (reject route)

       Metric The  'distance'  to  the target (usually counted in
              hops). It is not used by recent kernels, but may be
              needed by routing daemons.

       Ref    Number  of  references  to this route. (Not used in
              the Linux kernel.)

       Use    Count of lookups for the route.  Depending  on  the
              use  of  -F  and -C this will be either route cache
              misses (-F) or hits (-C).

       Iface  Interface to which packets for this route  will  be
              sent.

       MSS    Default  maximum  segement size for TCP connections
              over this route.

       Window Default window size for TCP connections  over  this
              route.

       irtt   Initial RTT (Round Trip Time). The kernel uses this
              to guess about the  best  TCP  protocol  parameters
              without waiting on (possibly slow) answers.

       HH (cached only)
              The  number  of  ARP entries and cached routes that
              refer to the hardware header cache for  the  cached
              route. This will be -1 if a hardware address is not
              needed for the interface of the cached route  (e.g.
              lo).

       HH (cached only)
              The  number  of  ARP entries and cached routes that
              refer to the hardware header cache for  the  cached
              route. This will be -1 if a hardware address is not
              needed for the interface of the cached route  (e.g.
              lo).

       Arp (cached only)
              Whether  or not the hardware address for the cached
              route is up to date.

FILES
       /proc/net/ipv6_route
       /proc/net/route
       /proc/net/rt_cache

SEE ALSO
       ifconfig(8), netstat(8), arp(8), rarp(8)

HISTORY
       Route for Linux was originally written  by  Fred  N.   van
       Kempen,  [waltje@uwalt.nl.mugnet.org] and then modified by
       Johannes Stille and Linus  Torvalds  for  pl15.  Alan  Cox
       added  the  mss  and window options for Linux 1.1.22. irtt
       support and merged with netstat from Bernd Eckenfels.

AUTHOR
       Currently  maintained  by  Phil   Blundell   [Philip.Blun-
       dell@pobox.com].

net-tools                 2 January 2000                 ROUTE(8)


[Back to CCP14 Web/Config Main Page] | [Setting up Virtual IP Addresses in Linux]

[CCP14 Home: (Frames | No Frames)]
CCP14 Mirrors: [UK] | [CA] | [US] | [AU]

(This Webpage Page in No Frames Mode)

If you have any queries or comments, please feel free to contact the CCP14