SUMMARY: Multiple IP addresses on one network adapter

From: <Shaun.Racine_at_intier.com>
Date: Wed, 15 Jan 2003 11:51:32 +0000

Great response, many thanks to all who replied. Many suggested editing
/etc/inet.local, but I stayed with rc.config.

I adopted Michael Bradford's suggestion;

You need to alter the lines in rc.config to:

NETDEV_0="nr0"
IFCONFIG_0="174.28.48.99 netmask 255.255.0.0"
NETDEV_1="nr0"
IFCONFIG_1="alias 6.5.4.202/16"

Also needed to increase (suggested by Roger!);
NUM_NETCONFIG="2"

Original question and all responses follow...

----- Forwarded by Shaun Racine/MISGroup on 15/01/2003 11:41 -----
                                                                                                                    
                    Shaun.Racine_at_intier.com
                    Sent by: To: tru64-unix-managers_at_ornl.gov
                    tru64-unix-managers-owne cc:
                    r_at_ornl.gov Subject: Multiple IP addresses on one network adapter
                                                                                                                    
                                                                                                                    
                    15/01/2003 09:59
                                                                                                                    
                                                                                                                    




Hi all,

Version Compaq Tru64 UNIX V5.1 (Rev. 732), non-cluster, using NETRain.

How can I setup more than one IP address for a single virtual "netrain"
adapter which will survive a reboot?

We have tried the following in rc.config (where 174.. is normal address,
and 6.. is second address) ;

NETDEV_0="nr0"
IFCONFIG_0="174.28.48.99 netmask 255.255.0.0"
NETDEV_1="nr0"
IFCONFIG_1="6.5.4.202 netmask 255.255.0.0"

but after a reboot it only has the first IP address. MAX_NETDEVS="8"

TIA
Shaun Racine


== Michael James Bradford
You need to alter the lines in rc.config to:

NETDEV_0="nr0"
IFCONFIG_0="174.28.48.99 netmask 255.255.0.0"
NETDEV_1="nr0"
IFCONFIG_1="alias 6.5.4.202/16"


== Roger
Is NUM_NETCONFIG = 2 ?


== Phil Baldwin
Don't think you can do it in rc.config (couldn't see anyway)
but what you could do is add the necessary line to the /etc/inet.local
file.

This should run at system startup and add the required alias see man
inet.local


== Dennis Voetelink
As far as I know, the only possibility is to use
# ifconfig nr0 alias 6.5.4.202 netmask 255.255.0.0
to add the second IP address.

Use -alias to remove it.
I'm afraid you'll need to write your own startup script for this and place
that in /sbin/init.d with a symlink to it in /sbin/rc3.d


== Uwe Richter
I think you have to call this an "interface alias". We set this (for a
single interface) with a line in /etc/inet.local:

ifconfig ee3 alias <your.ip.alias.address> netmask <your.valid.subnet.mask>

This should also work for you if the NetRain interface is
already configured an up.


== Christian Wessely
I have had the same object:

assign a second IP to a network adapter that serves as a virtual
Webserver (with apache).
Solution for me was a little shellscript and the alias option of ifconfig:

/sbin/init.d/alias contains
---------------------------------
#!/bin/sh
# This file should have uid root, gid sys and chmod 744
#

case "$1" in

'start')
#
# Edit these lines to suit your installation (paths, workgroup, host)
#
     /sbin/ifconfig tu0 alias X.Y.105.21
     /sbin/ifconfig tu0 alias X.Y.105.25
    ;;
'stop')
     /sbin/ifconfig tu0 -alias X.Y.105.21
     /sbin/ifconfig tu0 -alias X.Y.105.25
    ;;
*)
    echo "Usage: `basename $0` { start | stop }"
    ;;
esac
---------------------------------

In my case, this script is called by the awemanager when the cluster
starts; for a single machine i would just recommend to cd /sbin/rc3.d ;
ln -s yourscript to Sxxalias so that it is integrated in the normal
start procedure.
Perhaps you can use the alias option directly in the rc.config, but I
have not dealt with that.


== Johan Brusche
Add a line in /etc/inet.local reading:

/sbin/ifconfig nr0 alias 6.5.4.202 netmask 255.255.0.0

Remove the entry in rc.config
Received on Wed Jan 15 2003 - 11:53:47 NZDT

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