LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 06-03-2006, 04:32 AM   #1
crash88
Member
 
Registered: May 2006
Posts: 39

Rep: Reputation: 15
simple packet filtering


I read the manpage and the only time they use --dest-port or -dport is when they're using an extension.
I just wanted to do some basic filtering without extensions. I tried:
iptables -A INPUT -p all -dports 6000 -j DROP
and I got that 6000 was an invalid argument.
So I try different syntax using --dst-port and it saays that dst-port isn't correct syntax. I just have 3 or 4 ports to block for a short period of time. Am I doing something wrong?
 
Old 06-03-2006, 06:37 AM   #2
Capt_Caveman
Senior Member
 
Registered: Mar 2003
Distribution: Fedora
Posts: 3,658

Rep: Reputation: 69
-p all includes a wide number of protocols besides tcp and udp such as icmp, gre, etc (see /etc/protocols). Many of them don't have a concept of a 'port' like icmp for example. So you need to specify the tcp or udp protocol. Also use two dashes for the secondary options like -p tcp --dport 6000
 
Old 06-03-2006, 10:25 PM   #3
crash88
Member
 
Registered: May 2006
Posts: 39

Original Poster
Rep: Reputation: 15
That did the trick. What exactly is mangling in the sense of a firewall? What function does it serve?
 
Old 06-04-2006, 05:43 PM   #4
Capt_Caveman
Senior Member
 
Registered: Mar 2003
Distribution: Fedora
Posts: 3,658

Rep: Reputation: 69
The mangle table is used for modifying various parts of the packet. For incoming packets, it allows you to change these parameters before any routing decisions are made which is useful in certain situations. It's extrememly important not to do any filtering or NAT in this table as the rules will be ignored. In most situations you won't ever need to do any mangling, but if you wanted to change the TTL of an outgoing packet (to hide the fact that it's behind a NAT firewall) then you could modify the TTL in the mangle table. This is a really great HOWTO that can explain iptables pretty well, take a look:

http://iptables-tutorial.frozentux.n...-tutorial.html
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
packet filtering !!! need help aashish.verma Linux - Networking 2 05-24-2006 10:29 AM
Packet filtering firewall Maintech Slackware 3 10-30-2005 11:34 AM
packet filtering majeztik Linux - Security 2 04-09-2005 01:34 AM
Packet Filtering empre55 Linux - Newbie 1 03-20-2005 09:10 AM
Packet Filtering simmid Linux - Networking 0 09-18-2001 02:05 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 11:34 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration