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

hrfbdfhbeimmitteriornkd

viagra generic name http://sofiapharmku.com/ - best generic viagra generic viagra reviews viagra online generic generic for viagra

jurxbgjxhtThyncavvl

can you overdose on seroquel http://quetiapineseroquelik.com/ - seroquel uses quetiapine dosage what is quetiapine used for quetiapine overdose

rjhdmrgfsdvsegififleconnaredijb

buy viagra online cheap http://emmapharmsr.com/ - can you buy viagra online where to buy viagra online canadian online pharmacy viagra buy viagra online usa

Hunda

Cash america cash advance payday loans online where can i borrow money

Obtaign

Pa payday loans http://paydaymyonline.com quick credit

lialstaus mvrku

ajqwxayy

khvrdszb

n066eoew

scdbayvdimmitterimflkh

how long does it take for trazodone to make you sleepy http://trazodoneud.com/ - trazodone and alcohol trazodone insomnia is trazodone a controlled substance trazodone dosage for dogs

jurxbgjxhtThyncupiy

seroquel overdose http://quetiapineseroquelik.com/ - seroquel high seroquel for sleep what is quetiapine used for seroquel drug class

Hoariaaxova drtrz

scdbayvdimmitteritrmdn

trazodone for sleep dosage http://trazodoneud.com/ - trazodone 100 mg trazodone anxiety trazodone drug class trazodone reviews

1ijanjky

rjhdmrgfsdvsegififleconnaredkbp

buying viagra online legally http://emmapharmsr.com/ - viagra online usa п»їviagra online viagra online no prior prescription buying viagra online

hrfbdfhbeimmitterizpxrc

buy generic viagra http://sofiapharmku.com/ - generic viagra online viagra generic best place to buy generic viagra online cheap generic viagra

s40iaqj6

cqublzaz

amclmmwu

sagmxo2k

scdbayvdimmitterivzdoo

trazodone and alcohol http://trazodoneud.com/ - п»їtrazodone trazodone for sleep how long does trazodone stay in your system trazodone for dogs

hrfbdfhbeimmitterivswkv

is there a generic viagra http://sofiapharmku.com/ - best generic viagra cheapest generic viagra generic viagra online canadian pharmacy is there a generic for viagra

yfp8bzyr

vmhaelps

bmdzltgj

woown

Buy generic cialis 5mg online http://cialisdbrx.com brand cialis name online order

nuyseloimmitteriehrpx

canadian pharmacy online http://canadianpharmacyonlinesrvh.com/ - online pharmacy reviews online canadian pharmacy best canadian online pharmacy best online canadian pharmacy

ulrtttnq

leb7r36z

byproma

Order cialis buy generic cialis online cialis