Whole document tree 14.1. Firewalling14.1.1. Firewalling using netfilter6Native IPv6 firewalling is only supported in kernel versions 2.4+. In older 2.2- you can only filter IPv6-in-IPv4 by protocol 41. Attention: no warranty that described rules or examples are really protect your system! 14.1.2. Preparation14.1.2.1. Get sourcesGet the latest kernel source: http://www.kernel.org/ Get the latest iptables package:
14.1.2.2. Extract sourcesChange to source directory:
Unpack and rename kernel sources
Unpack iptables sources
14.1.2.3. Apply latest iptables/IPv6-related patches to kernel sourceChange to iptables directory
Apply pending patches
Apply additional IPv6 related patches (still not in the vanilla kernel included)
Say yes at following options (iptables-1.2.2)
Check IPv6 extensions
14.1.2.4. Configure, build and install new kernelChange to kernel sources
Edit Makefile
Run configure, enable IPv6 related
Configure other related to your system, too Compilation and installing: see the kernel section here and other HOWTOs 14.1.2.5. Rebuild and install binaries of iptablesMake sure, that upper kernel source tree is also available at /usr/src/linux/ Rename older directory
Create a new softlink
Rebuild SRPMS
Install new iptables packages (iptables + iptables-ipv6)
Perhaps it's necessary to create a softlink for iptables libraries where iptables looks for them
14.1.3. Usage14.1.3.1. Check for supportLoad module, if so compiled
Check for capability
14.1.3.2. Learn how to use ip6tablesList all IPv6 netfilter entries
List specified filter
Insert a log rule at the input filter with options
Insert a drop rule at the input filter
Delete a rule by number
Allow ICMPv6, at the moment, with unpatched kernel 2.4.5 and iptables-1.2.2 no type can be specified
Allow incoming SSH, here an example is shown for a ruleset which allows incoming SSH connection from a specified IPv6 address
Enable tunneled IPv6-in-IPv4, to accept tunneled IPv6-in-IPv4 packets, you have to insert rules in your IPv4 firewall setup relating to such packets, for example
If you have only a static tunnel, you can specify the IPv4 addresses, too, like
Protect against incoming TCP connection requests (VERY RECOMMENDED!), for security issues you should really insert a rule which blocks incoming TCP connection requests. Adapt "-i" option, if other interface names are in use!
Perhaps the rules have to be placed below others, but that is work you have to think about it. Best way is to create a script and execute rules in a specified way. Protect against incoming UDP connection requests (ALSO RECOMMENDED!), like mentioned on my firewall information it's possible to control the ports on outgoing UDP/TCP sessions. So if all of your local IPv6 systems are use local ports e.g. from 32768 to 60999 you are able to filter UDP connections also (until connection tracking works) like:
14.1.3.3. Demonstration exampleFollowing lines show a more sophisticated setup as an example. Happy netfilter6 ruleset creation....
|