Running RH FC4.
I want to redirect requests to local port 8080 to another server's port 80 (which is working). I tried:
echo 1 > /proc/sys/net/ipv4/ip_forward
/sbin/iptables -t nat -A PREROUTING -p tcp --dport 8080 -j DNAT --to 192.168.1.53:80
/sbin/iptables -t nat -A PREROUTING -p tcp --dport 8080 -j LOG --log-prefix "PREROUTING: " --log-tcp-options --log-ip-options
-----
when i try accessing 8080 with a browser, nothing seems to happen and eventually the browser times out.
The only lines showing in messages log on the server is:
Oct 11 15:01:02 ls2 kernel: Removing netfilter NETLINK layer.
Oct 11 15:01:03 ls2 kernel: ip_tables: (C) 2000-2006 Netfilter Core Team
Oct 11 15:01:03 ls2 kernel: Netfilter messages via NETLINK v0.30.
Oct 11 15:01:03 ls2 kernel: ip_conntrack version 2.4 (1920 buckets, 15360 max) - 224 bytes per conntrack
-----
Questions: what is the proper syntax for redirecting to the other server?
I may not know the interface number at all times - How can I get iptable to listen for a specific local ipaddress ?
How can I have the log entries go to a file other than the "messages" log file?
Thanks.
I want to redirect requests to local port 8080 to another server's port 80 (which is working). I tried:
echo 1 > /proc/sys/net/ipv4/ip_forward
/sbin/iptables -t nat -A PREROUTING -p tcp --dport 8080 -j DNAT --to 192.168.1.53:80
/sbin/iptables -t nat -A PREROUTING -p tcp --dport 8080 -j LOG --log-prefix "PREROUTING: " --log-tcp-options --log-ip-options
-----
when i try accessing 8080 with a browser, nothing seems to happen and eventually the browser times out.
The only lines showing in messages log on the server is:
Oct 11 15:01:02 ls2 kernel: Removing netfilter NETLINK layer.
Oct 11 15:01:03 ls2 kernel: ip_tables: (C) 2000-2006 Netfilter Core Team
Oct 11 15:01:03 ls2 kernel: Netfilter messages via NETLINK v0.30.
Oct 11 15:01:03 ls2 kernel: ip_conntrack version 2.4 (1920 buckets, 15360 max) - 224 bytes per conntrack
-----
Questions: what is the proper syntax for redirecting to the other server?
I may not know the interface number at all times - How can I get iptable to listen for a specific local ipaddress ?
How can I have the log entries go to a file other than the "messages" log file?
Thanks.