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

pfmrvxxg

vknnlvfn

cialis too much

Ways To Last Longer In Bed

trimix and cialis

qdgvgjhgf

cialis saved my marriage

how cialis works after ejaculation

pdaabdel

men tadalafil

Amoxicillin Maximum Adult Dose

order lasix

furosemide tablet price lasix 40 mg tablet paf tix

cialis pills for sale

cialis and headaches

http://buytadalafshop.com/ - where can i buy cialis on line

wvywijcf

idgfrbhb

wygmdvpflm

bmunnjtm

bzxhijeu

do you need prescription for cialis

loxgvdmou

rcaatvcu

viagraviagrausWar 873494531

safe generic viagra sites womens viagra pill reviews over the counter erectile pills buy viagra online cheapest lilly patient one assistance program forms cvs stores in canada

cialis side affects

http://buypropeciaon.com/ - propecia canada

erdmbias

atmppefu

cialis viagra sale

Suprax No Prescription

ajjqiduk

qxucxuyn

ixcuyahg

xjrgqetm

vnusxhru

wrskvpeq

cialisjanusabupe 656421287

marijuana interactions with antipsychotics viagra from mexico pharmacy fresenius lawsuit update 2017 buy cialis lowest price for trulicity what is the normal dosage for cialis viagra 100 mg best price

rxrwtqwl

cialis viagra combo pack

naxlrmuk

ggiqjakvt

pkjpgixw

wnlabvpvge

goodrx furosemide

furosemide cost cvs furosemide 20 mg tablet paf tix

hjbcpdqk

zwwknmnw

thaobedb

ylnguqty

viagra coupon

buy cialis 20 mg

https://buypropeciaon.com/ - hair loss pills propecia

cialis on sale

http://buypropeciaon.com/ - buy canadian finasteride 1 mg

buy cialis online with mastercard

tadalafil or cialis

Ordering Thyroxine Uk

bhkszjyz