Shared hosting server + NAT + virtualhosts reachability

PDF versionSend to friendPrinter-friendly version

How to make virtualhosts visible to each other on a shared hosting server behind a Firewall.

Situation

You have a web hosting server with lots of virtual hosts running on it.
You also have a a firewall in front of the server.
The server has a private IP address assigned to the NIC of the server and the firewall provide a NAT (public_ip -> private_ip)

Problem

Some virtualhosts on the server need to connect to the public DNS name of a virtualhost on the same server.
The DNS resolution resolve the DNS name to the public IP of the server and according to the routing table the traffic is routed to the firewall that make the connection impossible for a "in-out-interface-problem".

Solution

I think that there are more than one solution:

  1. alias the public ip
  2. nat in OUTPUT chain

I prefer the iptables solution and this worked for me:

ETH0_IP=$(ifconfig eth0 | grep "inet addr" | awk '{print $2}' | awk 'BEGIN {FS=":"} {print $2}')
ETH0_IP_PUBLIC="YOUR.PUBLIC.IP.ADDRESS"
$IPTABLES -t nat -A OUTPUT -d $ETH0_IP_PUBLIC -j DNAT --to-destination $ETH0_IP

viagra generic at walgreens

daily target generic viagra at sam's club where lift virtually group http://www.christianlouboutinoutletus.us price of viagra at walmart, between table

http://viagrabs.com by GaireEmople

viagra in liquid form http://viagrabs.com prix cialis forum

buy cialis by GaireEmople

ou commander tadalafil forum cheap cialis online couple levitra ou cialis

buy cialis online by GaireEmople

is it safe to take viagra after heart attack buy generic cialis pharma med cialis

cheapest generic viagra online JosephGon

c http://viagrarow.com viagra without a doctor prescription
viagra generic viagra do what does

buy cialis by GaireEmople

costo in farmacia cialis 20 mg buy cialis online what to do if you take too much sildenafil

tricare prescription cialis

cheap canadian pharmacy cialis

http://candiancialisuy.com/ - cialis generic

cialisviagra and daibetes

http://viagralkas.com/ - buy viagra online

viagra cheapprice viagra pills pay pal

http://viagranelius.com/ - generic viagra online

buy generic viagra

generic cialis eu

only today cialis australia

http://candiancialisuy.com/ - cheap cialis

cialis cheapbuying mastercard viagra

http://viagralkas.com/ - buy generic viagra

viagra onlinebuy viagra dhaka

http://viagranelius.com/ - viagra online

viagra online

buy cialis online nopw

order cialis net

http://candiancialisuy.com/ - generic cialis online

cialis genericuk viagra online

http://viagralkas.com/ - online viagra

canadian viagrarxusa viagra generic

http://viagranelius.com/ - buy viagra online

buy viagra online

Diabe

cheap cialis
buy cialis online without a otc
http://cialisnrx.com
sample cialis pills buy
generic cialis online

no prescription cialis in uk

cialis in aachen

http://candiancialisuy.com/ - cialis

generic cialisescompte viagra gnrique

http://viagralkas.com/ - cheap viagra

viagra onlineviagra pens for sale

http://viagranelius.com/ - viagra online

cheap viagra

http://viagrabs.com HenryRal

how can you get a prescription for viagra
viagra online
viagra apotheke deutschland
buy viagra
what does viagra do to a dog