SSL Question
Hello,
I am wondering if this will work... We are using NAT, and I currently have 2 different webservers that we need to put SSL on.
Each webserver has a different external DNS entry (I am using 55.55.55.56 and 55.55.55.57 as examples). Each actual webserver is on its own internal IP address (192.158.0.14 and 192.168.0.15, respectively).
Can I do something like this:
iptables -t nat -A PREROUTING -p tcp -d 55.55.55.56 --dport https -j DNAT --to 192.168.0.14:443 iptables -t nat -A PREROUTING -p tcp -d 55.55.55.57 --dport https -j DNAT --to 192.168.0.15:443
Does this work? If it doesn't, how do I do this? This is driving me nuts!
TIA!!!
-N
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
Quoted 6 lines · nakisawame
I am wondering if this will work... We are using NAT, and I currently have 2 different webservers that we need to put SSL on.
Each webserver has a different external DNS entry (I am using 55.55.55.56 and 55.55.55.57 as examples). Each actual webserver is on its own internal IP
Quoted 8 lines
address (192.158.0.14 and 192.168.0.15, respectively). Can I do something like this:
iptables -t nat -A PREROUTING -p tcp -d 55.55.55.56 --dport https -j DNAT --to 192.168.0.14:443 iptables -t nat -A PREROUTING -p tcp -d 55.55.55.57 --dport https -j DNAT --to 192.168.0.15:443 Does this work? If it doesn't, how do I do this? This is driving me nuts!
Yes it will work, as long as your webservers are correctly configure to handle external DNS name and according certificate.
Signature · 2 lines
http://www.netexit.com/~sid/ PGP KeyID: 157E98EE FingerPrint: FA62226DA9E72FA8AECAA240008B480E157E98EE
Hi Nakisawame,
Quoted 9 lines
Can I do something like this:
iptables -t nat -A PREROUTING -p tcp -d 55.55.55.56 --dport https -j DNAT --to 192.168.0.14:443 iptables -t nat -A PREROUTING -p tcp -d 55.55.55.57 --dport https -j DNAT --to 192.168.0.15:443
Does this work? If it doesn't, how do I do this? This is driving me nuts!
This should definitely work. If it doesn't, it's probably because either you forgot to turn on IP forwarding
(echo 1 > /proc/sys/net/ipv4/ip_forward), or you haven't added a corresponding filter rule to allow the traffic through:
iptables -t filter -I FORWARD -d 192.168.0.14 -p tcp --dport 443 \
-j ACCEPT
iptables -t filter -I FORWARD -d 192.168.0.15 -p tcp --dport 443 \
-j ACCEPT
Cheers, Chris.
Signature · 4 lines
___ __ _ / __// / ,__(_)_ | Chris Wilson -- UNIX Firewall Lead Developer | / (_ / ,\/ _/ /_ \ | NetServers.co.uk http://www.netservers.co.uk | \ _//_/_/_//_/___/ | 21 Signet Court, Cambridge, UK. 01223 576516 |