Additional: IP aliasing

From: Paulette Koble <pkoble_at_halcyon.com>
Date: Wed, 22 May 1996 10:44:21 -0700 (PDT)

I have been asked to share more of the information I received from the
members regarding setting up ip aliases on the Alphas. Thanks again to
all for sharing your knowledge.

>From gnolte_at_gwdg.de

I'm using following script to implement IP-aliasing on some of my machines
(sorry for some german comments):

8< ----------- implement IP-aliasing -------------- >8
#!/bin/ksh
#
# Skript to install a network alias that survives a reboot
#
# GN/6/2/95
#

SETNAME="NETALIAS"

cat <<ENDE

===========================================================
                Installation von $SETNAME
===========================================================


ENDE




typeset -u yn="123"

START=""
STOP=""
IFCONFIG=/sbin/ifconfig
NETSTAT=/usr/sbin/netstat


BASENAME=netalias
SKRIPT=/sbin/init.d/$BASENAME
SSK=/sbin/rc3.d/S010$BASENAME
KSK=/sbin/rc2.d/K549$BASENAME


until [[ $yn = Y ]] || [[ $yn = N ]]; do
   read yn?"Install $SETNAME <y/n> "
done

if [[ $yn = N ]] ; then
   echo exiting $SETNAME installation script...
   exit
fi


$NETSTAT -i


yn="132"
until [[ $yn = O ]] || [[ $yn = E ]]; do
   
   read IF?"Enter the interface name: "
   read ALIAS?"Enter the IP alias address [nnn.nnn.nnn.nnn]: "

   echo ifconfig $IF alias $ALIAS

   read yn?" Okay, Redo, Exit <O/R/E>? "
done


if [[ $yn = E ]] ; then
   exit
fi


START="$IFCONFIG $IF alias $ALIAS"
STOP="$IFCONFIG $IF delete $ALIAS"


cat <<ENDE > $SKRIPT
#!/sbin/sh
#
# Set an alias for the fta0 interface
#


PATH=/sbin:/usr/sbin:/usr/bin
export PATH

case "\$1" in
'start')
        $START
        ;;
'stop')
        $STOP
        ;;
*)
        echo "usage: \$0 {start|stop}"
        ;;
esac
ENDE

echo chmod 755 $SKRIPT
     chmod 755 $SKRIPT
echo ln -s $SKRIPT $SSK
     ln -s $SKRIPT $SSK
echo ln -s $SKRIPT $KSK
     ln -s $SKRIPT $KSK


yn="132"
until [[ $yn = Y ]] || [[ $yn = N ]]; do
   
   read yn?" Start netalias now <y/n>? "

done


if [[ $yn = Y ]] ; then
   $SKRIPT start
fi


8< ----------- remove IP aliasing -------------- >8
#!/bin/ksh
#
# Skript to delete the network alias skript
#
# GN/6/2/95
#

SETNAME="NETALIAS"

cat <<ENDE

===========================================================
                Delete von $SETNAME
===========================================================


ENDE




typeset -u yn="123"


BASENAME=netalias
SKRIPT=/sbin/init.d/$BASENAME
SSK=/sbin/rc3.d/S010$BASENAME
KSK=/sbin/rc2.d/K549$BASENAME


until [[ $yn = Y ]] || [[ $yn = N ]]; do
   read yn?"Delete $SETNAME <y/n> "
done

if [[ $yn = N ]] ; then
   echo exiting $SETNAME deletion script...
   exit
fi



# delete the netalias
/sbin/init.d/$BASENAME stop


echo rm $SKRIPT
     rm $SKRIPT
echo rm $SSK
     rm $SSK
echo rm $KSK
     rm $KSK

8< ----------- nothing more -------------- >8

>From jason_at_dstc.edu.au Wed May 22 10:32:55 1996
From: jason andrade <jason_at_dstc.edu.au>

the simplest method i found was to modify /etc/rc.config like so:

NUM_NETCONFIG="9"
MAX_NETDEVS="9"
NETDEV_0="ln0"
NETDEV_1="ln0"
NETDEV_2="ln0"
NETDEV_3="ln0"
NETDEV_4="ln0"
NETDEV_5="ln0"
NETDEV_6="ln0"
NETDEV_7="ln0"
NETDEV_8="ln0"
IFCONFIG_0="130.102.181.8 netmask 255.255.255.0"
IFCONFIG_1="alias 130.102.181.9 netmask 255.255.255.0"
IFCONFIG_2="alias 130.102.181.10 netmask 255.255.255.0"
IFCONFIG_3="alias 130.102.181.11 netmask 255.255.255.0"
IFCONFIG_4="alias 130.102.181.12 netmask 255.255.255.0"
IFCONFIG_5="alias 130.102.181.13 netmask 255.255.255.0"
IFCONFIG_6="alias 130.102.181.14 netmask 255.255.255.0"
IFCONFIG_7="alias 130.102.181.15 netmask 255.255.255.0"
IFCONFIG_8="alias 130.102.181.16 netmask 255.255.255.0"

which gives me 10 ip `numbers' associated with the one interface. works fine
for me.

-jason
-- 
.jason andrade.......dstc,.pty,.ltd.............jason_at_dstc.edu.au.
.sysadmin............gehrmann laboratories......i just wanna be...
.phn: 61-7-33654673..university.of.queensland...bluemisty.........
.fax: 61-7-33654311..brisbane,.4072,.australia..and barefooted....
_________________________________________________________________________
Paulette Koble -- System Administrator                 pkoble_at_halcyon.com
Northwest Nexus - Professional Internet Services         Bellevue, WA USA
Voice: 206 455-3505  Web: http://www.halcyon.com/  Info: info_at_halcyon.com
Received on Wed May 22 1996 - 20:42:02 NZST

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:46 NZDT