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

ctcihwko

sgdvjglsjdsadevyiz

generic viagra https://sexviagen.com/ - viagra online generic viagra viagra without a doctor prescription viagra online

cialis over counter walmart

Cialis Cialis generic cialis 40 mg best price
mambo 36 tadalafil 20 mg Cialis CIALIS Cialis cialis online purchase
buy cialis pills Cialis discount for cialis
cialis from mexican pharmacy once a day cialis 5 mg cialis Cialis ?????? cialis ??? cialis thailand

hwyhnvxojelgbsloHidlypzpbf

viagra https://zvigariageneric.com/ - generic viagra viagra viagra viagra without doctor prescription

order cialis without a prescription

buy viagra cialis CIALIS cheapest price on cialis
original cialis CIALIS legitimate online pharmacies that sell cialis cialis CIALIS
CIALIS cialis purchase cialis and advil
Cialis online viagra without prescription cialis side effects of cialis is cialis now a generic? CIALIS

how to take tadalafil tablets 20mg

cialis generic tadalafil tadalafil sublingual 75 mg cialis
safe cialis online cialis printable coupons cialis with pulmonary hypertension cialis cialis
Cialis tadalafil india 60 mg use cialis
how to buy viagra without a prescription celias pills cialis Cialis Cialis CIALIS

ngbfhfgMitsFlilebmg

cialis generic https://valcialisns.com/ - п»їcialis cialis п»їcialis online cialis

cialis

Cialis generic cialis available cialis
cialis cialis without a doctor 20mg cialis generic for cialis in the usa cialis
what are the side effects with cialis e20 pill cialis generic cialis for less
cialis inexpensive cialis buy cialis online without a prescription CIALIS viagra/cialis Cialis

ningrgtrggififleconnaredqry

cialis 20mg http://genericcialls.com/ - online cialis cialis 20mg generic cialis cialis

what is cialis prescribed for

what is cialis Cialis Cialis
cialis vs tadalafil cialis cialis 20mg price at walmart how does cialis work best CIALIS
daily dose of cialis cialis cialis for bph
cialis vs viagra comparison cialis generic cialis from india pharmacy Cialis cialis.canada canadian pharmacy no prescription

grsvrhnknbssbdsjamerbnh

generic viagra https://medyvirgaraonline.com/ - online viagra generic viagra viagra generic viagra

grsvrhnknbssbdsjamerbbd

viagra https://medyvirgaraonline.com/ - viagra online viagra viagra generic viagra

cialis generic svrdxMitsFlilewoh

cialis online http://www.ciallisonline.com/ - cialis generic generic cialis п»їcialis cialis

cialis order

Cialis cialis Cialis brand cialis Cialis
does cialis go bad tadalafil generic generic for all cialis 20mg directions cialis Cialis Cialis
cialis tadalafil from walmart tadalafil 5mg price cialis shop cialis generic cialis

bsgsdnhajbeimmitteribmoie

cheap viagra https://www.genericviragacheap.com/ - generic viagra buy viagra generic viagra viagra without doctor prescription

grsvrhnknbssbdsjamerbdn

generic viagra https://medyvirgaraonline.com/ - viagra online viagra generic viagra viagra

nmwgbndsloEurobixdmmbt

generic viagra https://genericjojos.com/ - generic viagra viagra viagra viagra

bsgsdnhajbeimmitteriavsvl

viagra https://www.genericviragacheap.com/ - п»їviagra viagra viagra generic viagra

sgdvjglsjdsadevyyt

generic viagra https://sexviagen.com/ - viagra viagra online viagra without a doctor prescription online viagra

hwyhnvxojelgbsloHidlybgmpq

viagra https://zvigariageneric.com/ - generic viagra generic viagra viagra online viagra

sgdvjglsjdsadevymb

viagra without a doctor prescription https://sexviagen.com/ - generic viagra viagra without doctor prescription viagra generic viagra

bsgsdnhajbeimmitteriyhzmr

