Hi there.
I was trying to setup port forwarding on my setup.
My network consists of:
Code:
[Server: xxx.xxx.xxx.15]
|
|
[ switch ]
|
|
[ eth0:xxx.xxx.xxx.254 ]
[Linux ]
[ eth1:yyy.yyy.yyy.156 ]
|
|
{ Router }
I ran the following 2 commands:
# iptables -t nat -A PREROUTING -i eth1 -p tcp -m tcp --dport 80 -j DNAT --to-destination xxx.xxx.xxx.15:80
# iptables -A INPUT -i eth1 -p tcp -m tcp --dport 80 -j ACCEPT
Yet I am unable to connect.
Are these the correct commands?
I am using IP Masquedering on the same box using the following commands:
Code:
$IPTABLES -P INPUT ACCEPT
$IPTABLES -F INPUT
$IPTABLES -P OUTPUT ACCEPT
$IPTABLES -F OUTPUT
$IPTABLES -P FORWARD DROP
$IPTABLES -F FORWARD
$IPTABLES -A FORWARD -i eth1 -o eth0 -m state --state ESTABLISHED,RELATED -m limit --limit 1/s -j LOG --log-prefix '------------OUT-------------'
$IPTABLES -A FORWARD -i eth1 -o eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT
$IPTABLES -A FORWARD -i eth0 -o eth1 -m limit --limit 1/s -j LOG --log-prefix '-------------IN--------------'
$IPTABLES -A FORWARD -i eth0 -o eth1 -j ACCEPT
$IPTABLES -A FORWARD -j LOG
I don't think there is a hidden firewall in the switch but if these commands are correct, then I may need to contact my ISP and see if they are blocking the commands.
I just wanted to make sure I was not doing some stupid mistake before I try to contact my ISP.
EDIT:
Also, is it possible to forward Port 80 requests to different servers depending on the hostname used to connect, so say yyy.com redirects to server xxx.xxx.xxx.15 while hhh.com redirects to xxx.xxx.xxx.16?
Edit:
Problem lied with the ISP. They were blocking all incoming requests.