Technical article 125989

How do I add or remove a virtual IP address (IP alias)?

OpenServer 6UnixWare 7

Written · Last revised

Problem

How do I add or remove a virtual IP address/domain, also known as IP alias?

Solution

To add or remove a virtual IP address, also known as virtual domain or IP alias, from your system use the following commands:

1. To add a Virtual IP/Domain:

For example, if you had a single NIC card with an address of:

123.234.456.100

and you also wanted this NIC to accept traffic for address:

123.234.456.101

You would use the following command to add the virtual IP to the NIC interface:

# ifconfig net0 alias 123.234.456.101 netmask 255.255.255.0 broadcast 123.234.456.255

After running this command, the system will now accept all packets destined for the addresses

123.234.456.100
123.234.456.101

This virtual IP/Domain will remain configured until you reboot. You will need to reconfigure the virtual IP address after every reboot, or automate this by adding the command to the TCP/ip startup file in /etc/rc2.d.

2. To remove this Virtual IP/Domain, reboot, or use this command:

# ifconfig net0 -alias 123.234.456.101

If you omit the IP address, it will remove the non-aliased IP address, and the alias address would then become the only address for this interface.

NOTE: All the addresses above are non-functional examples, and would need to be substituted with the correct address/netmask/broadcast for your network.

See also

ifconfig(ADMN)

From the Xinuos technical article database, record 125989. Reproduced with permission. The original is at www.sco.com/ta/125989, which is reachable but blocked from search engines.

Next step

Need this fixed rather than explained?

Tell us the release, what the system runs and what it is doing. We will reply by email with what we would do next.

  • You deal with the people who do the work
  • No obligation, and no upgrade required before we will help
  • We tell you plainly if something is not worth doing

Send an enquiry

We reply by email. If a server is down, say so in the first line. You can also write to help@scoexpert.com.