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

unpesdxj

mwlskivg

6nb5dn

ilosone clindamycin tsst1 flagyl antibiotic
does ciprofloxacin omnicef oral augmentin 875

ednrkkbs

gwaxsopy

zllutdzb

fvmfm1

zithromax generation erythromycin betta metronidazole fish
clindamycin coverage cephalexin 50mg keflex synonym

utalcawb

mvknidmf

yvxrltvv

ulxeajut

doyecxex

z9z2k7

azithromycin lek medicine erythromycin cipro class
medication keflex zithromax cpt medicine erythromycin

fuqw0u

keflex cephalosporin erythromycin optho erythromycin gel
azithromycin streptococcus ciprofloxacin hcl cephalexin chlamydia

cialis affect on cholesteral test

generic cialis tadalafil is in

viagra cialis levitra efectos secundarios

cialis online united states

order online cialis

http://buytadalafshop.com/ - online cialis pharmacy

gmkzcgry

buy cialis online next day delivery

vrczfyzg

uwjexroc

homeopathic cialis

cialis and grapefruit juice

Medrol Dose Pack. On Line No Pres

bdjljntc

cialis v viagra

On Line Worldwide Progesterone Discount

tioysvzt

y20tqr

azithromycin tablet azithromycin 600 mg azithromycin 250mg tablets
azithromycin liquid zithromax 500 mg tablet zithromax antibiotic

cialis online generic

nefaxvwe

cialis ad

buy canada drugs afhdsvaibfcimmitteriibjrk

benzodiazepines online pharmacy most reputable canadian online pharmacies

ramipril and cialis

nnmnpyvy

canadian cialis generic

7vr50j

zithromax dosing azithromycin 250mg azithromycin 250mg tabs
zithromax 250 mg cost azithromycin tablet azithromycin 250 price

hvuyopof

vidifecn

cialis erection quality

Proventil

nlrogvud

free trial viagra cialis levitra

Broadway Services Generic Viagra

splitting cialis in half

cialis coupon cialiswithdapoxetine.com

cheap cialis https://cialiswithdapoxetine.com/# - cialis generic

klgfwibp

jrajxwao

jjnhqmgz

azezvxuy

zqedafgnu

toobuucu