remote connect openshift mysql

再虛擬機內 rhc port-forward <app-name>php

 

此時,能夠在本機 訪問 127.0.0.1:8080  登錄 網頁, 3306鏈接sqllinux

 

https://unix.stackexchange.com/questions/111433/iptables-redirect-outside-requests-to-127-0-0-1sql

https://serverfault.com/questions/551361/redirect-incoming-packets-to-loopback/702685app

 

按上述將tcp




而後
http://forums.justlinux.com/showthread.php?136144-SOLVED-hosts-file-redirecting-a-outgoing-ip-address-to-localhost


sysctl -w net.ipv4.conf.eth0.route_localnet=1

sudo iptables -t nat -A PREROUTING -d 192.168.252.30 -j DNAT --to-destination 127.0.0.1ide

sudo iptables -t nat -A OUTPUT -d 192.168.252.130 -j DNAT --to-destination 127.0.0.1oop

 

發現  能夠在虛擬機內  用  虛擬機的eth0 的ip 地址:8080  訪問了,,但主機上仍然不行    http://192.168.252.130:8080/unix

 

嘗試 code

http://www.linuxidc.com/Linux/2012-06/63520.htmserver

iptables -t nat -A PREROUTING -p tcp --dport 8080 -j DNAT --to-destination 127.0.0.1:8080

相關文章
相關標籤/搜索