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

spam viagra cialis generic levitra
buy generic cialis online
generic cialis india
buy generic cialis online

generic cialis online BernardRIP

taking cialis 5mg daily - cialis
how long is cialis good for after expiration date
cialis amiodarone
buy cialis online
cialis online to australia

cialis one day pill

cialis generico fiable - cialis cheap

cialisbuy girl viagra online - viagra cheap

generic viagra onlinebargain viagra - viagra online

cheap viagra online

cialis sans ordonnance achete

taking cialis and alcohol - buy cialis online

cialis genericcheapest viagra ever - canadian viagra

buy viagraviagra generika kaufen paypal - generic viagra

cheap viagra online

buying cialis in canada fast shipping cialis
buy cialis online
online cialis no prescription
cheap cialis online

hvzmvjijbsuh - 84922916

Ghostwriter for Homework Assignments pcejwbfcpzxz - 64119684

cialis online BernardRIP

effect of cialis on sperm motility - buy generic cialis
where can i buy cialis in thailand
cialis online
wirkung von cialis 5 mg
cialis online
cialis to take effect

how much is viagra at walmart cialis generic
cialis online
magnus sildenafil cialis generic pills
buy cialis online

buy cialis online BernardRIP

cialis direkt in holland kaufen - cialis online
cialis bayan azdД±rД±cД±
buy cialis
what do you do when cialis does not work
buy generic cialis
where to buy cialis in nigeria

buy viagra online

is it safe to take viagra and hydrocodone viagra online special warnings for viagra buy viagra can you take viagra in your 20s

generic viagra 100mg by GaireEmople

cost of viagra at walgreens buy viagra online, buy tadalafil united states

cheap generic viagra by GaireEmople

can you take advil and viagra generic viagra canada are there any long term side effects of cialis

viagra 50 mg cheap JosephGon

q viagra without a doctor prescription
viagra generico in farmacia best way to cut viagra in half