~ubuntu-branches/debian/sid/shorewall/sid

« back to all changes in this revision

Viewing changes to Samples/two-interfaces/masq.annotated

  • Committer: Package Import Robot
  • Author(s): Roberto C. Sanchez
  • Date: 2013-05-03 08:17:42 UTC
  • mfrom: (1.3.52)
  • Revision ID: package-import@ubuntu.com-20130503081742-qo8p6k2z0dnbfqo8
Tags: 4.5.16.1-1
* New Upstream Version
* debian/patches/01_debian_configuration.patch: Refreshed
* debian/patches/02_correct_dnat_snat_behavior.patch: Removed
* Update lintian overrides

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
# See the file README.txt for further details.
11
11
#------------------------------------------------------------------------------
12
12
# For information about entries in this file, type "man shorewall-masq"
13
 
###############################################################################
 
13
################################################################################################################
14
14
15
15
# Use this file to define dynamic NAT (Masquerading) and to define Source NAT
16
16
# (SNAT).
29
29
# The columns in the file are as follows.
30
30
31
31
# INTERFACE:DEST - {[+]interfacelist[:[digit]][:[dest-address[,dest-address]...[
32
 
#     exclusion]]|COMMENT}
 
32
#     exclusion]]|[?]COMMENT}
33
33
34
34
#     Outgoing interfacelist. This may be a comma-separated list of interface
35
35
#     names. This is usually your internet interface. If ADD_SNAT_ALIASES=Yes in
82
82
#     the end of the file is reached. To stop adding comments to rules, use a
83
83
#     line with only the word COMMENT.
84
84
85
 
# SOURCE (Formerly called SUBNET) - {interface[:exclusion]|address[,address][
86
 
#     exclusion]}
 
85
#     Note
 
86
 
87
#     Beginning with Shorewall 4.5.11, ?COMMENT is a synonym for COMMENT and is
 
88
#     preferred.
 
89
 
90
# SOURCE (Formerly called SUBNET) - {interface|address[,address][exclusion]}
87
91
88
92
#     Set of hosts that you wish to masquerade. You can specify this as an
89
93
#     address (net or host) or as an interface (use of an interface is
92
96
#     you of that fact. (Shorewall will use your main routing table to determine
93
97
#     the appropriate addresses to masquerade).
94
98
95
 
#     In order to exclude a address of the specified SOURCE, you may append an
96
 
#     exclusion ("!" and a comma-separated list of IP addresses (host or net)
97
 
#     that you wish to exclude (see shorewall-exclusion(5))). Note that a colon
98
 
#     (":") must appear between an interface name and the exclusion;
99
 
100
 
#     Example: eth1:!192.168.1.4,192.168.32.0/27
101
 
102
 
#     In that example traffic from eth1 would be masqueraded unless it came from
103
 
#     192.168.1.4 or 196.168.32.0/27
104
 
105
99
#     The preferred way to specify the SOURCE is to supply one or more host or
106
100
#     network addresses separated by comma. You may use ipset names preceded by a
107
101
#     plus sign (+) to specify a set of hosts.
157
151
#     If you want to leave this column empty but you need to specify the next
158
152
#     column then place a hyphen ("-") here.
159
153
160
 
# PROTO (Optional) - {-|[!]protocol-name|[!]protocol-number}
 
154
# PROTO (Optional) - {-|[!]{protocol-name|protocol-number}[,...]}
161
155
162
156
#     If you wish to restrict this entry to a particular protocol then enter the
163
157
#     protocol name (from protocols(5)) or number here.
164
158
 
159
#     Beginning with Shorewall 4.5.12, this column can accept a comma-separated
 
160
#     list of protocols.
 
161
165
162
# PORT(S) (Optional) - [[!]port-name-or-number[,port-name-or-number]...]
166
163
167
164
#     If the PROTO column specifies TCP (6), UDP (17), DCCP (33), SCTP (132) or
278
275
#         The ability to specify a program name was removed from Netfilter in
279
276
#         kernel version 2.6.14.
280
277
281
 