generic viagra https://www.genericviragacheap.com/ - generic viagra cheap viagra generic viagra viagra

hwyhnvxojelgbsloHidlyuwgil

viagra generic https://zvigariageneric.com/ - viagra without doctor prescription viagra online generic viagra buy viagra

bsgsdnhajbeimmitteripreor

buy viagra https://www.genericviragacheap.com/ - generic viagra online viagra generic viagra viagra online

grsvrhnknbssbdsjamerbuu

viagra https://medyvirgaraonline.com/ - viagra viagra online generic viagra cheap viagra

bsgsdnhajbeimmitterimtdoi

viagra generic https://www.genericviragacheap.com/ - viagra generic viagra viagra п»їviagra

п»їcialis svrdxMitsFlileuwa

cheap cialis http://www.ciallisonline.com/ - cialis cialis п»їcialis online cialis

grsvrhnknbssbdsjamerbli

viagra without a doctor prescription https://medyvirgaraonline.com/ - viagra online generic viagra viagra without doctor prescription online viagra

ngbfhfgMitsFlilegow

cialis https://valcialisns.com/ - generic cialis buy cialis online cialis cialis online

ngbfhfgMitsFlilezbm

cheap cialis https://valcialisns.com/ - generic cialis online cialis cialis cialis generic

jybdhsfezbsfdfegififleconnaredclp

cialis reviews http://pharmcilisa.com/ - cialis cialis generic generic cialis generic cialis

medical pharmacies

pharmacy online no prescription canadian drugs online pharmacy
walgreens pharmacy online canadian pharcharmy
canadian drugs online pharmacies https://canadianopharmacy.com/

grsvrhnknbssbdsjamerbqw

viagra without a doctor prescription https://medyvirgaraonline.com/ - viagra viagra online buy viagra viagra online

hwyhnvxojelgbsloHidlynxnhw

viagra https://zvigariageneric.com/ - viagra buy viagra viagra generic viagra

jybdhsfezbsfdfegififleconnaredlyq

generic cialis http://pharmcilisa.com/ - generic cialis cialis generic cialis cialis

hwyhnvxojelgbsloHidlyoyymw

viagra https://zvigariageneric.com/ - viagra online viagra viagra generic viagra

nmwgbndsloEurobixiarql

viagra https://genericjojos.com/ - buy viagra viagra online online viagra viagra

cialis svrdxMitsFlilerse

cheap cialis http://www.ciallisonline.com/ - online cialis п»їcialis buy cialis generic cialis

bsgsdnhajbeimmitteriypphd

generic viagra https://www.genericviragacheap.com/ - viagra without a doctor prescription viagra generic viagra viagra without doctor prescription

bsgsdnhajbeimmitterivcrty

cheap viagra https://www.genericviragacheap.com/ - viagra viagra generic viagra viagra

sgdvjglsjdsadevyjp

buy viagra https://sexviagen.com/ - generic viagra generic viagra viagra without a doctor prescription generic viagra

grsvrhnknbssbdsjamerbpd

viagra https://medyvirgaraonline.com/ - generic viagra viagra viagra buy viagra

ngbfhfgMitsFlilerkn

cheap cialis https://valcialisns.com/ - п»їcialis cheap cialis cialis п»їcialis

ndyoprgploimmitterikfuab

viagra online https://buyonlinewwwmen.com/ - viagra viagra viagra generic generic viagra

hwyhnvxojelgbsloHidlymphwo

online viagra https://zvigariageneric.com/ - viagra generic viagra viagra generic viagra online

hwyhnvxojelgbsloHidlyywuah

viagra online https://zvigariageneric.com/ - buy viagra viagra viagra without doctor prescription viagra online

nmwgbndsloEurobixwzicv

online viagra https://genericjojos.com/ - viagra without a doctor prescription viagra viagra online generic viagra

hwyhnvxojelgbsloHidlyvkvnz

cheap viagra https://zvigariageneric.com/ - viagra generic viagra without doctor prescription viagra without doctor prescription generic viagra