Difference between revisions of "Bering-uClibc 4.x - User Guide - IPv6 Networking - Configure Shorewall6"

From bering-uClibc
Jump to: navigation, search
(A small sample setup: - add some more text)
(Added Introduction heading and paragraph on RFC 4890 compliance.)
Line 9: Line 9:
  
  
Earlier [[Bering-uClibc]] versions provided a package called <tt>6wall.lrp</tt> which implemented an IPv6 firewall.
+
== Introduction ==
[[Bering-uClibc 4.x]] provides <tt>shorwall6.lrp</tt> instead.
+
Earlier [[Bering-uClibc]] versions provided a Package called <tt>6wall.lrp</tt> which implemented an IPv6 firewall.
 +
[[Bering-uClibc 4.x]] provides Package <tt>shorwall6.lrp</tt> instead.
 
Unlike <tt>6wall.lrp</tt>, <tt>shorwall6.lrp</tt> is an official variant of the IPv4 <tt>shorwall.lrp</tt> and is supported by the same team.
 
Unlike <tt>6wall.lrp</tt>, <tt>shorwall6.lrp</tt> is an official variant of the IPv4 <tt>shorwall.lrp</tt> and is supported by the same team.
 
Improvements in the Linux kernel since 2.6.24 make [[Bering-uClibc 4.x]] a rather better IPv6 firewall platform than [[Bering-uClibc 3.x]].
 
Improvements in the Linux kernel since 2.6.24 make [[Bering-uClibc 4.x]] a rather better IPv6 firewall platform than [[Bering-uClibc 3.x]].
Line 16: Line 17:
 
'''Note:''' The full name "Shorewall" was abbreviated to "shorwall" in order to comply with the 8 character filename length limit for MS-DOS floppy disks, hence the package file is <tt>shorwall.lrp</tt>. The name of the Shorewall6 package, <tt>shorwall6.lrp</tt>, is based on the name of the Shorewall package even though the 8 character filename length limit is no longer in effect.
 
'''Note:''' The full name "Shorewall" was abbreviated to "shorwall" in order to comply with the 8 character filename length limit for MS-DOS floppy disks, hence the package file is <tt>shorwall.lrp</tt>. The name of the Shorewall6 package, <tt>shorwall6.lrp</tt>, is based on the name of the Shorewall package even though the 8 character filename length limit is no longer in effect.
  
In general, configuration of Shorewall6 is equivalent to configuration of Shorewall, so refer to the [[Bering-uClibc 4.x - User Guide - IPv4 Networking - Configure Shorewall|Shorewall]] chapter of this guide. For a simple setup is described below.
+
In general, configuration of Shorewall6 is equivalent to configuration of Shorewall, so refer to the [[Bering-uClibc 4.x - User Guide - IPv4 Networking - Configure Shorewall|Shorewall]] chapter of this guide. A simple setup is described below.
 
However, note the following differences:
 
However, note the following differences:
 
* There are far fewer macros defined specifically for Shorewall6 than for Shorewall (in other word far fewer matches for <code class="filename">/usr/share/shorewall6/macro.*</code> than for <code class="filename">/usr/share/shorewall/macro.*)</code> '''but''' all of the Shorewall(4) macros can be used for Shorewall6. Where both files are present (e.g. for <tt>mDNS</tt>) the Shorewall6 macro takes priority.  
 
* There are far fewer macros defined specifically for Shorewall6 than for Shorewall (in other word far fewer matches for <code class="filename">/usr/share/shorewall6/macro.*</code> than for <code class="filename">/usr/share/shorewall/macro.*)</code> '''but''' all of the Shorewall(4) macros can be used for Shorewall6. Where both files are present (e.g. for <tt>mDNS</tt>) the Shorewall6 macro takes priority.  
  
 +
 +
ICMP is rather more important for IPv6 than for IPv4, and an IPv6 network will not function unless at least some ICMP packet types are enabled. RFC 4890 defines "Recommendations for Filtering ICMPv6 Messages in Firewalls" and these recommendations are implemented as standard within Shorewall6. Refer to file <code class="filename">/usr/share/shorewall6/action.AllowICMPs</code> for more details.
  
 
'''Important:''' If you are running both Shorewall and Shorewall6 (rather than only Shorewall6) you need to make a modification to the Shorewall configuration otherwise Shorewall6 will be stopped whenever Shorewall is restarted.
 
