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

nmwgbndsloEurobixyqxhn

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

grsvrhnknbssbdsjamerbqm

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

grsvrhnknbssbdsjamerbnr

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

nmwgbndsloEurobixhelsb

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

bsgsdnhajbeimmitteriskkzh

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

ibqsfnko

hwyhnvxojelgbsloHidlyzznrv

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

grsvrhnknbssbdsjamerbvb

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

nmwgbndsloEurobixwdxlz

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

grsvrhnknbssbdsjamerbfw

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

grlswvazm

ndyoprgploimmitteriiippk

generic viagra https://buyonlinewwwmen.com/ - buy viagra viagra without a doctor prescription online viagra cheap viagra

sgdvjglsjdsadevypb

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

hwyhnvxojelgbsloHidlyvkrpg

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

sgdvjglsjdsadevydh

generic viagra https://sexviagen.com/ - generic viagra viagra online online viagra buy viagra

hwyhnvxojelgbsloHidlysguyu

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

write a essay for me write essay for me

fast custom essay auto essay writer
custom order essays professional essay writers for hire
your essay writer https://essayformewriter.com/

bsgsdnhajbeimmitterihuwyh

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

sgdvjglsjdsadevyoh

viagra https://sexviagen.com/ - viagra viagra generic viagra online buy viagra

bsgsdnhajbeimmitterizbjux

viagra [url=https://www.genericviragacheap.com/]viagra without doctor prescription[/url] buy viagra viagra without doctor prescription viagra

cialis

is cialis better than viagra best place to buy cialis online cialis cialis cialis duration
Cialis cialis using cialis what is better cialis or viagra Cialis CIALIS Cialis
CIALIS how to take cialis for best results cialis generic 5mg taken with viagra cialis commercials generic cialis cheap CIALIS

grsvrhnknbssbdsjamerblt

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

sgdvjglsjdsadevypb

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

zbmgvgnf

pdgktlvfplbp

buy viagra at rite aid effects of viagra precio del sildenafil generico en espaГ±a viagra purchase kamagra generic viagra reviews

best custom essay custom essay online

cheap custom essay papers personal essay
personal essay writers custom admission essay
write my college essay for me https://essayformewriting.com/

bsgsdnhajbeimmitterilrigg

generic viagra https://www.genericviragacheap.com/ - viagra without a doctor prescription buy viagra viagra generic п»їviagra

grsvrhnknbssbdsjamerbeg

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

ibfjfqou

sgdvjglsjdsadevybk

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

nmwgbndsloEurobixyvdpx

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

ndyoprgploimmitterigahts

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

hwyhnvxojelgbsloHidlytkpsr

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

ndyoprgploimmitterieedyl

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

canadian pharmacy online viagra

canadian pharmaceuticals online pharmacy online
canadia online pharmacy publix pharmacy online ordering
walgreens pharmacy online https://canadianopharmacy.com/

hwyhnvxojelgbsloHidlyaetug

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

sgdvjglsjdsadevydp

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

bsgsdnhajbeimmitterifsuhf

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

care doctor

grsvrhnknbssbdsjamerbxd

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

sgdvjglsjdsadevywh

cheap viagra https://sexviagen.com/ - generic viagra viagra viagra viagra

grsvrhnknbssbdsjamerbod

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

gruackfj

online pharmacies in usa

discount canadian drugs canada pharmaceuticals online
pharmacy online shopping canadian pharmaceuticals online
canadian pharmacy viagra generic https://canadianmpharmacy.com/

hwrddbfph

cialis from mexico

tadalafil canada cialis does cialis go bad cialis Cialis
CIALIS cialis safe cialis ordering cialis Cialis cialis cialis
cialis brand cialis online Cialis generic cialis online how does cialis help bph cialis