How to add a virtual IP in MacOSX?

To add a secondary (virtual) IP address to an existing interface use the following command:

sudo ifconfig lo0 inet 192.168.0.1 netmask 255.255.255.0 alias

to remove it again use:

sudo ifconfig lo0 inet 192.168.0.1 netmask 255.255.255.0 -alias

simple as that 🙂

This entry was posted in Mac OS X. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.