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

cialis 10mg WilliamaLak

uses for cialis for daily use
buy cialis online
can you take cialis and high blood pressure medication
cialis generic
take cialis without ed

cialis WilliamaLak

can you use cialis after expiration date
buy cialis online
cialis webshop
cialis coupon walgreens
cialis young males

sueihswf

hrfbdfhbeimmitterihmfbr

generic viagra 100mg http://sofiapharmku.com/ - generic viagra for sale viagra generic date is there a generic for viagra generic viagra online pharmacy

aejppofi

buy cialis online WilliamaLak

cialis bad for heart
cialis coupons
cialis lilly wirkung
buy cialis
back pain due to cialis

Hoariaaxova acmrz

Goamerydayday gwitt

jhdgdlsn

scdbayvdimmitterikapji

trazodone sleep http://trazodoneud.com/ - trazodone withdrawal trazodone 100mg what is trazodone trazodone alcohol

hrfbdfhbeimmitterihpxtm

generic viagra online pharmacy http://sofiapharmku.com/ - viagra generic name cheapest generic viagra generic viagra for sale is there generic viagra

yabtrqin

cialis pills WilliamaLak

efecto cialis en mujeres
canadian pharmacy cialis
achat cialis belgique
cialis coupons
bringing cialis in thailand

nuyseloimmitteridphdt

canadian online pharmacy http://canadianpharmacyonlinesrvh.com/ - canada online pharmacy online canadian pharmacy online pharmacy canada canadian online pharmacy

hrfbdfhbeimmitterionnme

best place to buy generic viagra online http://sofiapharmku.com/ - cheapest generic viagra generic viagra for sale canadian generic viagra generic viagra for sale

scdbayvdimmitteriwnwfr

is trazodone a controlled substance http://trazodoneud.com/ - trazodone drug class trazodone 100mg trazodone 100 mg trazodone for sleep dosage

cialis cost WilliamaLak

viagra or cialis for pe
is there a generic for cialis
cialis with xanax
cialis
cialis buy from india

b1ziurmc

nuyseloimmittericsrtp

canadian pharmacy online http://canadianpharmacyonlinesrvh.com/ - best canadian online pharmacy online pharmacy canada canada drugs online canada drugs

cvhimxpz

Admimetib wklcv

Goamerydayday vbtww

jurxbgjxhtThyncgnxu

seroquel withdrawal http://quetiapineseroquelik.com/ - quetiapine davis pdf generic seroquel seroquel generic quetiapine side effects

cialis generic WilliamaLak

how many cialis can you take in a day
buy cialis online
what drugs should not be taken with cialis
buy cialis online
wildcat cialis review

Hoariaaxova vctzk