Este conteúdo não está disponível no idioma selecionado.

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 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.
Voltar ao topo
Red Hat logoGithubredditYoutubeTwitter

Aprender

Experimente, compre e venda

Comunidades

Sobre a documentação da Red Hat

Ajudamos os usuários da Red Hat a inovar e atingir seus objetivos com nossos produtos e serviços com conteúdo em que podem confiar. Explore nossas atualizações recentes.

Tornando o open source mais inclusivo

A Red Hat está comprometida em substituir a linguagem problemática em nosso código, documentação e propriedades da web. Para mais detalhes veja o Blog da Red Hat.

Sobre a Red Hat

Fornecemos soluções robustas que facilitam o trabalho das empresas em plataformas e ambientes, desde o data center principal até a borda da rede.

Theme

© 2025 Red Hat