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

http://viagrabs.com mafiReuth

what does disney and viagra have in common
viagra generic
problem med viagra
viagra online
viagra building toronto

prix cialis pharmacie belgique

uk cialis online

http://candiancialisuy.com/ - cheap cialis

buy cialis onlineachat viagra femm

http://viagralkas.com/ - viagra cheap

buy generic viagraviagra pens for sale

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

viagra online

buy viagra HenryRal

natures viagra herb
buy viagra
acyclovir and viagra
viagra online
legality of viagra in uk

unsardyn

buy cialis online
generic cialis online purchase
http://buycialisonlinemrx.com
buy cialis line
buy cialis online

viagra HenryRal

taking viagra and drinking alcohol
buy viagra
good morning viagra song lyrics
buy viagra
funny pictures of viagra

generic cialis online reviews

click now cialis woman

http://candiancialisuy.com/ - cialis

buy cialisprix viagra 50 mg pfizer

http://viagralkas.com/ - viagra online

buy viagra onlineviagra online in romania

http://viagranelius.com/ - viagra

online viagra

black jack

best bonus video slots online
casino guide online las vegas nevada
best payout us online casino
online blackjack online casino
high payout online slots
live roulette online ireland
highest % sign up bonus casino
online roulette real money canada
blackjack online real money paypal
online casinos for us players
online casinos that still accept us players
online casino
slot machine games ipad

viagra online LeroyMex

viagra what dose should i take
buy viagra
quarter of a viagra
viagra online
the weekend pill viagra

buy viagra online LeroyMex

side effects of viagra for dogs
buy viagra online
when a girl takes viagra
buy viagra online
where to buy viagra in san diego

cialis 60m

cialis buy best

http://candiancialisuy.com/ - cialis

cialis cheapprescription viagra medecin

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

buy viagra onlinebest substitute viagra india

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

cheap viagra

buy viagra LeroyMex

what happens when a chick takes viagra
viagra online
best indian viagra brands
viagra online
is viagra ever covered by insurance

http://viagrabs.com LeroyMex

drugs that react with viagra
viagra online
effects taking viagra not needed
buy viagra
how to take viagra soft tabs