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 ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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? |
![]() |
| Thread Tools | |
| Display Modes | |
|
|