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.


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)


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".


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}')
$IPTABLES -t nat -A OUTPUT -d $ETH0_IP_PUBLIC -j DNAT --to-destination $ETH0_IP

buy cialis online WilliamaLak

can i take cialis and drink alcohol
generic cialis for sale
side effects of cialis black
cialis feeling cold



does generic viagra work - when will viagra go generic cheapest generic viagra generic viagra 100mg best place to buy generic viagra online


LesGeommaPoothe qobgs

Bleancecluffnip dtxkc

lialstaus yqtqu


Buy generic cialis maintain an erection buy generic cialis canada



trazodone 100 mg - what is trazodone used for trazodone sleep trazodone weight gain trazodone alcohol


trazodone for anxiety - trazodone 50 mg for sleep is trazodone a narcotic is trazodone a controlled substance side effects of trazodone


canadian pharmacy online - canada pharmacy online canadian online pharmacy canada pharmacy online canadian online pharmacy

Goamerydayday pwagq

plauppyNuaniava ccigs