Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Ronin Magus

Iptables help

This topic is 5770 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''m trying to set up iptables on this linux machine, and all I want allowed are ftp and www. So I should allow only ports 21 and 80, right? Well why doesn''t this work: Before I block any ports, I can ftp in to localhost and I can connect to localhost in a web browser just fine. but after I run these iptables commands: #iptables -A INPUT -p TCP --sport 0:20 -j DROP #iptables -A INPUT -p TCP --sport 22:79 -j DROP #iptables -A INPUT -p TCP --sport 81:65535 -j DROP I cannot ftp in or connect to localhost in a web browser. I supposedly left ports 21 (ftp) and 80 (www) open, I assume.. so why can''t I get in? I can FTP in and WWW in up until the point I block ports 81-65535. I also noticed that I can''t get anything out. Did I block a network port or something? What am I doing wrong?

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
You blocked the wrong end of the connection (sport is `source'' port, not `server'' port). Use --dport instead.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!