Linux Netfilter discussions
 help / color / mirror / Atom feed
* multiports
@ 2005-08-04 19:36 Peggy Kam
  2005-08-05  6:34 ` multiports Jan Engelhardt
  0 siblings, 1 reply; 28+ messages in thread
From: Peggy Kam @ 2005-08-04 19:36 UTC (permalink / raw)
  To: netfilter

Hi,

Is it possible to match multiple source and destination ports at the
same time?  It seems to me that it is not possible.  I am using iptables
version 1.2.11 and I have tried the following command:

iptables -A INPUT -p tcp --src 192.168.1.0/255.255.255.0 -m tcp -m
multiport --sports 22,80  --dst 192.168.22.123 -m multiport --dports
22,80 -j ACCEPT

Please correct me if I have the wrong syntax.  Any advice is
appreciated.

Thanks in advance,
Peggy



^ permalink raw reply	[flat|nested] 28+ messages in thread
[parent not found: <47fc8b35.0e1f400a.4de1.0570@mx.google.com>]
* Iptables Rules
@ 2008-04-08 22:01 Minh Cao
  2008-04-09  4:12 ` Jan Engelhardt
  0 siblings, 1 reply; 28+ messages in thread
From: Minh Cao @ 2008-04-08 22:01 UTC (permalink / raw)
  To: netfilter

Hi, 
Is that matter if I placed the options/extensions ( -m
and -p ) in different orders ? 

Please tell me these 4 configurations make any
difference ... in term allows ssh to my workstation. 


-A INPUT -s 1.2.3.0/24 -p tcp -m tcp --dport 22 -j
ACCEPT 


-A INPUT -s 1.2.3.0/24 -m tcp -p tcp --dport 22 -j
ACCEPT 


-A INPUT -s 1.2.3.0/24 -p tcp -m state --state NEW -m
tcp --dport 22 -j ACCEPT 


-A INPUT -s 1.2.3.0/24 -m state --state NEW -m tcp -p
tcp --dport 22 -j ACCEPT 


Thanks ! 




^ permalink raw reply	[flat|nested] 28+ messages in thread
* Iptables rules.
@ 2007-09-22 18:57 Shams Fantar
  2007-09-22 19:32 ` Eljas Alakulppi
  2007-09-22 19:44 ` Mike Wright
  0 siblings, 2 replies; 28+ messages in thread
From: Shams Fantar @ 2007-09-22 18:57 UTC (permalink / raw)
  To: netfilter

Hello,

I am writing iptables rules. Here is the rules, they are in a script : 
http://jumble.snurf.info/iptables-start

When I use it, It blocks all access to the network. Why ?

Do you have suggestions for my rules ?

Regards,

-- 
Shams Fantar (http://snurf.info)


^ permalink raw reply	[flat|nested] 28+ messages in thread
* RE: Iptables rules...
@ 2002-09-09  4:06 Didier Hung Wan Luk
  0 siblings, 0 replies; 28+ messages in thread
From: Didier Hung Wan Luk @ 2002-09-09  4:06 UTC (permalink / raw)
  To: Antony Stone, Netfilter Mailing List

Thanks :-))

Didier Hung Wan Luk
FRCI, Sibotie House
L'Anse Courtois
Pailles
Tel: 230-2869636
Fax: 230-2869629


-----Original Message-----
From: Antony Stone [mailto:Antony@Soft-Solutions.co.uk] 
Sent: Saturday, September 07, 2002 2:37 PM
To: Netfilter Mailing List
Subject: Re: Iptables rules...

On Saturday 07 September 2002 10:39 am, Didier Hung Wan Luk wrote:

> Hi All,
>
>
> I am new to firewall/iptables can someone help me to clear up some concepts
> about firewalling?
>
> If my default rule for the input chain of my external interface is DROP
> need I again specify to DROP packets in the INPUT chain of my external
> interface?

There is only one INPUT chain.   The rules and the default policy apply to 
all interfaces.

> #My Default rule
> iptables -P INPUT DROP
>
> #Drop all attempts on my ext. interface trough port 6000:6063
>
> iptables -A INPUT -i ppp0 -p tcp --dport 6000:6063 -j DROP
>
> If I am right I think that I need not include a rule again saying to drop
> packets to my 6000;6063 ports since I do not have a rule saying to accept
> connections on these ports...

If you have a default DROP policy, then you should not (normally) need to 
specify any DROP rules.   If you do not have a rule ACCEPTing certain 
packets, then they will be DROPped by default.   That is what the policy is 
for.

For example:

iptables -P INPUT DROP
iptables -A INPUT -p tcp --dport 80 -j ACCEPT

