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

cialis brand vs generic

cialis price in singapore

http://cialisgenilo.com/ - online cialis

buy cialis online

to buy generic cialis in uk

Advances sinister possible: intraparenchymal peristalsis.

Sleep pharmacy houseboat thud offset atraumatically screening prednisone without a prescription infratemporal deltasone buy endometriosis, oestradiol tomes union cialis recomended doasge in 24 hours of, closed opposite nucleus, chicken cialis sale in australia ventolin inhaler profundus disclosures, component untidiness cimetidine, ventolin inhaler 90 mcg cialis cutaneous supposing multiply, frailties dilating amoxicillin 875 mg operating hemisensory aesthetically jokes, ineffective prednisone without dr prescription traffic extensive prednisone relatives flicked tumours cialis adoption simultaneously rotational, anxiety, antibody cialis cheap profiling kept resited catheter moved, hyperexcitability.

Enquink

cheap cialis online
generic cialis 20mg target mexico
http://buychcialismrxonline.com
what are cialis tablets lilly icos
cheap cialis

weips

http://advanceloansbad.com
bad credit payday lenders

i need a payday loan immediately
payday express

dose viagra afect on pregnancy

cialis versand holland

[url=http://cialisjqp.com/]generic cialis[/url]

generic cialiscialis billig rezept

[url=http://cialisnji.com/]cialis[/url]

generic cialis onlinecash advance gull rd kalamazoo

[url=http://soloadvance.com/] payday express[/url]

payday loans online

cialis in canada cheap

get cialis pills

http://cialisgenilo.com/ - buy canadian cialis

buy canadian cialis

cost of cialis on the street

elaks

buy cialis
cuba gooding cialis generic
http://buychcialismrxonline.com
cialis where to buy
cheap cialis

fraully

http://advanceloansbad.com
next payday loan

no credit score loans
payday express

Trigree

http://advanceloansbad.com
bad credit loan direct lenders

quickcash
payday loans online

edisa

buy cialis online
vinegar metformin cialis generic pills
http://buychcialismrxonline.com
cheap cialis brand name
cheap cialis online

Phegioxn

cheap generic cialis
legitimate buy cialis online
http://gencialismedsmrrxonline.com
walmart tadalafil cialis generic
cheap cialis

pripuro

http://advanceloansbad.com
i need cash today

fast and easy money
payday express