|
|
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
# 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.
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
;;
| |
| [Append to This Answer] |
| Previous: |
|
| Next: |
|
| ||||||||