will drop SMTP traffic on port 25, because there is no rule ACCEPTing it.

These rules will also drop POP3, IMAP, FTP, IDENT.......   everything except 
HTTP.

Antony.

-- 

90% of network problems are routing problems.
9 of the remaining 10% are routing problems in the other direction.
The remaining 1% might be something else, but check the routing anyway.



^ permalink raw reply	[flat|nested] 28+ messages in thread
* Re: Iptables rules...
@ 2002-09-07 11:59 ashivale
  0 siblings, 0 replies; 28+ messages in thread
From: ashivale @ 2002-09-07 11:59 UTC (permalink / raw)
  To: Didier Hung Wan Luk; +Cc: Netfilter Mailing List

[-- Attachment #1: Type: text/plain, Size: 865 bytes --]

Hi,
The default policy you set is the default for all the packets in that chain. Hence you need not specify it again for the INPUT chain.
bye,
Amit

Didier Hung Wan Luk wrote:
> Hi All,
> 
> 
> I am new to firewall/iptables can someone help me to clear up some concepts about firewalling?
> 
> If my default rule for the input chain of my external interface is DROP need I again specify to DROP packets in the INPUT chain of my external interface?
> 
> i.e..
> 
> #My Default rule
> iptables -P INPUT DROP
> 
> #Drop all attempts on my ext. interface trough port 6000:6063
> 
> iptables -A INPUT -i ppp0 -p tcp --dport 6000:6063 -j DROP
> 
> If I am right I think that I need not include a rule again saying to drop packets to my 6000;6063 ports since I do not have a rule saying to accept connections on these ports...
> 
> Thanks,
> 
> Didier Hung Wan Luk
> 
> 


^ permalink raw reply	[flat|nested] 28+ messages in thread
* Iptables rules...
@ 2002-09-07  9:39 Didier Hung Wan Luk
  2002-09-07 10:36 ` Antony Stone
  0 siblings, 1 reply; 28+ messages in thread
From: Didier Hung Wan Luk @ 2002-09-07  9:39 UTC (permalink / raw)
  To: Netfilter Mailing List

Hi All,


I am new to firewall/iptables can someone help me to clear up some concepts about firewalling?

If my default rule for the input chain of my external interface is DROP need I again specify to DROP packets in the INPUT chain of my external interface?

i.e..

#My Default rule
iptables -P INPUT DROP

#Drop all attempts on my ext. interface trough port 6000:6063

iptables -A INPUT -i ppp0 -p tcp --dport 6000:6063 -j DROP

If I am right I think that I need not include a rule again saying to drop packets to my 6000;6063 ports since I do not have a rule saying to accept connections on these ports...

Thanks,

Didier Hung Wan Luk




^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2008-04-09 17:03 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-04 19:36 multiports Peggy Kam
2005-08-05  6:34 ` multiports Jan Engelhardt
2005-08-10 20:13   ` Maximum number of ports? Peggy Kam
2005-08-11 16:54     ` /dev/rob0
2005-09-13 22:10     ` Maximum number of rules in iptables? Peggy Kam
2005-09-14  3:41       ` Edmundo Carmona
2005-09-14  4:44         ` /dev/rob0
     [not found]           ` <65aa6af905091406415094a9ff@mail.gmail.com>
2005-09-14 13:42             ` Fwd: " Edmundo Carmona
2005-09-15 15:22       ` iptables rules Peggy Kam
2005-09-15 15:26         ` Jörg Harmuth
2005-09-15 15:37           ` Peggy Kam
2005-09-15 16:23             ` Jörg Harmuth
2005-10-21 13:46               ` Realos
2005-10-21 16:03                 ` Rob Sterenborg
2005-10-21 16:19                 ` Jörg Harmuth
2005-09-15 15:33         ` Jörg Harmuth
     [not found] <47fc8b35.0e1f400a.4de1.0570@mx.google.com>
2008-04-09  9:53 ` Iptables Rules Jan Engelhardt
2008-04-09 17:01   ` Minh Cao
2008-04-09 17:03     ` Jan Engelhardt
  -- strict thread matches above, loose matches on Subject: below --
2008-04-08 22:01 Minh Cao
2008-04-09  4:12 ` Jan Engelhardt
2007-09-22 18:57 Iptables rules Shams Fantar
2007-09-22 19:32 ` Eljas Alakulppi
2007-09-22 19:44 ` Mike Wright
2002-09-09  4:06 Didier Hung Wan Luk
2002-09-07 11:59 ashivale
2002-09-07  9:39 Didier Hung Wan Luk
2002-09-07 10:36 ` Antony Stone

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox