diff --git a/docs/Documentation_Index.xml b/docs/Documentation_Index.xml index 06fe44f06..b04039222 100644 --- a/docs/Documentation_Index.xml +++ b/docs/Documentation_Index.xml @@ -78,6 +78,16 @@ url="configuration_file_basics.htm#Comments">Comments in configuration files + Using Shell + Variables + + + + Comments in + Netfilter Rules + Using DNS Names @@ -120,14 +130,6 @@ Using MAC Addresses in Shorewall - - - Using Shell - Variables - - - diff --git a/docs/configuration_file_basics.xml b/docs/configuration_file_basics.xml index ff6df8b94..ba84ca9f1 100644 --- a/docs/configuration_file_basics.xml +++ b/docs/configuration_file_basics.xml @@ -231,6 +231,85 @@ ACCEPT net $FW tcp www #This is an end-of-line comment +
+ Attach Comment to Netfilter Rules + + Beginning with Shorewall version 3.3.3, if you kernel and iptables + contain comment match support (see the output of shorewall show + capabilities), then you can attach comments to Netfilter rules. + This feature is available in the following files: + + + + /etc/shorewall/masq + + + + /etc/shorewall/nat + + + + /etc/shorewall/rules + + + + /etc/shorewall/tcrules + + + + Action definition files + (/etc/shorewall/action.*) + + + + To attach a comment to one or more rules, insert a record above the + rules that begins with the word COMMENT (must be in all caps). The + remainder of the line is treated as a comment -- that comment will appear + delimited by "/* ... */" in the output of the shorewall[-lite] + show and shorewall[-lite] dump commands. The + comment will be attached to each generated rule until another COMMENT line + appears. To stop attaching comments to rules, simply insert a line that + contains the single word COMMENT. + + Example (/etc/shorewall/rules): + + COMMENT Stop NETBIOS noise + +REJECT loc net tcp 137,445 +REJECT loc net udp 137:139 + +COMMENT Stop my idiotic work laptop from sending to the net with an HP source/dest IP address + +DROP loc:!192.168.0.0/22 net + +COMMENT + + Here's the corresponding output from + /sbin/shorewall-lite: + + gateway:~ # shorewall-lite show loc2net +Shorewall Lite 3.3.3 Chains loc2net at gateway - Mon Oct 16 15:04:52 PDT 2006 + +Counters reset Mon Oct 16 14:52:17 PDT 2006 + +Chain loc2net (1 references) + pkts bytes target prot opt in out source destination + 0 0 LOG tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:25 LOG flags 0 level 6 prefix `FW:loc2net:REJECT:' + 0 0 reject tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:25 + 0 0 LOG udp -- * * 0.0.0.0/0 0.0.0.0/0 udp dpts:1025:1031 LOG flags 0 level 6 prefix `FW:loc2net:REJECT:' + 0 0 reject udp -- * * 0.0.0.0/0 0.0.0.0/0 udp dpts:1025:1031 + 0 0 reject tcp -- * * 0.0.0.0/0 0.0.0.0/0 multiport dports 137,445 /* Stop NETBIOS noise */ + 0 0 reject udp -- * * 0.0.0.0/0 0.0.0.0/0 udp dpts:137:139 /* Stop NETBIOS noise */ + 0 0 DROP all -- * * !192.168.0.0/22 0.0.0.0/0 /* Stop my idiotic work laptop from sending to the net with an HP source/dest IP address */ + 5 316 ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 +gateway:~ # + + +
+
Line Continuation