Ce contenu n'est pas disponible dans la langue sélectionnée.

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:
  • localhost
  • 127.0.0.1
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 myapp
Checking available ports...
Error trying to forward ports. You can try to forward manually by running:
ssh -N 70277280b8534c8a9fc76d2734393dfa@myapp-domain.example.com
Copy to Clipboard Toggle word wrap
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 application_IP_address
Copy to Clipboard Toggle word wrap

Example 11.24. Manually Configured IP Address

$ sudo ifconfig lo0 alias 127.10.51.129
Copy to Clipboard Toggle word wrap

Note

Root or administrative privileges are required to run the ifconfig command 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
Copy to Clipboard Toggle word wrap
Finally, enable port forwarding with the rhc port-forward command.

Important

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.
Retour au début
Red Hat logoGithubredditYoutubeTwitter

Apprendre

Essayez, achetez et vendez

Communautés

À propos de la documentation Red Hat

Nous aidons les utilisateurs de Red Hat à innover et à atteindre leurs objectifs grâce à nos produits et services avec un contenu auquel ils peuvent faire confiance. Découvrez nos récentes mises à jour.

Rendre l’open source plus inclusif

Red Hat s'engage à remplacer le langage problématique dans notre code, notre documentation et nos propriétés Web. Pour plus de détails, consultez le Blog Red Hat.

À propos de Red Hat

Nous proposons des solutions renforcées qui facilitent le travail des entreprises sur plusieurs plates-formes et environnements, du centre de données central à la périphérie du réseau.

Theme

© 2025 Red Hat