'''Important:''' If you are running both Shorewall and Shorewall6 (rather than only Shorewall6) you need to make a modification to the Shorewall configuration otherwise Shorewall6 will be stopped whenever Shorewall is restarted.

Revision as of 20:09, 20 January 2011

IPv6 Networking - Configure Shorewall6
Prev Bering-uClibc 4.x - User Guide Next


Introduction

Earlier Bering-uClibc versions provided a Package called 6wall.lrp which implemented an IPv6 firewall. Bering-uClibc 4.x provides Package shorwall6.lrp instead. Unlike 6wall.lrp, shorwall6.lrp is an official variant of the IPv4 shorwall.lrp and is supported by the same team. Improvements in the Linux kernel since 2.6.24 make Bering-uClibc 4.x a rather better IPv6 firewall platform than Bering-uClibc 3.x.

Note: The full name "Shorewall" was abbreviated to "shorwall" in order to comply with the 8 character filename length limit for MS-DOS floppy disks, hence the package file is shorwall.lrp. The name of the Shorewall6 package, shorwall6.lrp, is based on the name of the Shorewall package even though the 8 character filename length limit is no longer in effect.

In general, configuration of Shorewall6 is equivalent to configuration of Shorewall, so refer to the Shorewall chapter of this guide. A simple setup is described below. However, note the following differences:

  • There are far fewer macros defined specifically for Shorewall6 than for Shorewall (in other word far fewer matches for /usr/share/shorewall6/macro.* than for /usr/share/shorewall/macro.*) but all of the Shorewall(4) macros can be used for Shorewall6. Where both files are present (e.g. for mDNS) the Shorewall6 macro takes priority.


ICMP is rather more important for IPv6 than for IPv4, and an IPv6 network will not function unless at least some ICMP packet types are enabled. RFC 4890 defines "Recommendations for Filtering ICMPv6 Messages in Firewalls" and these recommendations are implemented as standard within Shorewall6. Refer to file /usr/share/shorewall6/action.AllowICMPs for more details.

Important: If you are running both Shorewall and Shorewall6 (rather than only Shorewall6) you need to make a modification to the Shorewall configuration otherwise Shorewall6 will be stopped whenever Shorewall is restarted. In file /etc/shorewall/shorewall.conf ensure that DISABLE_IPV6 is set to No.


A small sample setup

The following setup will establish a firewall for your IPV6 router, that rejects all traffic initiated anywhere on the Internet to your router and LAN, but allows any traffic from your LAN to the Net. It also allows any traffic from your router/firewall to the LAN, but rejects traffic from your router/firewall to the Internet. So it's the easiest setup with a standard low-level protection for your LAN. (Note: The sample setup is based on a IPv6 tunnel to SiXXS.)

Configure your Zones

The /etc/shorewall6/zones file declares your network zones. You specify the hosts in each zone through entries in /etc/shorewall6/interfaces.

############################################################################### 
#ZONE   TYPE            OPTIONS         IN                      OUT             
#                                       OPTIONS                 OPTIONS         
fw      firewall
net     ipv6
loc     ipv6

Configure your Interfaces

The /etc/shorewall6/interfaces file serves to define the firewall's network interfaces to shorewall6. The order of entries in this file is not significant in determining zone composition.

###############################################################################
#ZONE   INTERFACE       ANYCAST         OPTIONS
net     sixxs           detect                                        
loc     eth1            detect 

(It is assumed that your SiXXS tunnel interface is named sixxs; you may need to change, to fit your setup.)

Configure your Policy

The file /etc/shorewall6/policy defines the high-level policy for connections between zones defined in /etc/shorewall6/zones.

############################################################################### 
#SOURCE DEST    POLICY          LOG     LIMIT:          CONNLIMIT:              
#                               LEVEL   BURST           MASK                    
fw     loc      ACCEPT                   
loc    net      ACCEPT
all    all      REJECT     INFO

Important: If you change any of the shorewall6 parameters, remember to save your configuration!


Prev Up Next