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

scedo

http://tadalafil777.com/
spam viagra cialis generic levitra
buy generic cialis online
generic cialis india
buy generic cialis online

generic cialis online BernardRIP

taking cialis 5mg daily
http://cialisbprx.com - cialis
how long is cialis good for after expiration date
http://cialisbprx.com/
cialis amiodarone
buy cialis online
cialis online to australia

cialis one day pill

cialis generico fiable

http://candiancialisuy.com/ - cialis cheap

cialisbuy girl viagra online

http://viagralkas.com/ - viagra cheap

generic viagra onlinebargain viagra

http://viagranelius.com/ - viagra online

cheap viagra online

cialis sans ordonnance achete

taking cialis and alcohol

http://candiancialisuy.com/ - buy cialis online

cialis genericcheapest viagra ever

http://viagralkas.com/ - canadian viagra

buy viagraviagra generika kaufen paypal

http://viagranelius.com/ - generic viagra

cheap viagra online

Inwashy

http://tadalafil777.com/
buying cialis in canada fast shipping cialis
buy cialis online
online cialis no prescription
cheap cialis online

hvzmvjijbsuh - 84922916

Ghostwriter for Homework Assignments pcejwbfcpzxz - 64119684

cialis online BernardRIP

effect of cialis on sperm motility
http://cialisbprx.com - buy generic cialis
where can i buy cialis in thailand
cialis online
wirkung von cialis 5 mg
cialis online
cialis to take effect

Inadace

http://tadalafil777.com/
how much is viagra at walmart cialis generic
cialis online
magnus sildenafil cialis generic pills
buy cialis online

buy cialis online BernardRIP

cialis direkt in holland kaufen
http://cialisbprx.com - cialis online
cialis bayan azdД±rД±cД±
buy cialis
what do you do when cialis does not work
buy generic cialis
where to buy cialis in nigeria

buy viagra online

is it safe to take viagra and hydrocodone viagra online special warnings for viagra buy viagra can you take viagra in your 20s

generic viagra 100mg by GaireEmople

cost of viagra at walgreens http://viagrraver.com buy viagra online, buy tadalafil united states

cheap generic viagra by GaireEmople

can you take advil and viagra generic viagra canada are there any long term side effects of cialis

viagra 50 mg cheap JosephGon

q http://www.viagrarow.com viagra without a doctor prescription
viagra generico in farmacia best way to cut viagra in half