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

Slibuby

viagra online
organic viagra
http://viagrabstnrx.com
how to get viagra online
buy generic viagra

Padycle

buy viagra
girl takes viagra
http://buyviagramdrxonline.com
robin williams viagra
buy generic viagra

utoucho

v http://viagraphr.com herbal viagra reviews http://viagraphr.com >view site court

s2anj6sp

generisk danmark pris

priser apoteket, http://apotekeren.life/acesistem.html - prisfald recept.

dd6fwi1m

n9mrvbek

malay

http://viagramedmrx.com
women viagra
viagra online
viagra for womens where to buy
generic viagra

jhallj

o http://canadapharmphr.com canada drugs http://canadapharmphr.com >canadian generic drugs online blood

ihorse

z http://viagraphr.com viagra before and after http://viagraphr.com >generic viagra settled

Glottor

cheap viagra online
generic viagra for sale
http://viagrabstnrx.com
what viagra can do
cheap viagra online

yprayu

h http://viagraphr.com viagra prescription http://viagraphr.com >viagra 'em [url=http://viagraphr.com]viagra online[/url] herbal viagra

z2l6e9fw

maype

nornomo

cheap viagra online
is there a generic for viagra
http://buyviagraonlinewvrx.com
viagra trial card
viagra generic

acompanionl

e http://cialis1st.com cialis discount card http://cialis1st.com >buy cialis generic true [url=http://cialis1st.com]cialis vs viagra[/url] cost of cialis

jorvrfjl

Bloor

cheap viagra online
viagra korea
http://buyviagramdrxonline.com
cialis vs viagra vs levitra
buy viagra

tbluea

s http://levitra1st.com online levitra http://levitra1st.com >generic levitra table [url=http://levitra1st.com]bonuses[/url] cialis vs viagra vs levitra

Fluck

Faisemy

APOBANI

Arivina

Feado

cheap viagra online
viagra quotes
http://buyviagramdrxonline.com
viagra urban dictionary
buy viagra

rinnakkaislääke lappeenranta

Hinta viron apteekissa suomessa, http://verkkoapteekkisuomi.life/infectoroxit.html - osta suomesta mikkeli.

tcomesh

t http://provigil1st.com modafinil dose http://provigil1st.com >modafinil for sale tell [url=http://provigil1st.com]modafinil[/url] provigil 200 mg

COita

buy generic viagra
how to get free viagra
http://viagrabstnrx.com
ben phillips viagra
generic viagra online

fedutty

buy generic viagra
viagra commercial script
http://buyviagramdrxonline.com
generic viagra online reviews
cheap viagra online

hvor får jeg tabletter

hvordan bestille, http://danskonlineapotek.life/vivorax.html - køb af priser.

ithroughu

m http://canadapharm1st.com canada pharmacy reviews http://canadapharm1st.com >canadian pharmacy broke [url=http://canadapharm1st.com]us pharmacy viagra[/url] canadian pharmacy cialis

u5iqq0se

wh0cd3014696 buy aldactone

Plausly

buy viagra online
viagra single packs
http://buyviagramdrxonline.com
viagra 4 hours warning
generic viagra online

perr8szt

Slibuby

cheap viagra online
viagra gum
http://viagrabstnrx.com
viagra patent expiration date
buy generic viagra

αγορά

Αγορα online, http://farmakeiagreece.life/salazopyrin.html - παραγγείλετε greece.

Wo bekomme ich ohne rezept

kann man rezeptfrei kaufen http://internetapotheken.life/meto-isis.html Preis docmorris.

bybribe

how to buy viagra
what is a viagra
http://viagratxrx.com
what are the side effects of viagra
buying viagra online

pcornerp

n http://levitra1st.com levitra and alchol http://levitra1st.com >levitra coupon free trial new [url=http://levitra1st.com]generic levitra[/url] side effects of levitra

vd07401b

lwillc

h http://levitra1st.com levitra prices http://levitra1st.com >generic levitra morning erection pills free levitra

Glils

viagra online
how long does viagra take to work
http://viagratxrx.com
viagra jelly review
viagra cheap

anoli

how to buy viagra
why viagra no longer works
http://viagratxrx.com
when is viagra going generic
cheap viagra online

bstreet

i http://provigil1st.com provigil lawsuit http://provigil1st.com >provigil generic read modafinil modafinil generic

Smufaby

generic cialis online
viagra v levitra cialis pills cialis a
http://cialisbuymrxonline.com
free cialis pills
buy cialis

Clealse

http://buymrxviagrarxonline.com
how long before sex should i take viagra
buying viagra online
cialis vs viagra cost
buying viagra online