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

viagra online

viagra and smoking weed buy viagra viagra bez recepty biaЕ‚ystok buy viagra online hat viagra verfallsdatum

order cialis online by GaireEmople

tadalafil tablete iskustva cheap generic cialis, how to make sildenafil most effective

buy online viagra from AlanaWaR

where to buy viagra online when will viagra go generic generic viagra for sale

buy viagra professional by AlanaWaR

how to buy viagra online viagra online without preion

buy viagra online in canada JosephGon

u viagra generic availability
cheap viagra uk online how to get viagra in one day


buy cialis online
compare prices cialis 20
tinnitus cialis online pharmacy


cialis coupon
search cialis generic cialis
generic cialis online
buy cialis generic


buy cialis
is there generic cialis
buy soft cialis
cheap cialis


buy cialis generic
generic cialis 10 mg
levaquin inhaler cialis pills


generic viagra online
viagra before and after
viagra kamagra
buy viagra online


buy cialis
buy cialis in the uk
buy cialis online without a prescription
buy cialis online


buy cialis generic
buy generic cialis in shanghai
generic cialis any good
generic cialis


buy cialis
generic cialis vs brand cialis
buying cialis at shoppers drug mart
buy cialis generic


buy cialis online
cheap online female cialis
cialis 5mg price prescription