# SWITCH - [!]switch-name
 
278
# SWITCH - [!]switch-name[={0|1}]
282
279
283
280
#     Added in Shorewall 4.5.1 and allows enabling and disabling the rule without
284
281
#     requiring shorewall restart.
286
283
#     The rule is enabled if the value stored in /proc/net/nf_condition/
287
284
#     switch-name is 1. The rule is disabled if that file contains 0 (the
288
285
#     default). If '!' is supplied, the test is inverted such that the rule is
289
 
#     enabled if the file contains 0. switch-name must begin with a letter and be
290
 
#     composed of letters, decimal digits, underscores or hyphens. Switch names
291
 
#     must be 30 characters or less in length.
 
286
#     enabled if the file contains 0.
 
287
 
288
#     Within the switch-name, '@0' and '@{0}' are replaced by the name of the
 
289
#     chain to which the rule is a added. The switch-name (after '@...'
 
290
#     expansion) must begin with a letter and be composed of letters, decimal
 
291
#     digits, underscores or hyphens. Switch names must be 30 characters or less
 
292
#     in length.
292
293
293
294
#     Switches are normally off. To turn a switch on:
294
295
300
301
301
302
#     Switch settings are retained over shorewall restart.
302
303
 
304
#     Beginning with Shoreawll 4.5.10, when the switch-name is followed by =0 or
 
305
#     =1, then the switch is initialized to off or on respectively by the start
 
306
#     command. Other commands do not affect the switch setting.
 
307
 
308
# ORIGINAL DEST (origdest) - [-|address[,address]...[exclusion]|exclusion]
 
309
 
310
#     (Optional) Added in Shorewall 4.5.6. This column may be included and may
 
311
#     contain one or more addresses (host or network) separated by commas.
 
312
#     Address ranges are not allowed. When this column is supplied, rules are
 
313
#     generated that require that the original destination address matches one of
 
314
#     the listed addresses. It is useful for specifying that SNAT should occur
 
315
#     only for connections that were acted on by a DNAT when they entered the
 
316
#     firewall.
 
317
303
318
# Examples
304
319
305
320
# Example 1:
362
377
#             #INTERFACE              SOURCE          ADDRESS
363
378
#             eth0:+myset[dst]        -               206.124.146.177
364
379
365
 
###############################################################################
366
 
#INTERFACE              SOURCE          ADDRESS         PROTO   PORT(S) IPSEC   MARK
 
380
# Example 7:
 
381
 
382
#     SNAT outgoing connections on eth0 from 192.168.1.0/24 in round-robin
 
383
#     fashion between addresses 1.1.1.1, 1.1.1.3, and 1.1.1.9 (Shorewall 4.5.9
 
384
#     and later).
 
385
 
386
#     /etc/shorewall/tcrules:
 
387
 
388
#            #ACTION   SOURCE         DEST         PROTO   PORT(S)       SOURCE  USER    TEST
 
389
#            #                                                           PORT(S)
 
390
#            1-3:CF    192.168.1.0/24 eth0 ; state=NEW
 
391
 
392
#     /etc/shorewall/masq:
 
393
 
394
#            #INTERFACE SOURCE         ADDRESS     ...
 
395
#            eth0       192.168.1.0/24 1.1.1.1 ; mark=1:C
 
396
#            eth0       192.168.1.0/24 1.1.1.3 ; mark=2:C
 
397
#            eth0       192.168.1.0/24 1.1.1.4 ; mark=3:C
 
398
 
399
################################################################################################################
 
400
#INTERFACE:DEST         SOURCE          ADDRESS         PROTO   PORT(S) IPSEC   MARK    USER/   SWITCH  ORIGINAL
 
401
#                                                                                       GROUP           DEST
367
402
eth0                    10.0.0.0/8,\
368
403
                        169.254.0.0/16,\
369
404
                        172.16.0.0/12,\