LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-12-2015, 09:39 AM   #1
gengyabc
LQ Newbie
 
Registered: May 2015
Posts: 2

Rep: Reputation: Disabled
questions about iptables


Hi everyone
I have a question about iptables

This line
Code:
iptables -A INPUT -p tcp  -m tcp --dport 80 -j ACCEPT
why there is a "-m tcp"? what does this mean? I checked some book and man, I did not find what does this mean.

Thank you very much for your help.
 
Old 05-12-2015, 10:26 AM   #2
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Welcome to LQ!
at http://ipset.netfilter.org/iptables.man.html shows
Code:
       -m, --match match
              Specifies a match to use, that is, an extension module that tests for a specific property. The set  of
              matches  make up the condition under which a target is invoked. Matches are evaluated first to last as
              specified on the command line and work in short-circuit fashion, i.e. if one extension  yields  false,
              evaluation will stop.
What that means exactly, I don't know, never had to use or implement it or if it involves a rule named tcp.
 
Old 05-12-2015, 10:26 AM   #3
lazydog
Senior Member
 
Registered: Dec 2003
Location: The Key Stone State
Distribution: CentOS Sabayon and now Gentoo
Posts: 1,249
Blog Entries: 3

Rep: Reputation: 194Reputation: 194
'-m' = Match

Code:
-m, --match match
Specifies a match to use, that is, an extension module that tests for a specific property. The set of matches make up the 
condition under which a target is invoked. Matches are evaluated first to last as specified on the command line and work in 
short-circuit fashion, i.e. if one extension yields false, evaluation will stop.
 
Old 05-13-2015, 09:12 AM   #4
gengyabc
LQ Newbie
 
Registered: May 2015
Posts: 2

Original Poster
Rep: Reputation: Disabled
Thank you very much.
then I will not use -m tcp.
 
  


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
iptables questions linuxcoo Linux - Newbie 5 03-29-2010 03:06 AM
2 questions about iptables . jean2e Linux - Security 6 04-30-2009 05:34 AM
iptables questions hattori.hanzo Linux - Networking 1 05-16-2008 07:31 AM
iptables questions FNC Linux - Security 3 07-12-2007 06:42 PM
iptables questions notsosmart Linux - Security 2 10-15-2006 12:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:04 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