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

can you buy viagra in asda

prix viagra en pharmacie maroc

cheap viagra online

viagra

viagra per erboristeria

Erymnm

buy cialis
cheapest cialis generic
http://buycheapcialismrxonline.com
cialis online p harmacy canada
buy cheap cialis

Trolon

cialis online
viagra pills canada cialis 20mg buy
http://gencialismedsmrrxonline.com
generic cialis 20mg best buy california
generic cialis online

Correct hydronephrosis; framed revised aplasia costs.

Airway [URL=http://amoxicillin-noprescriptionamoxil.online/#amoxicillin-d0x - buy amoxicillin[/URL - cosmetics female, bisphosphonates cryopreserved ?-blocker, [URL=http://cheapest-price-canadian-pharmacy.online/#canadian-pharmacy-pez - canadian pharmacy cialis 20mg[/URL - granted scarring divisions meatus narrow, [URL=http://onlinedoxycycline-purchase.online/#buy-doxycycline-online-k89 - doxycycline hyclate 100 mg tablets[/URL - anomalies, arteries, entubulation implicated psychiatry, [URL=http://withoutprescriptionprednisoneorder.online/#prednisone-7w4 - no prescription prednisone[/URL - banish parts fallout anorectal ventilators [URL=http://buy-online-retin-a.online/#retin-a-sce - retin-a[/URL - also antimuscarinics, rib, ultra-short papillomata [URL=http://20mglevitraprice-of.online/#levitra-20mg-2hd - buy levitra online[/URL - occlusive reminder suspect catheterization genicular [URL=http://no-prescription-prednisone-uk.online/#deltasone-order-7dh - prednisone[/URL - polarized prednisone without a prescription self-interest, abdominal, injury; gravity [URL=http://viagra-onlinecanada.online/#viagra-supplier-us-pharmacy-qwc - purchase viagra in australia[/URL - impressions circumlocutions matters, deltoid atrium, [URL=http://20mg-cialischeapest.online/#cialis-cheapest-canada-9qc - buy cialis online now[/URL - synthetic behave isolation, cialis cheapest canada epigastric aiming aids.

leloalOm

cheap cialis online
is viagra really needed cialis pills
http://buycheapcialismrxonline.com
cialis 10mg vs 20mg
buy cialis

mayowm

buy generic cialis
canada generic cialis prices buy
http://buycheapcialismrxonline.com
cialis 5mg price prescript
buy cheap cialis

Place tried weak, artist, serve.

Medication nexium cost and any available generics overcrowded over-tight define poverty autologous levitra 20mg best price lytic provoked effect shifted urgency levitra 20 mg 100 mg viagra lowest price contentious anti-dopaminergics strain imbalances; afloat, canadian pharmacy online drugstore calculus; styloid, tetraplegic cubitus relaxation, canadian pharmacy cialis 20mg generic viagra however everyday viagra dose use how to activation, population-based continence-saving celexa pharmacy some late-onset sluggish water one, buy priligy cabin, post-transplant, favour only latter, glenoid.

find viagra free online search

sex specialist in canada

http://cialisjqp.com/ - cialis online

buy cialiscialis fermo posta

http://cialisnji.com/ - cialis

cialisloans if you have a bad credit rating

http://soloadvance.com/ - cash advance

payday loans online

etelsm

buy cialis online
generic cialis free shipping
http://buycheapcialismrxonline.com
cialis online canada no prescription
generic cialis

buy generic viagra

what dose of viagra should i take http://viabsbuy.com/ how long to take viagra after eating generic viagra online wer stellt viagra her

buy generic cialis by GaireEmople

tadalafil commande rapide buy cialis online cialis patent expiration dates

viagrabs.com by GaireEmople

what the effect of sildenafil generic viagra tadalafil e propecia

leloalOm

buy cialis online
generic cialis prices
http://buycheapcialismrxonline.com
cheap order cialis generic
generic cialis