Linux - SecurityThis forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm experiencing problems with ftp using iptables
From the machine where iptables lives it seems to work when I try to connect to a ftp server on the internet.
But from my local lan it doesn't, from a windows command it gets stuck on when i do a ls or dir
port command successful.considering using pasv
here comes the directory listing
My rules are basic
# All connections go out
iptables -A FORWARD -s $local_net -d $internet -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A FORWARD -s $internet -d $local_net -m state --state ESTABLISHED -j ACCEPT
# Active mode - port 20
iptables -A FORWARD -p tcp -s $local_net --sport 1024:65535 -d $internet --dport 20 -m state --state ESTABLISHED -j ACCEPT
iptables -A FORWARD -p tcp -s $internet --sport 20 -d $local_net --dport 1024:65535 -m state --state RELATED,ESTABLISHED -j ACCEPT
And on the nat table i have
iptables -t nat -A POSTROUTING -s $local_net -o eth0 -j SNAT --to $extfw
First question :
Using active mode the data channel is opened by the server, are the data automaticly nated back to my machine using this postrouting rule or should i write a prerouting rule ?
Because the packets on the data channel don't know that they have to come back to my machine (192.168.0.226)
Second q:
Have anybody resolved that problems in another way, i read somewhere that the irc conn_tracking where interfering with the ftp one
actually my pb is on the forward chain, input and output are ok.
I don't know if it's the firewall though because, i had pb with my windows workstation (as usual)
thanx anyway
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.