Alias the loopback address for your grid on macOS

For most smaller grids and even standalone installations of OpenSim there is a need to make a loopback of your grid’s IP address for everything to work properly. Many home routers such as Apple’s AirPort Express, Airport Extreme and the TimeMachine models of the same support automatic loopback. In this case there is no need to do anything as it should work “right out of the box”.

However, many home routers don’t support automatic loopback, and business and enterprise routers usually don’t. 

Creating a loopback alias for your grid’s IP address on the servers OpenSim runs on can therefore be a necessity. 

Setting a loopback alias in terminal can be done with the command

sudo ifconfig lo0 alias <your grid IP>

Removing it is done with 

sudo ifconfig lo0 -alias <your grid IP>

The culprit is this command does not survive a reboot. The easiest way to overcome this is to create a plist and place it in /Library/LaunchDaemons

If your domain for the grid is mydomain.org and your IP address is 111.222.1.2 then the plist will look like this saved to the file org.mydomain.loopback.plist

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">

<plist version="1.0">

  <dict>

    <key>Label</key>

    <string>org.mydomain.loopback</string>

    <key>ProgramArguments</key>

    <array>

        <string>/sbin/ifconfig</string>

        <string>lo0</string>

        <string>alias</string>

        <string>111.222.1.2</string>

    </array>

    <key>RunAtLoad</key>

    <true/>

  </dict>

</plist>

Make sure the plist has the same privileges as other files in  /Library/LaunchDaemons.  You can then load it with

sudo launchctl load /Library/LaunchDaemons/org.mydomain.loopback.plist 

To check the result issue the following command, and you should see your grid IP address listed in the result

sudo ifconfig lo0


hypergrid address: hop://grid.xmir.org:8002                                             xmir © 2014-2022