Blog.

How to add an IP address to loopback interface on Mac

Create file /Library/LaunchDaemons/yourname.plist with the following content:

<plist version="1.0">
    <dict>
        <key>Label</key>
            <string>Your Label</string>
        <key>ProgramArguments</key>
            <array>
                <string>/sbin/ifconfig</string>
                <string>lo0</string>
                <string>alias</string>
                <string>127.0.0.2</string>
                <string>netmask</string>
                <string>255.255.255.0</string>
            </array>
        <key>RunAtLoad</key>
            <true/>
    </dict>
</plist>

and reboot the machine.

saki
Follow me:
Latest posts by saki (see all)

Leave a Reply

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

Enter your username and password to log into your account. Don't have an account? Sign up.

Want to collaborate on an upcoming project?