11.15.4. Port Forwarding on Mac OS X
Currently, out of the box, Mac OS X only provides the following interfaces for loopback addresses:
Therefore, port forwarding on Mac OS X may not work correctly. The following example shows error messages that can occur when attempting to configure port forwarding using the IP address of an application.
Example 11.23. Error Messages When Port Forwarding on Mac OS X
rhc port-forward myappChecking available ports... Error trying to forward ports. You can try to forward manually by running: ssh -N firstname.lastname@example.org
The current workaround to enable port forwarding on Mac OS X is to manually configure an alias for each IP address used by the application:
sudo ifconfig lo0 alias
Example 11.24. Manually Configured IP Address
sudo ifconfig lo0 alias 127.10.51.129
Root or administrative privileges are required to run the
ifconfigcommand on Mac OS X.
If the application uses multiple IP addresses, you must configure an alias for each IP address. For example, suppose a PHP application has both MySQL and phpMyAdmin cartridges added, and it uses the IP addresses 127.11.25.1 and 127.11.25.2. For port forwarding to work correctly, configure an alias for each IP address as shown in the following example:
Example 11.25. Configuring Aliases for Multiple IP Addresses
sudo ifconfig lo0 alias 127.11.25.1$
sudo ifconfig lo0 alias 127.11.25.2
Finally, enable port forwarding with the
The IP address alias configured for an application is not persistent through system reboots. If the system is rebooted, you must repeat these steps to correctly enable port forwarding on Mac OS X.