(Answer) (Category) SCO UnixWare 7/OpenUNIX 8/OpenServer 6 FAQ : (Category) Networking :
How do I add an IP alias in Uw7/OSR6?
Use the 'ifconfig' command to add or remove an alias:

      ifconfig net0 alias 10.1.1.100
      ifconfig net0 -alias 10.1.1.100

You can test your new alias with the 'ping' command. If you have put the alias on a different subnet than the real address of the nic, then you will need to configure a route for one network to talk to the other virtual network. With an alias, you can keep your old IP address functional, if ever you change yours.

An alias is not permanent. You can make it stay, though, by creating an rc.2 shell script, S70ipalias. Here's mine, which logs to the syslog.


     -------------------- begin /etc/rc2.d/S70ipalias ----------------------
     #!/bin/sh
#====================== # File: /etc/rc2.d/S70ipalias # Auth: M.Schalit # Desc: Sets up aliases for net0, # and logs them to the syslog. # # Usage: S70ipalias < start|stop > # Date: 26 Nov 2000 #=======================
usage() { echo "Usage: $0 < start|stop >\n" }

       # Set up a few variables.  Fill in ALIAS1, and make NUN1 say
       # net0 or net1 or whatever nic you're putting the alias on.
       # The nic gets the alias, ALIAS1.
       # The NUN1 variable stands for Network Unit Number 1.
ALIAS1=10.240.68.94 NUN1=net0
IP1=`/usr/sbin/ifconfig $NUN1 | grep "inet " | cut -d" " -f2`

     case "$1" in
        start)   /bin/logger S70ipalias: initializing.
                 if [ "$NUN1" -a "$ALIAS1" -a "$IP1" ]
                 then
                    /usr/sbin/ifconfig $NUN1 alias $ALIAS1
                    IPA1=`/usr/sbin/ifconfig $NUN1 | grep "alias" | \
                           cut -d" " -f3`
                 /bin/logger S70ipalias: ${NUN1},$IP1 has the alias $IPA1
                 fi
                 ;;
stop) /usr/sbin/ifconfig $NUN1 \-alias ;;
*) usage ;; esac
exit 0 ----------------------------- End S70ipalias ------------------------


<mschalit@pacbell.net>
gerberb@zenez.com

[Append to This Answer]
Previous: (Answer) What is a Virtual Domain?
Next: (Answer) Suddenly the network is slow, why?
This document is: http://www.zenez.com/cgi-bin/ou8faq/faq?file=109
[Search] [Appearance]
This is a Faq-O-Matic 2.721.