portforwarding just hangs
From: Avi (subhas85_at_gmail.com)
Date: 03/29/05
- Next message: VB: "Re: Installing samba in suse 9.0"
- Previous message: pizzy: "Re: Unsuccessful gateway. Too may arp coversations."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 29 Mar 2005 08:50:24 -0800
i currently have a linux machine acting as my router/server, i have
put together a file of commands to run if i ever need to reply the
iptable rules
#flush the tables
iptables --flush
iptables --table nat --flush
iptables --delete-chain
iptables --table nat --delete-chain
# Set up IP FORWARDing and Masquerading
iptables --table nat --append POSTROUTING --out-interface eth0 -j
MASQUERADE
iptables --append FORWARD --in-interface eth1 -j ACCEPT
echo 1 > /proc/sys/net/ipv4/ip_forward
# Allow loopback access. This rule must come before the rules denying
port access!!
iptables -A INPUT -i lo -p all -j ACCEPT
iptables -A OUTPUT -o lo -p all -j ACCEPT
iptables -A INPUT -p tcp -s 0/0 -d 0/0 --dport 2049 -j DROP
iptables -A INPUT -p udp -s 0/0 -d 0/0 --dport 2049 -j DROP
iptables -A INPUT -p tcp -s 0/0 -d 0/0 --dport 6000:6009 -j DROP
iptables -A INPUT -p tcp -s 0/0 -d 0/0 --dport 7100 -j DROP
iptables -A INPUT -p tcp -s 0/0 -d 0/0 --dport 515 -j DROP
iptables -A INPUT -p udp -s 0/0 -d 0/0 --dport 515 -j DROP
iptables -A INPUT -p tcp -s 0/0 -d 0/0 --dport 111 -j DROP
iptables -A INPUT -p udp -s 0/0 -d 0/0 --dport 111 -j DROP
iptables -A INPUT -p all -s localhost -i eth0 -j DROP
#setup portforwarding
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 222 -j DNAT --to
192.168.0.2:22
everything works except for the portfowarding. im tryin to allow
access via ssh to a machine within the internal network. The problem
is when i connect from outside, it hangs, it does not refuse the
connection, it just hangs there tryin to connect. It seems to work
half-way but not completely, am i missing something?
- Next message: VB: "Re: Installing samba in suse 9.0"
- Previous message: pizzy: "Re: Unsuccessful gateway. Too may arp coversations."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]