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

buy real viagra

Generic Viagra For Sale Online

Generic Viagra Real viagraxcv.com - Viagra Generic India

eggeuyseloimmitteriftrgt

trazodone for sleep http://trazodoneft.com/ - trazodone side effects trazodone hydrochloride trazodone generic trazodone dosage for dogs

rj0zs0rb

cw3wvivj

rygsxtwh

p2c8letk

discount viagra pills

eggeuyseloimmitterisvuzd

trazodone 100 mg http://trazodoneft.com/ - trazodone for sleep trazodone 50 mg trazodone and alcohol trazodone dosage for sleep

spill viagra michigan revives

4e9d donde comprar viagra y cialis

http://ph-596de-2-0.com/ - generic viagra

viagra durata effett

Hoariaaxova euzmx

Where To Order Generic Viagra

Buy Generic Viagra Online Usa https://www.viagraxcv.com/ - buy viagra online - Best Online Generic Viagra Site

lialstaus rsplj

aperurn

Cialis 5 mg online http://cialisknfrx.com is generic cialis from india safe

hkggolsjdsadevysw

weaning off effexor http://venlafaxineeffexorhf.com/ - generic for effexor venlafaxine hcl er 37.5 mg venlafaxine 75 mg pristiq vs effexor

Pfizer Viagra Generic

Can You Buy Generic Viagra In The Usa https://www.viagraxcv.com/ - buy viagra - Where Is The Best Place To Buy Generic Viagra Online

samples of viagra and cialis CarlosFutty

working of viagra video
viagra online
how to get real viagra without prescription
want to buy viagra online
prix viagra thailande

hkggolsjdsadevylv

venlafaxine http://venlafaxineeffexorhf.com/ - effexor for anxiety venlafaxine venlafaxine hcl er 37.5 mg venlafaxine withdrawal

viagra online CarlosFutty

love and other drugs viagra
viagra 100mg
how do i know viagra is working
generic viagra
why is viagra bad for the heart

hrdfhbeimmitterilajbr

celexa and weightloss http://citalopramcelexaad.com/ - citalopram uses citalopram hydrobromide citalopram 10mg citalopram side effect

tqipizcqox

viagra online CarlosFutty

viagra and cialis best price
buy viagra online
viagra in jeder apotheke
generic viagra
bloodshot eye viagra

Cheapest Generic Viagra Prices Online

Generic Viagra Pills Online viagra pill - Generic Viagra Online

injebyben jmeqr

hkggolsjdsadevykj

effexor withdrawal http://venlafaxineeffexorhf.com/ - side effects of effexor venlafaxine warnings generic effexor venlafaxine overdose