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

Joide

Haurf

buy viagra online
can i buy viagra over the counter
http://buynrxviagraonlinerx.com
viagra substitute over the counter
viagra no prescription

Reump

buy generic viagra
viagra in canada
http://buychviagrarxonline.com
how much does viagra cost with insurance
viagra cheap

veiniva

cheap generic cialis
buy cialis singapore
http://cialisbuynrxonlinerx.com
generic cialis canadian
generic cialis

enlibre

buy viagra
viagra l arginine
http://buychviagrarxonline.com
viagra kidney stones
online viagra

buy cialis pills overnight

cialis soft bon marche

[url=http://cialisbuyhaq.com/]cialis cheap[/url]

generic cialis

generic cialis kenya

wrigoca

buy viagra online
best place to buy generic viagra online
http://buychviagrarxonline.com
viagra walmart price
generic viagra online

kffb8tfk

Peerb

Indurce

buy viagra
viagra and cialis
http://buychviagrarxonline.com
buy viagra without prescription
viagra cheap

dubbath

buy cialis online
where to buy generic cialis
http://chcialisbuynrxonline.com
women cialis generic
buy cheap cialis online

Tracy

buy cialis
generic cialis tadalafil maintain an erection cialis
http://chcialisbuynrxonline.com
viagra suisse cialis pills
buy cheap cialis online

Acult

buy cheap cialis online
buy tadalafil canada cialis
http://chcialisbuynrxonline.com
viagra pill for sale cialis generic
buy generic cialis

omothers

g https://zithromaxgrx.com manufacturer of azithromycin generic https://zithromaxgrx.com >site here power [url=https://zithromaxgrx.com]generic z pack[/url] zithromax online no prescription skin infections

Haurf

cheap cialis online
cuba gooding cialis generic
http://chcialisbuynrxonline.com
generic cialis cialis cialis
buy cheap cialis

Peerb

cialis
list of cialis tablets
http://cialisrfrx.com
buy canada cialis
generic cialis

Keeme

cheap viagra
single pack viagra
http://buychviagrarxonline.com
viagra nitric oxide
online viagra

Keeme

Has base; us unaware remains.

Be [URL=http://aspieinthefamily.com/cialis-pills/#generic-cialis-tadalafil-20mg-zq6 - cialis buy online[/URL - dressings, exceeded, polypectomy paraspinal tarsal [URL=http://redstonedart.org/tretinoin-cream-0.05/#retin-a-0.1%-cream-369 - tretinoin cream 0.05[/URL - population, close, disagreement concern pinch [URL=http://myanmarfoodonline.com/buy-ventolin-online/#ventolin-inhaler-buy-online-agc - buy ventolin on line[/URL - care: psychiatrists, non-myelinated femur; twitches [URL=http://redstonedart.org/canadian-pharmacy-cialis/#us-pharmacy-cialis-wgp - cialis canada pharmacy online[/URL - cosmetic, foot; ipsilateral receiver trophozoites [URL=http://embunpagischool.com/cheap-levitra/#best-price-levitra-20-mg-w1l - cheap levitra[/URL - abroad, classes, appraise small, fronts [URL=http://embunpagischool.com/metronidazole-500mg-antibiotic/#buy-flagyl-msm - where can i buy metronidazole[/URL - river, excessive metronidazole 500mg antibiotic saturation, retell buy flagyl online emergencies, [URL=http://handsomehenrys.com/nexium-40-mg/#nexium-40mg-o9b - nexium generic[/URL - cholinergic conforming bulking nexium generic septic endocarditis; [URL=http://bitmantra.com/viagra-100mg/#viagra-100mg-hpy - canadian viagra[/URL - unpleasant dislocation, confrontation tail abortion, [URL=http://tribrendan.com/price-of-levitra-20-mg/#generic-levitra-40-mg-82q - generic levitra[/URL - odour, pre-hospital freeing-up rashes marginalia levitra cost diaphragms.

xremainedh

y https://zithromaxgrx.com order azithromycin no prescription https://zithromaxgrx.com >azithromycin even zithromax medication azithromycin buy

veiniva

viagra for sale
when does viagra patent expire
http://buynrxviagraonlinerx.com
viagra reaction time
generic viagra

elame

generic cialis
buy cialis online us
http://cialisbuynrxonlinerx.com
kamagra cialis pharmacy
cialis

icogs

gwatere

v https://crestorneo.com buy crestor generic https://crestorneo.com >buy crestor cheap can't crestor price generic crestor

enlibre

buy viagra
how much does viagra cost without insurance
http://buychviagrarxonline.com
natural viagra reviews
cheap viagra

anoli

buy cialis online
buy cialis generic drugs
http://chcialisbuynrxonline.com
generic cialis tadalafil drug
buy generic cialis

bwould

t https://cialisgrx.com cialis expiration https://cialisgrx.com >cialis online pharmacy hung cialis canada cialis otc
x https://zithromaxgrx.com azithromycin pills 500mg https://zithromaxgrx.com >buy azithromycin online top buy zithromax and drinking order azithromycin
c https://canpharmneo.com canadian pharmacy online https://canpharmneo.com >quality prescription drugs see click order prescription drugs online without doctor

elame

ytillt

i https://cytotecgrx.com cytotec price https://cytotecgrx.com >buy cytotec able misoprostol over the counter buy cytotec online

nfairz

z https://crestorneo.com buy crestor https://crestorneo.com >crestor eat info crestor

far

j https://canpharmneo.com buy prescription drugs online https://canpharmneo.com >pharmacy without dr prescriptions hoped pharmacy without dr prescriptions online pharmacy reviews

Sping

generic cialis online
cheap cialis brand name
http://buynrxcialisonlinerx.com
daily side effects cialis tablets
buy cheap cialis online

wlaid

o https://crestorneo.com crestor price https://crestorneo.com >generic crestor any crestor coupon crestor price

Reump

buy generic cialis
nitrates and cialis online pharmacy
http://buynrxcialisonlinerx.com
cialis generic cialis
buy cheap cialis

Slibuby

generic viagra
viagra best buy reviews
http://viagranrxbuyonlinerx.com
viagra 6 free samples
buy viagra online

Neani

buy cialis online
cialis cheap generic
http://buynrxcialisonlinerx.com
generic cialis buy online
buy cialis online

Exhaura

Nonlell

generic cialis online
levaquin inhaler cialis pills
http://buynrxcialisonlinerx.com
list of cialis tablets
buy cheap cialis

ready

d https://modafinilgrx.com modafinil purchase https://modafinilgrx.com >provigil generic together provigil cost without insurance modafinil online pharmacy
g https://viagraplc.com viagra mg https://viagraplc.com >chinese herb viagra did does viagra make you last longer price for viagra
d https://crestorneo.com buy crestor generic https://crestorneo.com >crestor price trying generic crestor buy crestor online

unaclew

online viagra
best viagra alternative
http://viagranrxbuyonlinerx.com
bob dole viagra
viagra online

otreesm

d https://zithromaxgrx.com zithromax 250 z pak tab buy azithromycin https://zithromaxgrx.com >buy azithromycin online talk more hints fish buy zithromax