iptables syntax question: multiple protocols

This is a discussion on iptables syntax question: multiple protocols within the Linux Security forums, part of the System Security and Security Related category; Greetings, Im not seeing in practice, what I read in a book. I am trying to consolidate a couple of ...


Go Back   Usenet Forums > System Security and Security Related > Linux Security

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 06-27-2003
David Klawiter
 
Posts: n/a
Default iptables syntax question: multiple protocols

Greetings,

Im not seeing in practice, what I read in a book. I am trying to
consolidate a couple of lines of code, but they dont register.

Here is working code:

$IPT -N P2P_DROP
$IPT -A P2P_DROP -j LOG --log-prefix "IPT P2P_SHARING: " $LOGOPT
$IPT -A P2P_DROP -j DROP

$IPT -N P2P_SHARING
$IPT -A P2P_SHARING -p tcp --dport 1214 -j P2P_DROP # Kazaa
$IPT -A P2P_SHARING -p udp --dport 1214 -j P2P_DROP # Kazaa
$IPT -A P2P_SHARING -p tcp --dport 6346:6347 -j P2P_DROP # Gnutella
$IPT -A P2P_SHARING -p udp --dport 6346:6347 -j P2P_DROP # Gnutella

and it produces the following results:

Chain P2P_DROP (4 references)
target prot opt source destination
LOG all -- anywhere anywhere <limit: ...>
DROP all -- anywhere anywhere

Chain P2P_SHARING (1 references)
target prot opt source destination
P2P_DROP tcp -- anywhere anywhere tcp
dpt:1214
P2P_DROP udp -- anywhere anywhere udp
dpt:1214
P2P_DROP tcp -- anywhere anywhere tcp
dpts:6346:6347
P2P_DROP udp -- anywhere anywhere udp
dpts:6346:6347

- - - - - - -

Here is what I thought I should be able to do:

$IPT -N P2P_DROP
$IPT -A P2P_DROP -j LOG --log-prefix "IPT P2P_SHARING: " $LOGOPT
$IPT -A P2P_DROP -j DROP

$IPT -N P2P_SHARING
$IPT -A P2P_SHARING -p tcp,udp --dport 1214 -j P2P_DROP # Kazaa
$IPT -A P2P_SHARING -p tcp,upd --dport 6346:6347 -j P2P_DROP #
Gnutella

and here are the results I get:

Chain P2P_DROP (0 references)
target prot opt source destination
LOG all -- anywhere anywhere <limit: ...>
DROP all -- anywhere anywhere

Chain P2P_SHARING (1 references)
target prot opt source destination

- - - -

So, why is it that trying to specify multiple protocols causes the
code to fail?
Reply With Quote
Reply


Thread Tools
Display Modes

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

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 06:28 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0