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

hwxjtreglsjdsadevygd

no prescription cialis https://cilisnoprescription.com/ - online doctor prescription for cialis how do i get a prescription for cialis buy cialis no prescription how do i get a prescription for cialis

bfbagzyvdimmitterinhmnl

is generic viagra available https://genericvigrarja.com/ - canadian pharmacy generic viagra generic viagra canada viagra generic generic viagra online canadian pharmacy

bfbagzyvdimmitteriffdik

when will viagra be generic https://genericvigrarja.com/ - is generic viagra safe when will generic viagra be available generic name for viagra best place to buy generic viagra forum

v89ufuh i65qoz

Thank you, Wonderful stuff! lexapro

hwxjtreglsjdsadevypr

how to get a prescription for cialis https://cilisnoprescription.com/ - buy cialis online no prescription how to get a cialis prescription buying cialis without a prescription no prescription cialis

sehyloimmitteriwtscw

100mg viagra first time https://vigramg.com/ - generic viagra 150 mg pills cheap generic viagra 100mg side effects of viagra 100mg is 20mg cialis equal to 100mg viagra

pfizer brand viagra 100mg

hfgdfhbeimmitterilqnmg

п»їviagra without a doctor prescription https://vigraprescription.com/ - viagra no prescription viagra without a doctor prescription usa buy viagra online no prescription do you need prescription for viagra

how to order viagra from canada

bfbagzyvdimmitteriycvsx

best place to buy generic viagra forum https://genericvigrarja.com/ - viagra generic generic viagra prices when does viagra become generic viagra online generic

sqhvtpcy

hwxjtreglsjdsadevysb

how to get cialis prescription online https://cilisnoprescription.com/ - buy cialis online without prescription do you need a prescription to buy cialis cialis prescription online buy cialis online no prescription

v23jqcm r47osd

Kudos. I like this. buy viagra online

comprare viagra online sicuro

can i buy viagra without a prescription canadian pharmacy best price viagra 100mg costco cheap viagra overnight delivery viagra samples buy pfizer brand viagra online cheap ed meds online ed medicines generic for erectile dysfunction ed medications best ed medication what are the best generic ed drugs online erectile dysfunction medications ed medications compared cheap ed medication ed medications online ed drugs online best erectile dysfunction medication in canada ed drugs meds for ed erectile dysfunction medications sold in canada erectile dysfunction drugs generic ed drugs cheap erectile dysfunction drugs-canada canadian erectile dysfunction drugs ED medication order erectile dysfunction medication generic drugs for erectile dysfunction erectile meds ed drug cost comparison buy erectile dysfunction drugs generic ed medication erectile dysfunction medication prices ed meds on line cheap ed drugs best erectile dysfunction drugs for sale online erectile dysfunction drugs online meds for erectile dysfunction generic ed meds erectile dysfunction drugs canada ed drug best ed drug best deal on ED meds cheap ed meds medication from canada ed erectile dysfunction generic name for ED drugs buy erectile dysfunction drugs online cheap erectile dysfunction medication generic erectile dysfunction medications erectile dysfunction drugs comparison impotence drugs online common drugs for ed generic impotence drugs ed meds cost effective ed drugs canadian erectile dysfunction drugs rosa impex pvt ltd cialis cost vs viagra cost amoxicillin without prescription

buy viagra in ontario

buy viagra online with no prescription canadian pharmacy online no script low cost viagra generic viagra for sale viagra samples from pfizer brand viagra with fast delivery cheap ed meds online ed medicines generic for erectile dysfunction ed medications best ed medication what are the best generic ed drugs online erectile dysfunction medications ed medications compared cheap ed medication ed medications online ed drugs online best erectile dysfunction medication in canada ed drugs meds for ed erectile dysfunction medications sold in canada erectile dysfunction drugs generic ed drugs cheap erectile dysfunction drugs-canada canadian erectile dysfunction drugs ED medication order erectile dysfunction medication generic drugs for erectile dysfunction erectile meds ed drug cost comparison buy erectile dysfunction drugs generic ed medication erectile dysfunction medication prices ed meds on line cheap ed drugs best erectile dysfunction drugs for sale online erectile dysfunction drugs online meds for erectile dysfunction generic ed meds erectile dysfunction drugs canada ed drug best ed drug best deal on ED meds cheap ed meds medication from canada ed erectile dysfunction generic name for ED drugs buy erectile dysfunction drugs online cheap erectile dysfunction medication generic erectile dysfunction medications erectile dysfunction drugs comparison impotence drugs online common drugs for ed generic impotence drugs ed meds cost effective ed drugs canadian erectile dysfunction drugs rosa impex pvt ltd viagra cialis vs viagra amoxicillin with no prescription

brand viagra

buy viagra online with no prescription canadian pharmacy no prescription best price for generic viagra brand viagra with fast delivery real pfiefer viagra authentic viagra pfizer brand cheap ed meds online ed medicines generic for erectile dysfunction ed medications best ed medication what are the best generic ed drugs online erectile dysfunction medications ed medications compared cheap ed medication ed medications online ed drugs online best erectile dysfunction medication in canada ed drugs meds for ed erectile dysfunction medications sold in canada erectile dysfunction drugs generic ed drugs cheap erectile dysfunction drugs-canada canadian erectile dysfunction drugs ED medication order erectile dysfunction medication generic drugs for erectile dysfunction erectile meds ed drug cost comparison buy erectile dysfunction drugs generic ed medication erectile dysfunction medication prices ed meds on line cheap ed drugs best erectile dysfunction drugs for sale online erectile dysfunction drugs online meds for erectile dysfunction generic ed meds erectile dysfunction drugs canada ed drug best ed drug best deal on ED meds cheap ed meds medication from canada ed erectile dysfunction generic name for ED drugs buy erectile dysfunction drugs online cheap erectile dysfunction medication generic erectile dysfunction medications erectile dysfunction drugs comparison impotence drugs online common drugs for ed generic impotence drugs ed meds cost effective ed drugs canadian erectile dysfunction drugs rosa implex pvt ltd tadalafil generic vs cialis buy amoxicillin 500mg no prescription

uzwmmhix

mumyvlbu

cheap viagra for sale

generic viagra no prescription

tohcmgfx

Encouch

viagra soft

gzozchkt

d83kmoz p99xku

Nicely put. Thanks a lot. https://cheap-retin-a-micro.com/

viagra europe

Davidpaino

http://viagrasideeffects28.com/ side effects of viagra for men
http://viagrasideeffects28.com/ ">possible side effects of viagra

cheap viagra

hrgjwgfsdvsegififleconnarednga

levitra cost https://levitramg1.com/ - levitra for women levitra for sale online cost of levitra generic levitra online pharmacy