<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.openvz.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Iandunn</id>
	<title>OpenVZ Virtuozzo Containers Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.openvz.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Iandunn"/>
	<link rel="alternate" type="text/html" href="https://wiki.openvz.org/Special:Contributions/Iandunn"/>
	<updated>2026-06-10T03:00:33Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.1</generator>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Quick_installation_(legacy)&amp;diff=12132</id>
		<title>Quick installation (legacy)</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Quick_installation_(legacy)&amp;diff=12132"/>
		<updated>2012-03-19T19:46:06Z</updated>

		<summary type="html">&lt;p&gt;Iandunn: /* Rebooting into OpenVZ kernel */ changed x86_64 note to indicate that the problem is now obsolete and users don't need the to follow special build instructions&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document briefly describes the steps needed to install OpenVZ on your (RPM based) machine. For '''Debian''' based systems see [[Installation on Debian]].&lt;br /&gt;
&lt;br /&gt;
This document is also available in the following languages: [http://forum.openvz.org/index.php?t=tree&amp;amp;amp;goto=35&amp;amp;amp;#msg_35 French],  [http://forum.openvz.org/index.php?t=tree&amp;amp;amp;goto=1805&amp;amp;amp;#msg_1805 German],&lt;br /&gt;
[http://wiki.openvz.jp Japanese],&lt;br /&gt;
[[Quick_installation_(Spanish)|Spanish]].&lt;br /&gt;
&lt;br /&gt;
OpenVZ consists of a kernel, user-level tools, and container templates. This guide tells how to install the kernel and the tools.&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
This guide assumes you are running recent release of Fedora Core (like FC5) or RHEL/CentOS 4. Currently, OpenVZ kernel tries to support the same hardware that Red Hat kernels support. For full hardware compatibility list, see [http://www.swsoft.com/en/products/virtuozzo/hcl/ Virtuozzo HCL].&lt;br /&gt;
&lt;br /&gt;
=== Filesystems ===&lt;br /&gt;
It is recommended to use a separate partition for container's private directories (by default /vz/private/&amp;lt;veid&amp;gt;). The reason why you should do so is that if you wish to use OpenVZ per-container disk quota, you won't be able to use usual Linux disk quotas on the same partition. Bear in mind, that per-container quota in this context includes not only pure per-container quota, but also usual Linux disk quota used in containers, not on [[HN]].&lt;br /&gt;
&lt;br /&gt;
At least try to avoid using the root partition for containers, because the root user of a container will be able to overcome the 5% disk space barrier in some situations. This way the HN root partition can be completely filled and it will break the system.&lt;br /&gt;
&lt;br /&gt;
OpenVZ per-container disk quota is supported only for ext2/ext3 filesystems. So use one of these filesystems (ext3 is recommended) if you need per-container disk quota.&lt;br /&gt;
&lt;br /&gt;
=== rpm or yum? ===&lt;br /&gt;
&lt;br /&gt;
In case you have yum utility available on your system, you may want to use it effectively to install and update OpenVZ packages. In case you don't have yum, or don't want to use it, you can use plain old rpm. Instructions for both rpm and yum are provided below.&lt;br /&gt;
&lt;br /&gt;
=== yum pre-setup ===&lt;br /&gt;
If you want to use yum, you should set up OpenVZ yum repository first.&lt;br /&gt;
&lt;br /&gt;
Download [http://download.openvz.org/openvz.repo openvz.repo] file and put it to your &amp;lt;code&amp;gt;/etc/yum.repos.d/&amp;lt;/code&amp;gt; repository. This can be achieved by the following commands, as root:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /etc/yum.repos.d&lt;br /&gt;
# wget http://download.openvz.org/openvz.repo&lt;br /&gt;
# rpm --import  http://download.openvz.org/RPM-GPG-Key-OpenVZ&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In case you can not cd to /etc/yum.repos.d, it means either yum is not installed on your system, or yum version is too old. In that case, just stick to rpm installation method.&lt;br /&gt;
&lt;br /&gt;
== Kernel installation ==&lt;br /&gt;
&lt;br /&gt;
{{Note|In case you want to recompile the kernel yourself rather than use the one provided by OpenVZ, see [[kernel build]].}}&lt;br /&gt;
&lt;br /&gt;
First, you need to choose what “flavor” of the kernel you want to install. Please refer to [[Kernel flavors]] for more information.&lt;br /&gt;
&lt;br /&gt;
=== Using yum ===&lt;br /&gt;
Run the following command&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# yum install [o]vzkernel[-flavor]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For RHEL6 kernel branch, use '''vzkernel''', for other branches use '''ovzkernel'''.&lt;br /&gt;
&lt;br /&gt;
Note that &amp;lt;code&amp;gt;[-flavor]&amp;lt;/code&amp;gt; is optional, and can be &amp;lt;code&amp;gt;-smp&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-enterprise&amp;lt;/code&amp;gt;. Refer to [[kernel flavors]] for more info.&lt;br /&gt;
&lt;br /&gt;
{{Note|if you need to install &amp;lt;code&amp;gt;x86_64&amp;lt;/code&amp;gt; kernel and yum offers to install both &amp;lt;code&amp;gt;x86_64&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;i686&amp;lt;/code&amp;gt; kernels, answer &amp;lt;code&amp;gt;No&amp;lt;/code&amp;gt; and specify architecture manually, like this: &amp;lt;code&amp;gt;yum install ovzkernel.x86_64&amp;lt;/code&amp;gt;. This is fixed in newer yum versions.}}&lt;br /&gt;
&lt;br /&gt;
=== Using rpm ===&lt;br /&gt;
Get the kernel binary RPM from the [[Download/kernel]] page. You only need one kernel RPM so please [[Kernel flavors|choose the appropriate one]] depending on your hardware.&lt;br /&gt;
&lt;br /&gt;
Next, install the kernel RPM you chose:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# rpm -ihv ovzkernel[-flavor]*.rpm&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here &amp;lt;code&amp;gt;[-flavor]&amp;lt;/code&amp;gt; is optional, and can be &amp;lt;code&amp;gt;-smp&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-enterprise&amp;lt;/code&amp;gt;. Refer to [[kernel flavors]] for more info.&lt;br /&gt;
&lt;br /&gt;
{{Note|&amp;lt;tt&amp;gt;rpm -U&amp;lt;/tt&amp;gt; (where &amp;lt;tt&amp;gt;-U&amp;lt;/tt&amp;gt; stands for ''upgrade'') should '''not''' be used, otherwise all currently installed kernels will be uninstalled.}}&lt;br /&gt;
&lt;br /&gt;
== Configuring the bootloader ==&lt;br /&gt;
&lt;br /&gt;
In case GRUB is used as the boot loader, it will be configured automatically: lines similar to these will be added to the &amp;lt;tt&amp;gt;/boot/grub/grub.conf&amp;lt;/tt&amp;gt; file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
title Fedora Core (2.6.8-022stab029.1)&lt;br /&gt;
       root (hd0,0)&lt;br /&gt;
       kernel /vmlinuz-2.6.8-022stab029.1 ro root=/dev/sda5 quiet rhgb vga=0x31B&lt;br /&gt;
       initrd /initrd-2.6.8-022stab029.1.img&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Change &amp;lt;tt&amp;gt;Fedora Core&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;OpenVZ&amp;lt;/tt&amp;gt; (just for clarity reasons, so the OpenVZ kernels will not be mixed up with non-OpenVZ ones). Remove extra arguments from the kernel line, leaving only the &amp;lt;tt&amp;gt;root=...&amp;lt;/tt&amp;gt; parameter. The modifed portion of &amp;lt;tt&amp;gt;/etc/grub.conf&amp;lt;/tt&amp;gt; should look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
title OpenVZ (2.6.8-022stab029.1)&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /vmlinuz-2.6.8-022stab029.1 ro root=/dev/sda5&lt;br /&gt;
        initrd /initrd-2.6.8-022stab029.1.img&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring ==&lt;br /&gt;
&lt;br /&gt;
Please make sure the following steps are performed before rebooting into OpenVZ kernel.&lt;br /&gt;
&lt;br /&gt;
=== sysctl ===&lt;br /&gt;
&lt;br /&gt;
There are a number of kernel parameters that should be set for OpenVZ to work correctly. These parameters are stored in &amp;lt;tt&amp;gt;/etc/sysctl.conf&amp;lt;/tt&amp;gt; file. Here are the relevant portions of the file; please edit accordingly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# On Hardware Node we generally need&lt;br /&gt;
# packet forwarding enabled and proxy arp disabled&lt;br /&gt;
net.ipv4.ip_forward = 1&lt;br /&gt;
net.ipv6.conf.default.forwarding = 1&lt;br /&gt;
net.ipv6.conf.all.forwarding = 1&lt;br /&gt;
net.ipv4.conf.default.proxy_arp = 0&lt;br /&gt;
&lt;br /&gt;
# Enables source route verification&lt;br /&gt;
net.ipv4.conf.all.rp_filter = 1&lt;br /&gt;
&lt;br /&gt;
# Enables the magic-sysrq key&lt;br /&gt;
kernel.sysrq = 1&lt;br /&gt;
&lt;br /&gt;
# We do not want all our interfaces to send redirects&lt;br /&gt;
net.ipv4.conf.default.send_redirects = 1&lt;br /&gt;
net.ipv4.conf.all.send_redirects = 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== SELinux ===&lt;br /&gt;
&lt;br /&gt;
SELinux should be disabled. To that effect, put the following line to &amp;lt;code&amp;gt;/etc/sysconfig/selinux&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELINUX=disabled&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Conntracks ===&lt;br /&gt;
&lt;br /&gt;
{{Note|In OpenVZ kernels later than 2.6.8, connection tracking is enabled by default so skip this section.}}&lt;br /&gt;
&lt;br /&gt;
In the old (2.6.8-based) OpenVZ kernels netfilter connection tracking for [[CT0]] is disabled by default. If you have a stateful firewall enabled on the host node (it is there by default on some distributions) you should either disable it, or enable connection tracking for [[CT0]].&lt;br /&gt;
&lt;br /&gt;
To enable conntracks for CT0, add the following line to &amp;lt;code&amp;gt;/etc/modprobe.conf&amp;lt;/code&amp;gt; file:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
options ip_conntrack ip_conntrack_enable_ve0=1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Rebooting into OpenVZ kernel ==&lt;br /&gt;
&lt;br /&gt;
Now reboot the machine and choose &amp;quot;OpenVZ&amp;quot; on the boot loader menu. If the OpenVZ kernel has been booted successfully, proceed to installing the user-level tools for OpenVZ.&lt;br /&gt;
&lt;br /&gt;
{{ Note |At one time there were problems with vzpkg and vzyum in x86_64 systems that required [[Install_OpenVZ_on_a_x86_64_system_Centos-Fedora|special installation procedures]], but these appear to be resolved in current builds.}}&lt;br /&gt;
&lt;br /&gt;
== Installing the utilities ==&lt;br /&gt;
&lt;br /&gt;
OpenVZ needs some user-level tools installed. Those are:&lt;br /&gt;
&lt;br /&gt;
; vzctl&lt;br /&gt;
:    A utility to control OpenVZ containers (create, destroy, start, stop, set parameters etc.)&lt;br /&gt;
; vzquota&lt;br /&gt;
:    A utility to manage quotas for containers. Mostly used indirectly (by vzctl).&lt;br /&gt;
&lt;br /&gt;
=== Using yum ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# yum install vzctl vzquota&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If on the x86_64 platform you would probably want to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# yum install vzctl.x86_64 vzquota.x86_64&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Using rpm ===&lt;br /&gt;
&lt;br /&gt;
Download the binary RPMs of these utilities from [[Download/utils]]. Install them:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# rpm -Uhv vzctl*.rpm vzquota*.rpm&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If rpm complains about unresolved dependencies, you'll have to satisfy them first, then repeat the installation.&lt;br /&gt;
&lt;br /&gt;
When all the tools are installed, start the OpenVZ subsystem.&lt;br /&gt;
&lt;br /&gt;
== Starting OpenVZ ==&lt;br /&gt;
&lt;br /&gt;
As root, execute the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# /sbin/service vz start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will load all the needed OpenVZ kernel modules. This script should also start all the containers marked to be auto-started on machine boot (there aren't any yet).&lt;br /&gt;
&lt;br /&gt;
During the next reboot, this script should be executed automatically.&lt;br /&gt;
&lt;br /&gt;
== Installing OS template caches ==&lt;br /&gt;
&lt;br /&gt;
An OS template cache is a Linux distribution installed into a container&lt;br /&gt;
and then packed into a gzipped tarball. Using such a cache, a new container&lt;br /&gt;
can be created in a matter of minutes.&lt;br /&gt;
&lt;br /&gt;
Download precreated template caches from [http://openvz.org/download/template/cache Downloads » Templates » Precreated], or directly from [http://download.openvz.org/template/precreated/ download.openvz.org/template/precreated], or from one of the [[Download mirrors|mirrors]]. Put those tarballs '''as-is (no unpacking needed)''' to the &amp;lt;tt&amp;gt;/vz/template/cache/&amp;lt;/tt&amp;gt; directory&lt;br /&gt;
(for Debain, this is &amp;lt;tt&amp;gt;/var/lib/vz/template/cache/&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
== Next steps ==&lt;br /&gt;
&lt;br /&gt;
OpenVZ is now set up on your machine. To load OpenVZ kernel by default, edit the default line in the /boot/grub/grub.conf file to point to the OpenVZ kernel. For example, if the OpenVZ kernel is the first kernel mentioned in the file, put it as default 0. See man grub.conf for more details.&lt;br /&gt;
&lt;br /&gt;
Follow on to [[basic operations in OpenVZ environment]] document.&lt;br /&gt;
[[Category: Installation]]&lt;br /&gt;
[[Category: HOWTO]]&lt;/div&gt;</summary>
		<author><name>Iandunn</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Setting_up_an_iptables_firewall&amp;diff=12131</id>
		<title>Setting up an iptables firewall</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Setting_up_an_iptables_firewall&amp;diff=12131"/>
		<updated>2012-03-19T18:19:19Z</updated>

		<summary type="html">&lt;p&gt;Iandunn: /* Setting up a HN-based firewall */ added the URL to the wiki page to the script so that people will know where it came from&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document consists of two parts. The first is setting up a firewall (using iptables) on the HN, which will restrict traffic to the containers. The effect would emulate, as far as the containers and their customers are concerned, an external hardware firewall controlled by the sysadmin. The second is setting up a firewall that protects the [[HN]] itself but still allows traffic to the containers, thus allowing individual containers to define their own iptables.&lt;br /&gt;
&lt;br /&gt;
While the firewalls shown here can be accomplished using iptables manually (or using Fedora core's iptables service), the methods presented here are especially modular and easy to modify. This is important when you have 20+ containers and a lot of other things to be doing...&lt;br /&gt;
&lt;br /&gt;
The scripts and pathnames given here are for Fedora Core 6, though they can probably be applied to most similar SysV-like systems with little modification.&lt;br /&gt;
&lt;br /&gt;
== A little background ==&lt;br /&gt;
&lt;br /&gt;
On our systems, we use the HN to provide privileged services which are not appropriate for access by the containers. For example, the HN acts as a backup server, runs Nagios for health monitoring, has a webserver for managing the 3ware RAID controller, etc. The containers are leased to customers, who can't entirely be trusted, especially if they get hacked. As such, our scenario is one in which the HN must be protected from all access (even from the containers) except for a few trusted hosts (e.g. my home-office).&lt;br /&gt;
&lt;br /&gt;
The exception to this is the nameserver, which we want open to the world. We use it as a caching nameserver for our containers and also to host DNS for a few customer domain.&lt;br /&gt;
&lt;br /&gt;
== Simple firewall configuration independent to IP addresses: vzfirewall ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Vzfirewall&amp;lt;/code&amp;gt; tool allows you to open/close ports for incoming connections with no dependencies to foreign IP addresses. E.g. you may allow a hostname &amp;lt;code&amp;gt;release.prod.example.com&amp;lt;/code&amp;gt; to connect to port 5432 of VE 1234 and leave all other ports closed by modifying &amp;lt;code&amp;gt;1234.conf&amp;lt;/code&amp;gt; file adding multiline &amp;lt;code&amp;gt;FIREWALL&amp;lt;/code&amp;gt; directive into it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
PRIVVMPAGES=&amp;quot;300000:300000&amp;quot;&lt;br /&gt;
HOSTNAME=&amp;quot;example.com&amp;quot;&lt;br /&gt;
...&lt;br /&gt;
FIREWALL=&amp;quot;&lt;br /&gt;
    ...&lt;br /&gt;
    # Allow access to PostgreSQL port only from release.prod &lt;br /&gt;
    # and release.test machines. You may use domain names here.&lt;br /&gt;
    [5432]&lt;br /&gt;
    release.prod.example.com&lt;br /&gt;
    release.test.example.com&lt;br /&gt;
    ...&lt;br /&gt;
&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You must then run &amp;lt;code&amp;gt;vzfirewall -a&amp;lt;/code&amp;gt; on your hardware node to apply changes made in &amp;lt;code&amp;gt;*.conf&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Note that it is recommended to use hostnames instead of IP addresses here, so the configuration is persistent for VE movements to different IP-address: you just need to run &amp;lt;code&amp;gt;vzfirewall -a&amp;lt;/code&amp;gt; again after movement. It is also reboot-safe, because applied to &amp;lt;code&amp;gt;/etc/sysconfig/iptables&amp;lt;/code&amp;gt; (at RHEL systems).&lt;br /&gt;
&lt;br /&gt;
Vzfirewall and its documentation are available at [http://en.dklab.ru/lib/dklab_vzfirewall/ http://en.dklab.ru/lib/dklab_vzfirewall/].&lt;br /&gt;
&lt;br /&gt;
== An alternative from the author of Shorewall ==&lt;br /&gt;
&lt;br /&gt;
For those who might find the solution provided in this wiki article unsatisfactory (for whatever reason), the creator of Shorewall (Tom Eastep) has written a nice article explaining how to use Shorewall on an OpenVZ host node to manage the host node, containers, and more... with quite a complex setup as an example.  The article IS NOT an introduction to Shorewall for beginners, so some pre-existing knowledge and understanding of Shorewall may be required.&lt;br /&gt;
&lt;br /&gt;
Shorewall and OpenVZ by Tom Eastep - http://www.shorewall.net/OpenVZ.html&lt;br /&gt;
&lt;br /&gt;
See also this OpenVZ Forum posting - http://forum.openvz.org/index.php?t=msg&amp;amp;goto=16406&amp;amp;&lt;br /&gt;
&lt;br /&gt;
== Setting up a HN-based firewall ==&lt;br /&gt;
&lt;br /&gt;
This setup emulates (to the containers anyway) an external hardware firewall. It protects the HN from any access and then defines what services and ports are allowed/banned for individual containers. This leaves the firewall controlled by the site administrator, not be individual containers and the hackers who've gotten into them. ;)&lt;br /&gt;
&lt;br /&gt;
First off, let's disable Fedora's existing &amp;lt;code&amp;gt;iptables&amp;lt;/code&amp;gt; service:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
service iptables stop&lt;br /&gt;
chkconfig iptables off&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create the new &amp;lt;code&amp;gt;firewall&amp;lt;/code&amp;gt; service. This code should be &amp;lt;code&amp;gt;/etc/init.d/firewall&amp;lt;/code&amp;gt; and then should be chmod'd 755.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
# firewall      Start iptables firewall&lt;br /&gt;
# chkconfig: 2345 97 87&lt;br /&gt;
# description:  Starts, stops and saves iptables firewall&lt;br /&gt;
# This script sets up the firewall for the INPUT chain (which is for&lt;br /&gt;
# the HN itself) and then processes the config files under&lt;br /&gt;
# /etc/firewall.d to set up additional rules in the FORWARD chain&lt;br /&gt;
# to allow access to containers' services.&lt;br /&gt;
# http://wiki.openvz.org/Setting_up_an_iptables_firewall&lt;br /&gt;
&lt;br /&gt;
. /etc/init.d/functions&lt;br /&gt;
&lt;br /&gt;
# the IP block allocated to this server&lt;br /&gt;
SEGMENT=&amp;quot;192.168.0.0/24&amp;quot;&lt;br /&gt;
# the IP used by the hosting server itself&lt;br /&gt;
THISHOST=&amp;quot;192.168.0.1&amp;quot;&lt;br /&gt;
# services that should be allowed to the HN;&lt;br /&gt;
# services for containers are configured in /etc/firewall.d/*&lt;br /&gt;
OKPORTS=&amp;quot;53&amp;quot;&lt;br /&gt;
# hosts allowed full access through the firewall,&lt;br /&gt;
# to all containers and to this server&lt;br /&gt;
DMZS=&amp;quot;12.34.56.78 90.123.45.67&amp;quot;&lt;br /&gt;
&lt;br /&gt;
purge() {&lt;br /&gt;
  echo -n &amp;quot;Firewall: Purging and allowing all traffic&amp;quot;&lt;br /&gt;
  iptables -P OUTPUT ACCEPT&lt;br /&gt;
  iptables -P FORWARD ACCEPT&lt;br /&gt;
  iptables -P INPUT ACCEPT&lt;br /&gt;
  iptables -F&lt;br /&gt;
  success ; echo&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
setup() {&lt;br /&gt;
  echo -n &amp;quot;Firewall: Setting default policies to DROP&amp;quot;&lt;br /&gt;
  iptables -P INPUT DROP&lt;br /&gt;
  iptables -P FORWARD DROP&lt;br /&gt;
  iptables -I INPUT   -j ACCEPT -m state --state ESTABLISHED,RELATED&lt;br /&gt;
  iptables -I FORWARD -j ACCEPT -m state --state ESTABLISHED,RELATED&lt;br /&gt;
  iptables -I INPUT -j ACCEPT -i lo&lt;br /&gt;
  iptables -I FORWARD -j ACCEPT --source $SEGMENT&lt;br /&gt;
  success ; echo&lt;br /&gt;
&lt;br /&gt;
  echo &amp;quot;Firewall: Allowing access to HN&amp;quot;&lt;br /&gt;
  for port in $OKPORTS ; do&lt;br /&gt;
    echo -n &amp;quot;          port $port&amp;quot;&lt;br /&gt;
    iptables -I INPUT -j ACCEPT -s $SEGMENT -d $THISHOST --protocol tcp --destination-port $port&lt;br /&gt;
    iptables -I INPUT -j ACCEPT -s $SEGMENT -d $THISHOST --protocol udp --destination-port $port&lt;br /&gt;
    success ; echo&lt;br /&gt;
  done&lt;br /&gt;
  for ip in $DMZS ; do&lt;br /&gt;
    echo -n &amp;quot;          DMZ $ip&amp;quot;&lt;br /&gt;
    iptables -I INPUT   -i eth0 -j ACCEPT -s $ip&lt;br /&gt;
    iptables -I FORWARD -i eth0 -j ACCEPT -s $ip&lt;br /&gt;
    success ; echo&lt;br /&gt;
  done&lt;br /&gt;
&lt;br /&gt;
  CTSETUPS=`echo /etc/firewall.d/*`&lt;br /&gt;
  if [ &amp;quot;$CTSETUPS&amp;quot; != &amp;quot;/etc/firewall.d/*&amp;quot; ] ; then&lt;br /&gt;
  echo &amp;quot;Firewall: Setting up container firewalls&amp;quot;&lt;br /&gt;
  for i in $CTSETUPS ; do&lt;br /&gt;
    . $i&lt;br /&gt;
    echo -n &amp;quot;          $CTNAME CT$CTID&amp;quot;&lt;br /&gt;
    if [ -n &amp;quot;$BANNED&amp;quot; ]; then&lt;br /&gt;
      for source in $BANNED ;  do iptables -I FORWARD -j DROP --destination $CTIP --source $source ; done&lt;br /&gt;
    fi&lt;br /&gt;
    if [ -n &amp;quot;$OPENPORTS&amp;quot; ]; then&lt;br /&gt;
      for port in $OPENPORTS ; do iptables -I FORWARD -j ACCEPT --protocol tcp --destination $CTIP --destination-port $port ; done&lt;br /&gt;
      for port in $OPENPORTS ; do iptables -I FORWARD -j ACCEPT --protocol udp --destination $CTIP --destination-port $port ; done&lt;br /&gt;
    fi&lt;br /&gt;
    if [ -n &amp;quot;$DMZS&amp;quot; ]; then&lt;br /&gt;
      for source in $DMZS ; do iptables -I FORWARD -j ACCEPT --protocol tcp --destination $CTIP --source $source ; done&lt;br /&gt;
      for source in $DMZS ; do iptables -I FORWARD -j ACCEPT --protocol udp --destination $CTIP --source $source ; done&lt;br /&gt;
    fi&lt;br /&gt;
    [ $? -eq 0 ] &amp;amp;&amp;amp; success || failure&lt;br /&gt;
    echo&lt;br /&gt;
  done&lt;br /&gt;
  fi&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
case &amp;quot;$1&amp;quot; in&lt;br /&gt;
  start)&lt;br /&gt;
    echo &amp;quot;Starting firewall...&amp;quot;&lt;br /&gt;
    purge&lt;br /&gt;
    setup&lt;br /&gt;
    ;;&lt;br /&gt;
  stop)&lt;br /&gt;
    echo &amp;quot;Stopping firewall...&amp;quot;&lt;br /&gt;
    purge&lt;br /&gt;
    ;;&lt;br /&gt;
  restart)&lt;br /&gt;
    $0 stop&lt;br /&gt;
    $0 start&lt;br /&gt;
    ;;&lt;br /&gt;
  status)&lt;br /&gt;
    iptables -n -L&lt;br /&gt;
    ;;&lt;br /&gt;
  *)&lt;br /&gt;
    echo &amp;quot;Usage: $0 &amp;lt;start|stop|restart|status&amp;gt;&amp;quot;&lt;br /&gt;
    ;;&lt;br /&gt;
esac&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: This will only allow access to the HN from the hosts/networks defined in SEGMENT. If you'd like to open up the OKPORTS on the HN to everybody, you can remove the ''-s $SEGMENT'' parameters from the iptables commands under the &amp;quot;Firewall: Allowing access to HN&amp;quot; section. The modified lines would look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
iptables -I INPUT -j ACCEPT -d $THISHOST --protocol tcp --destination-port $port&lt;br /&gt;
iptables -I INPUT -j ACCEPT -d $THISHOST --protocol udp --destination-port $port&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above script can be called like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
service firewall start&lt;br /&gt;
service firewall stop&lt;br /&gt;
service firewall restart&lt;br /&gt;
service firewall status&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It will set up the firewall for the HN according to the parameters you specified for OKPORTS, DMZs, etc. and then it will call each file under /etc/firewall.d and process  its configuration.&lt;br /&gt;
&lt;br /&gt;
So create a file under /etc/firewall.d The exact filename isn't important, as long as it's meaningful to you, e.g. &amp;lt;code&amp;gt;ExampleCompany&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;ve12&amp;lt;/code&amp;gt; and give it content like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This file is processed by /etc/init.d/firewall&lt;br /&gt;
CTID=&amp;quot;1&amp;quot;			# the container's ID#&lt;br /&gt;
CTNAME=&amp;quot;Customer1&amp;quot;		# A human-friendly label for the container&lt;br /&gt;
CTIP=&amp;quot;192.168.1.34&amp;quot;		# the IP address for this container &lt;br /&gt;
OPENPORTS=&amp;quot;80 443&amp;quot;		# ports that should be universally opened&lt;br /&gt;
				# to the entire Internet&lt;br /&gt;
DMZS=&amp;quot;1.2.3.0/24 5.6.7.8/32&amp;quot;	# IPs and blocks that should have full access&lt;br /&gt;
				# to the container's services&lt;br /&gt;
BANNED=&amp;quot;&amp;quot;			# IPs and blocks that should be entirely&lt;br /&gt;
				# blocked from the container's services&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And there you go. &lt;br /&gt;
&lt;br /&gt;
Note: You can only put one IP address inside the CTIP variable, but if your container has multiple IP addresses you can create a copy of the file for each IP address.&lt;br /&gt;
&lt;br /&gt;
Go ahead and start the firewall and check its status:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
service firewall restart&lt;br /&gt;
service firewall status&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, you can now add and edit the configurations for individual containers very easily. This method proves a lot easier to manage than Fedora's iptables-config mechamism!&lt;br /&gt;
&lt;br /&gt;
To make the firewall service automatically start when the HN boots, run&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
chkconfig --add firewall&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Debian Notes ===&lt;br /&gt;
&lt;br /&gt;
The setup above works fine for Debian as well, however /etc/init.d/functions is missing. Here is a very simple version that you can use:&lt;br /&gt;
&lt;br /&gt;
  # /etc/init.d/functions&lt;br /&gt;
  &lt;br /&gt;
  success() {&lt;br /&gt;
    echo -n &amp;quot;...success&amp;quot;&lt;br /&gt;
  } &lt;br /&gt;
  failure() {&lt;br /&gt;
    echo -n &amp;quot;...failure&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
== Setting up a firewall that allows per-container configuration ==&lt;br /&gt;
&lt;br /&gt;
This setup configures iptables on the HN to disallow access to all hosts, including the containers. However, it allows all traffic into the containers so they may define their own iptables rules and therefore manage their own firewall.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
iptables -P FORWARD ACCEPT&lt;br /&gt;
iptables -F FORWARD&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will remove all rules for the FORWARD chain so all packets can pass back and forth between containers and the outside world.&lt;br /&gt;
&lt;br /&gt;
If you want to use a firewall inside a container, please load these modules BEFORE starting the container:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
modprobe xt_tcpudp&lt;br /&gt;
modprobe ip_conntrack&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you do not, you will get an error like this: &amp;quot;iptables: No chain/target/match by that name&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If you want to use stateful firewall rules (and you should!) you will also need to make sure that 'ipt_state' is in the 'IPTABLES' option in your vz.conf file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IPTABLES=&amp;quot;ipt_REJECT ipt_tos ipt_limit ipt_multiport iptable_filter iptable_mangle ipt_TCPMSS ipt_tcpmss ipt_ttl ipt_length ipt_state&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also make sure the 'xt_state' module is loaded on the host:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
modprobe xt_state&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[Traffic accounting with iptables]]&lt;br /&gt;
&lt;br /&gt;
[[Category: Networking]]&lt;/div&gt;</summary>
		<author><name>Iandunn</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Setting_up_an_iptables_firewall&amp;diff=11768</id>
		<title>Setting up an iptables firewall</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Setting_up_an_iptables_firewall&amp;diff=11768"/>
		<updated>2011-12-27T19:23:43Z</updated>

		<summary type="html">&lt;p&gt;Iandunn: /* Setting up a HN-based firewall */ Added note about creating a copy of the container config file for each IP the container has assigned&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document consists of two parts. The first is setting up a firewall (using iptables) on the HN, which will restrict traffic to the containers. The effect would emulate, as far as the containers and their customers are concerned, an external hardware firewall controlled by the sysadmin. The second is setting up a firewall that protects the [[HN]] itself but still allows traffic to the containers, thus allowing individual containers to define their own iptables.&lt;br /&gt;
&lt;br /&gt;
While the firewalls shown here can be accomplished using iptables manually (or using Fedora core's iptables service), the methods presented here are especially modular and easy to modify. This is important when you have 20+ containers and a lot of other things to be doing...&lt;br /&gt;
&lt;br /&gt;
The scripts and pathnames given here are for Fedora Core 6, though they can probably be applied to most similar SysV-like systems with little modification.&lt;br /&gt;
&lt;br /&gt;
== A little background ==&lt;br /&gt;
&lt;br /&gt;
On our systems, we use the HN to provide privileged services which are not appropriate for access by the containers. For example, the HN acts as a backup server, runs Nagios for health monitoring, has a webserver for managing the 3ware RAID controller, etc. The containers are leased to customers, who can't entirely be trusted, especially if they get hacked. As such, our scenario is one in which the HN must be protected from all access (even from the containers) except for a few trusted hosts (e.g. my home-office).&lt;br /&gt;
&lt;br /&gt;
The exception to this is the nameserver, which we want open to the world. We use it as a caching nameserver for our containers and also to host DNS for a few customer domain.&lt;br /&gt;
&lt;br /&gt;
== Simple firewall configuration independent to IP addresses: vzfirewall ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Vzfirewall&amp;lt;/code&amp;gt; tool allows you to open/close ports for incoming connections with no dependencies to foreign IP addresses. E.g. you may allow a hostname &amp;lt;code&amp;gt;release.prod.example.com&amp;lt;/code&amp;gt; to connect to port 5432 of VE 1234 and leave all other ports closed by modifying &amp;lt;code&amp;gt;1234.conf&amp;lt;/code&amp;gt; file adding multiline &amp;lt;code&amp;gt;FIREWALL&amp;lt;/code&amp;gt; directive into it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
PRIVVMPAGES=&amp;quot;300000:300000&amp;quot;&lt;br /&gt;
HOSTNAME=&amp;quot;example.com&amp;quot;&lt;br /&gt;
...&lt;br /&gt;
FIREWALL=&amp;quot;&lt;br /&gt;
    ...&lt;br /&gt;
    # Allow access to PostgreSQL port only from release.prod &lt;br /&gt;
    # and release.test machines. You may use domain names here.&lt;br /&gt;
    [5432]&lt;br /&gt;
    release.prod.example.com&lt;br /&gt;
    release.test.example.com&lt;br /&gt;
    ...&lt;br /&gt;
&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You must then run &amp;lt;code&amp;gt;vzfirewall -a&amp;lt;/code&amp;gt; on your hardware node to apply changes made in &amp;lt;code&amp;gt;*.conf&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Note that it is recommended to use hostnames instead of IP addresses here, so the configuration is persistent for VE movements to different IP-address: you just need to run &amp;lt;code&amp;gt;vzfirewall -a&amp;lt;/code&amp;gt; again after movement. It is also reboot-safe, because applied to &amp;lt;code&amp;gt;/etc/sysconfig/iptables&amp;lt;/code&amp;gt; (at RHEL systems).&lt;br /&gt;
&lt;br /&gt;
Vzfirewall and its documentation are available at [http://en.dklab.ru/lib/dklab_vzfirewall/ http://en.dklab.ru/lib/dklab_vzfirewall/].&lt;br /&gt;
&lt;br /&gt;
== An alternative from the author of Shorewall ==&lt;br /&gt;
&lt;br /&gt;
For those who might find the solution provided in this wiki article unsatisfactory (for whatever reason), the creator of Shorewall (Tom Eastep) has written a nice article explaining how to use Shorewall on an OpenVZ host node to manage the host node, containers, and more... with quite a complex setup as an example.  The article IS NOT an introduction to Shorewall for beginners, so some pre-existing knowledge and understanding of Shorewall may be required.&lt;br /&gt;
&lt;br /&gt;
Shorewall and OpenVZ by Tom Eastep - http://www.shorewall.net/OpenVZ.html&lt;br /&gt;
&lt;br /&gt;
See also this OpenVZ Forum posting - http://forum.openvz.org/index.php?t=msg&amp;amp;goto=16406&amp;amp;&lt;br /&gt;
&lt;br /&gt;
== Setting up a HN-based firewall ==&lt;br /&gt;
&lt;br /&gt;
This setup emulates (to the containers anyway) an external hardware firewall. It protects the HN from any access and then defines what services and ports are allowed/banned for individual containers. This leaves the firewall controlled by the site administrator, not be individual containers and the hackers who've gotten into them. ;)&lt;br /&gt;
&lt;br /&gt;
First off, let's disable Fedora's existing &amp;lt;code&amp;gt;iptables&amp;lt;/code&amp;gt; service:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
service iptables stop&lt;br /&gt;
chkconfig iptables off&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create the new &amp;lt;code&amp;gt;firewall&amp;lt;/code&amp;gt; service. This code should be &amp;lt;code&amp;gt;/etc/init.d/firewall&amp;lt;/code&amp;gt; and then should be chmod'd 755.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
# firewall      Start iptables firewall&lt;br /&gt;
# chkconfig: 2345 97 87&lt;br /&gt;
# description:  Starts, stops and saves iptables firewall&lt;br /&gt;
# This script sets up the firewall for the INPUT chain (which is for&lt;br /&gt;
# the HN itself) and then processes the config files under&lt;br /&gt;
# /etc/firewall.d to set up additional rules in the FORWARD chain&lt;br /&gt;
# to allow access to containers' services.&lt;br /&gt;
&lt;br /&gt;
. /etc/init.d/functions&lt;br /&gt;
&lt;br /&gt;
# the IP block allocated to this server&lt;br /&gt;
SEGMENT=&amp;quot;192.168.0.0/24&amp;quot;&lt;br /&gt;
# the IP used by the hosting server itself&lt;br /&gt;
THISHOST=&amp;quot;192.168.0.1&amp;quot;&lt;br /&gt;
# services that should be allowed to the HN;&lt;br /&gt;
# services for containers are configured in /etc/firewall.d/*&lt;br /&gt;
OKPORTS=&amp;quot;53&amp;quot;&lt;br /&gt;
# hosts allowed full access through the firewall,&lt;br /&gt;
# to all containers and to this server&lt;br /&gt;
DMZS=&amp;quot;12.34.56.78 90.123.45.67&amp;quot;&lt;br /&gt;
&lt;br /&gt;
purge() {&lt;br /&gt;
  echo -n &amp;quot;Firewall: Purging and allowing all traffic&amp;quot;&lt;br /&gt;
  iptables -P OUTPUT ACCEPT&lt;br /&gt;
  iptables -P FORWARD ACCEPT&lt;br /&gt;
  iptables -P INPUT ACCEPT&lt;br /&gt;
  iptables -F&lt;br /&gt;
  success ; echo&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
setup() {&lt;br /&gt;
  echo -n &amp;quot;Firewall: Setting default policies to DROP&amp;quot;&lt;br /&gt;
  iptables -P INPUT DROP&lt;br /&gt;
  iptables -P FORWARD DROP&lt;br /&gt;
  iptables -I INPUT   -j ACCEPT -m state --state ESTABLISHED,RELATED&lt;br /&gt;
  iptables -I FORWARD -j ACCEPT -m state --state ESTABLISHED,RELATED&lt;br /&gt;
  iptables -I INPUT -j ACCEPT -i lo&lt;br /&gt;
  iptables -I FORWARD -j ACCEPT --source $SEGMENT&lt;br /&gt;
  success ; echo&lt;br /&gt;
&lt;br /&gt;
  echo &amp;quot;Firewall: Allowing access to HN&amp;quot;&lt;br /&gt;
  for port in $OKPORTS ; do&lt;br /&gt;
    echo -n &amp;quot;          port $port&amp;quot;&lt;br /&gt;
    iptables -I INPUT -j ACCEPT -s $SEGMENT -d $THISHOST --protocol tcp --destination-port $port&lt;br /&gt;
    iptables -I INPUT -j ACCEPT -s $SEGMENT -d $THISHOST --protocol udp --destination-port $port&lt;br /&gt;
    success ; echo&lt;br /&gt;
  done&lt;br /&gt;
  for ip in $DMZS ; do&lt;br /&gt;
    echo -n &amp;quot;          DMZ $ip&amp;quot;&lt;br /&gt;
    iptables -I INPUT   -i eth0 -j ACCEPT -s $ip&lt;br /&gt;
    iptables -I FORWARD -i eth0 -j ACCEPT -s $ip&lt;br /&gt;
    success ; echo&lt;br /&gt;
  done&lt;br /&gt;
&lt;br /&gt;
  CTSETUPS=`echo /etc/firewall.d/*`&lt;br /&gt;
  if [ &amp;quot;$CTSETUPS&amp;quot; != &amp;quot;/etc/firewall.d/*&amp;quot; ] ; then&lt;br /&gt;
  echo &amp;quot;Firewall: Setting up container firewalls&amp;quot;&lt;br /&gt;
  for i in $CTSETUPS ; do&lt;br /&gt;
    . $i&lt;br /&gt;
    echo -n &amp;quot;          $CTNAME CT$CTID&amp;quot;&lt;br /&gt;
    if [ -n &amp;quot;$BANNED&amp;quot; ]; then&lt;br /&gt;
      for source in $BANNED ;  do iptables -I FORWARD -j DROP --destination $CTIP --source $source ; done&lt;br /&gt;
    fi&lt;br /&gt;
    if [ -n &amp;quot;$OPENPORTS&amp;quot; ]; then&lt;br /&gt;
      for port in $OPENPORTS ; do iptables -I FORWARD -j ACCEPT --protocol tcp --destination $CTIP --destination-port $port ; done&lt;br /&gt;
      for port in $OPENPORTS ; do iptables -I FORWARD -j ACCEPT --protocol udp --destination $CTIP --destination-port $port ; done&lt;br /&gt;
    fi&lt;br /&gt;
    if [ -n &amp;quot;$DMZS&amp;quot; ]; then&lt;br /&gt;
      for source in $DMZS ; do iptables -I FORWARD -j ACCEPT --protocol tcp --destination $CTIP --source $source ; done&lt;br /&gt;
      for source in $DMZS ; do iptables -I FORWARD -j ACCEPT --protocol udp --destination $CTIP --source $source ; done&lt;br /&gt;
    fi&lt;br /&gt;
    [ $? -eq 0 ] &amp;amp;&amp;amp; success || failure&lt;br /&gt;
    echo&lt;br /&gt;
  done&lt;br /&gt;
  fi&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
case &amp;quot;$1&amp;quot; in&lt;br /&gt;
  start)&lt;br /&gt;
    echo &amp;quot;Starting firewall...&amp;quot;&lt;br /&gt;
    purge&lt;br /&gt;
    setup&lt;br /&gt;
    ;;&lt;br /&gt;
  stop)&lt;br /&gt;
    echo &amp;quot;Stopping firewall...&amp;quot;&lt;br /&gt;
    purge&lt;br /&gt;
    ;;&lt;br /&gt;
  restart)&lt;br /&gt;
    $0 stop&lt;br /&gt;
    $0 start&lt;br /&gt;
    ;;&lt;br /&gt;
  status)&lt;br /&gt;
    iptables -n -L&lt;br /&gt;
    ;;&lt;br /&gt;
  *)&lt;br /&gt;
    echo &amp;quot;Usage: $0 &amp;lt;start|stop|restart|status&amp;gt;&amp;quot;&lt;br /&gt;
    ;;&lt;br /&gt;
esac&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: This will only allow access to the HN from the hosts/networks defined in SEGMENT. If you'd like to open up the OKPORTS on the HN to everybody, you can remove the ''-s $SEGMENT'' parameters from the iptables commands under the &amp;quot;Firewall: Allowing access to HN&amp;quot; section. The modified lines would look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
iptables -I INPUT -j ACCEPT -d $THISHOST --protocol tcp --destination-port $port&lt;br /&gt;
iptables -I INPUT -j ACCEPT -d $THISHOST --protocol udp --destination-port $port&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above script can be called like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
service firewall start&lt;br /&gt;
service firewall stop&lt;br /&gt;
service firewall restart&lt;br /&gt;
service firewall status&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It will set up the firewall for the HN according to the parameters you specified for OKPORTS, DMZs, etc. and then it will call each file under /etc/firewall.d and process  its configuration.&lt;br /&gt;
&lt;br /&gt;
So create a file under /etc/firewall.d The exact filename isn't important, as long as it's meaningful to you, e.g. &amp;lt;code&amp;gt;ExampleCompany&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;ve12&amp;lt;/code&amp;gt; and give it content like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This file is processed by /etc/init.d/firewall&lt;br /&gt;
CTID=&amp;quot;1&amp;quot;			# the container's ID#&lt;br /&gt;
CTNAME=&amp;quot;Customer1&amp;quot;		# A human-friendly label for the container&lt;br /&gt;
CTIP=&amp;quot;192.168.1.34&amp;quot;		# the IP address for this container &lt;br /&gt;
OPENPORTS=&amp;quot;80 443&amp;quot;		# ports that should be universally opened&lt;br /&gt;
				# to the entire Internet&lt;br /&gt;
DMZS=&amp;quot;1.2.3.0/24 5.6.7.8/32&amp;quot;	# IPs and blocks that should have full access&lt;br /&gt;
				# to the container's services&lt;br /&gt;
BANNED=&amp;quot;&amp;quot;			# IPs and blocks that should be entirely&lt;br /&gt;
				# blocked from the container's services&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And there you go. &lt;br /&gt;
&lt;br /&gt;
Note: You can only put one IP address inside the CTIP variable, but if your container has multiple IP addresses you can create a copy of the file for each IP address.&lt;br /&gt;
&lt;br /&gt;
Go ahead and start the firewall and check its status:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
service firewall restart&lt;br /&gt;
service firewall status&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, you can now add and edit the configurations for individual containers very easily. This method proves a lot easier to manage than Fedora's iptables-config mechamism!&lt;br /&gt;
&lt;br /&gt;
To make the firewall service automatically start when the HN boots, run&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
chkconfig --add firewall&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Debian Notes ===&lt;br /&gt;
&lt;br /&gt;
The setup above works fine for Debian as well, however /etc/init.d/functions is missing. Here is a very simple version that you can use:&lt;br /&gt;
&lt;br /&gt;
  # /etc/init.d/functions&lt;br /&gt;
  &lt;br /&gt;
  success() {&lt;br /&gt;
    echo -n &amp;quot;...success&amp;quot;&lt;br /&gt;
  } &lt;br /&gt;
  failure() {&lt;br /&gt;
    echo -n &amp;quot;...failure&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
== Setting up a firewall that allows per-container configuration ==&lt;br /&gt;
&lt;br /&gt;
This setup configures iptables on the HN to disallow access to all hosts, including the containers. However, it allows all traffic into the containers so they may define their own iptables rules and therefore manage their own firewall.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
iptables -P FORWARD ACCEPT&lt;br /&gt;
iptables -F FORWARD&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will remove all rules for the FORWARD chain so all packets can pass back and forth between containers and the outside world.&lt;br /&gt;
&lt;br /&gt;
If you want to use a firewall inside a container, please load these modules BEFORE starting the container:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
modprobe xt_tcpudp&lt;br /&gt;
modprobe ip_conntrack&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you do not, you will get an error like this: &amp;quot;iptables: No chain/target/match by that name&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If you want to use stateful firewall rules (and you should!) you will also need to make sure that 'ipt_state' is in the 'IPTABLES' option in your vz.conf file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IPTABLES=&amp;quot;ipt_REJECT ipt_tos ipt_limit ipt_multiport iptable_filter iptable_mangle ipt_TCPMSS ipt_tcpmss ipt_ttl ipt_length ipt_state&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also make sure the 'xt_state' module is loaded on the host:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
modprobe xt_state&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[Traffic accounting with iptables]]&lt;br /&gt;
&lt;br /&gt;
[[Category: Networking]]&lt;/div&gt;</summary>
		<author><name>Iandunn</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Setting_up_an_iptables_firewall&amp;diff=8507</id>
		<title>Setting up an iptables firewall</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Setting_up_an_iptables_firewall&amp;diff=8507"/>
		<updated>2010-04-22T22:42:13Z</updated>

		<summary type="html">&lt;p&gt;Iandunn: /* Added chkconfig command to make service automatically start on boot */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document consists of two parts. The first is setting up a firewall (using iptables) on the HN, which will restrict traffic to the containers. The effect would emulate, as far as the containers and their customers are concerned, an external hardware firewall controlled by the sysadmin. The second is setting up a firewall that protects the [[HN]] itself but still allows traffic to the containers, thus allowing individual containers to define their own iptables.&lt;br /&gt;
&lt;br /&gt;
While the firewalls shown here can be accomplished using iptables manually (or using Fedora core's iptables service), the methods presented here are especially modular and easy to modify. This is important when you have 20+ containers and a lot of other things to be doing...&lt;br /&gt;
&lt;br /&gt;
The scripts and pathnames given here are for Fedora Core 6, though they can probably be applied to most similar SysV-like systems with little modification.&lt;br /&gt;
&lt;br /&gt;
== A little background ==&lt;br /&gt;
&lt;br /&gt;
On our systems, we use the HN to provide privileged services which are not appropriate for access by the containers. For example, the HN acts as a backup server, runs Nagios for health monitoring, has a webserver for managing the 3ware RAID controller, etc. The containers are leased to customers, who can't entirely be trusted, especially if they get hacked. As such, our scenario is one in which the HN must be protected from all access (even from the containers) except for a few trusted hosts (e.g. my home-office).&lt;br /&gt;
&lt;br /&gt;
The exception to this is the nameserver, which we want open to the world. We use it as a caching nameserver for our containers and also to host DNS for a few customer domain.&lt;br /&gt;
&lt;br /&gt;
== An alternative from the author of Shorewall ==&lt;br /&gt;
&lt;br /&gt;
For those who might find the solution provided in this wiki article unsatisfactory (for whatever reason), the creator of Shorewall (Tom Eastep) has written a nice article explaining how to use Shorewall on an OpenVZ host node to manage the host node, containers, and more... with quite a complex setup as an example.  The article IS NOT an introduction to Shorewall for beginners, so some pre-existing knowledge and understanding of Shorewall may be required.&lt;br /&gt;
&lt;br /&gt;
Shorewall and OpenVZ by Tom Eastep - http://www.shorewall.net/OpenVZ.html&lt;br /&gt;
&lt;br /&gt;
See also this OpenVZ Forum posting - http://forum.openvz.org/index.php?t=msg&amp;amp;goto=16406&amp;amp;&lt;br /&gt;
&lt;br /&gt;
== Setting up a HN-based firewall ==&lt;br /&gt;
&lt;br /&gt;
This setup emulates (to the containers anyway) an external hardware firewall. It protects the HN from any access and then defines what services and ports are allowed/banned for individual containers. This leaves the firewall controlled by the site administrator, not be individual containers and the hackers who've gotten into them. ;)&lt;br /&gt;
&lt;br /&gt;
First off, let's disable Fedora's existing &amp;lt;code&amp;gt;iptables&amp;lt;/code&amp;gt; service:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
service iptables stop&lt;br /&gt;
chkconfig iptables off&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create the new &amp;lt;code&amp;gt;firewall&amp;lt;/code&amp;gt; service. This code should be &amp;lt;code&amp;gt;/etc/init.d/firewall&amp;lt;/code&amp;gt; and then should be chmod'd 755.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
# firewall      Start iptables firewall&lt;br /&gt;
# chkconfig: 2345 08 92&lt;br /&gt;
# description:  Starts, stops and saves iptables firewall&lt;br /&gt;
# This script sets up the firewall for the INPUT chain (which is for&lt;br /&gt;
# the HN itself) and then processes the config files under&lt;br /&gt;
# /etc/firewall.d to set up additional rules in the FORWARD chain&lt;br /&gt;
# to allow access to containers' services.&lt;br /&gt;
&lt;br /&gt;
. /etc/init.d/functions&lt;br /&gt;
&lt;br /&gt;
# the IP block allocated to this server&lt;br /&gt;
SEGMENT=&amp;quot;192.168.0.0/24&amp;quot;&lt;br /&gt;
# the IP used by the hosting server itself&lt;br /&gt;
THISHOST=&amp;quot;192.168.0.1&amp;quot;&lt;br /&gt;
# services that should be allowed to the HN;&lt;br /&gt;
# services for containers are configured in /etc/firewall.d/*&lt;br /&gt;
OKPORTS=&amp;quot;53&amp;quot;&lt;br /&gt;
# hosts allowed full access through the firewall,&lt;br /&gt;
# to all containers and to this server&lt;br /&gt;
DMZS=&amp;quot;12.34.56.78 90.123.45.67&amp;quot;&lt;br /&gt;
&lt;br /&gt;
purge() {&lt;br /&gt;
  echo -n &amp;quot;Firewall: Purging and allowing all traffic&amp;quot;&lt;br /&gt;
  iptables -P OUTPUT ACCEPT&lt;br /&gt;
  iptables -P FORWARD ACCEPT&lt;br /&gt;
  iptables -P INPUT ACCEPT&lt;br /&gt;
  iptables -F&lt;br /&gt;
  success ; echo&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
setup() {&lt;br /&gt;
  echo -n &amp;quot;Firewall: Setting default policies to DROP&amp;quot;&lt;br /&gt;
  iptables -P INPUT DROP&lt;br /&gt;
  iptables -P FORWARD DROP&lt;br /&gt;
  iptables -I INPUT   -j ACCEPT -m state --state ESTABLISHED,RELATED&lt;br /&gt;
  iptables -I FORWARD -j ACCEPT -m state --state ESTABLISHED,RELATED&lt;br /&gt;
  iptables -I INPUT -j ACCEPT -i lo&lt;br /&gt;
  iptables -I FORWARD -j ACCEPT --source $SEGMENT&lt;br /&gt;
  success ; echo&lt;br /&gt;
&lt;br /&gt;
  echo &amp;quot;Firewall: Allowing access to HN&amp;quot;&lt;br /&gt;
  for port in $OKPORTS ; do&lt;br /&gt;
    echo -n &amp;quot;          port $port&amp;quot;&lt;br /&gt;
    iptables -I INPUT -j ACCEPT -s $SEGMENT -d $THISHOST --protocol tcp --destination-port $port&lt;br /&gt;
    iptables -I INPUT -j ACCEPT -s $SEGMENT -d $THISHOST --protocol udp --destination-port $port&lt;br /&gt;
    success ; echo&lt;br /&gt;
  done&lt;br /&gt;
  for ip in $DMZS ; do&lt;br /&gt;
    echo -n &amp;quot;          DMZ $ip&amp;quot;&lt;br /&gt;
    iptables -I INPUT   -i eth0 -j ACCEPT -s $ip&lt;br /&gt;
    iptables -I FORWARD -i eth0 -j ACCEPT -s $ip&lt;br /&gt;
    success ; echo&lt;br /&gt;
  done&lt;br /&gt;
&lt;br /&gt;
  CTSETUPS=`echo /etc/firewall.d/*`&lt;br /&gt;
  if [ &amp;quot;$CTSETUPS&amp;quot; != &amp;quot;/etc/firewall.d/*&amp;quot; ] ; then&lt;br /&gt;
  echo &amp;quot;Firewall: Setting up container firewalls&amp;quot;&lt;br /&gt;
  for i in $CTSETUPS ; do&lt;br /&gt;
    . $i&lt;br /&gt;
    echo -n &amp;quot;          $CTNAME CT$CTID&amp;quot;&lt;br /&gt;
    if [ -n &amp;quot;$BANNED&amp;quot; ]; then&lt;br /&gt;
      for source in $BANNED ;  do iptables -I FORWARD -j DROP --destination $CTIP --source $source ; done&lt;br /&gt;
    fi&lt;br /&gt;
    if [ -n &amp;quot;$OPENPORTS&amp;quot; ]; then&lt;br /&gt;
      for port in $OPENPORTS ; do iptables -I FORWARD -j ACCEPT --protocol tcp --destination $CTIP --destination-port $port ; done&lt;br /&gt;
      for port in $OPENPORTS ; do iptables -I FORWARD -j ACCEPT --protocol udp --destination $CTIP --destination-port $port ; done&lt;br /&gt;
    fi&lt;br /&gt;
    if [ -n &amp;quot;$DMZS&amp;quot; ]; then&lt;br /&gt;
      for source in $DMZS ; do iptables -I FORWARD -j ACCEPT --protocol tcp --destination $CTIP --source $source ; done&lt;br /&gt;
      for source in $DMZS ; do iptables -I FORWARD -j ACCEPT --protocol udp --destination $CTIP --source $source ; done&lt;br /&gt;
    fi&lt;br /&gt;
    [ $? -eq 0 ] &amp;amp;&amp;amp; success || failure&lt;br /&gt;
    echo&lt;br /&gt;
  done&lt;br /&gt;
  fi&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
case &amp;quot;$1&amp;quot; in&lt;br /&gt;
  start)&lt;br /&gt;
    echo &amp;quot;Starting firewall...&amp;quot;&lt;br /&gt;
    purge&lt;br /&gt;
    setup&lt;br /&gt;
    ;;&lt;br /&gt;
  stop)&lt;br /&gt;
    echo &amp;quot;Stopping firewall...&amp;quot;&lt;br /&gt;
    purge&lt;br /&gt;
    ;;&lt;br /&gt;
  restart)&lt;br /&gt;
    $0 stop&lt;br /&gt;
    $0 start&lt;br /&gt;
    ;;&lt;br /&gt;
  status)&lt;br /&gt;
    iptables -n -L&lt;br /&gt;
    ;;&lt;br /&gt;
  *)&lt;br /&gt;
    echo &amp;quot;Usage: $0 &amp;lt;start|stop|restart|status&amp;gt;&amp;quot;&lt;br /&gt;
    ;;&lt;br /&gt;
esac&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above script can be called like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
service firewall start&lt;br /&gt;
service firewall stop&lt;br /&gt;
service firewall restart&lt;br /&gt;
service firewall status&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It will set up the firewall for the HN according to the parameters you specified for OKPORTS, DMZs, etc. and then it will call each file under /etc/firewall.d and process  its configuration.&lt;br /&gt;
&lt;br /&gt;
So create a file under /etc/firewall.d The exact filename isn't important, as long as it's meaningful to you, e.g. &amp;lt;code&amp;gt;ExampleCompany&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;ve12&amp;lt;/code&amp;gt; and give it content like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This file is processed by /etc/init.d/firewall&lt;br /&gt;
CTID=&amp;quot;1&amp;quot;			# the container's ID#&lt;br /&gt;
CTNAME=&amp;quot;Customer1&amp;quot;		# A human-friendly label for the container&lt;br /&gt;
CTIP=&amp;quot;192.168.1.34&amp;quot;		# the IP address for this container &lt;br /&gt;
OPENPORTS=&amp;quot;80 443&amp;quot;		# ports that should be universally opened&lt;br /&gt;
				# to the entire Internet&lt;br /&gt;
DMZS=&amp;quot;1.2.3.0/24 5.6.7.8/32&amp;quot;	# IPs and blocks that should have full access&lt;br /&gt;
				# to the container's services&lt;br /&gt;
BANNED=&amp;quot;&amp;quot;			# IPs and blocks that should be entirely&lt;br /&gt;
				# blocked from the container's services&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And there you go. Go ahead and start the firewall and check its status:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
service firewall restart&lt;br /&gt;
service firewall status&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, you can now add and edit the configurations for individual containers very easily. This method proves a lot easier to manage than Fedora's iptables-config mechamism!&lt;br /&gt;
&lt;br /&gt;
To make the firewall service automatically start when the HN boots, run&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
chkconfig --add firewall&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Debian Notes ===&lt;br /&gt;
&lt;br /&gt;
The setup above works fine for Debian as well, however /etc/init.d/functions is missing. Here is a very simple version that you can use:&lt;br /&gt;
&lt;br /&gt;
  # /etc/init.d/functions&lt;br /&gt;
  &lt;br /&gt;
  success() {&lt;br /&gt;
    echo -n &amp;quot;...success&amp;quot;&lt;br /&gt;
  } &lt;br /&gt;
  failure() {&lt;br /&gt;
    echo -n &amp;quot;...failure&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
== Setting up a firewall that allows per-container configuration ==&lt;br /&gt;
&lt;br /&gt;
This setup configures iptables on the HN to disallow access to all hosts, including the containers. However, it allows all traffic into the containers so they may define their own iptables rules and therefore manage their own firewall.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
iptables -P FORWARD ACCEPT&lt;br /&gt;
iptables -F FORWARD&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will remove all rules for the FORWARD chain so all packets can pass back and forth between containers and the outside world.&lt;br /&gt;
&lt;br /&gt;
If you want to use a firewall inside a container, please load these modules BEFORE starting the container:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
modprobe xt_tcpudp&lt;br /&gt;
modprobe ip_conntrack&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you do not, you will get an error like this: &amp;quot;iptables: No chain/target/match by that name&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If you want to use stateful firewall rules (and you should!) you will also need to make sure that 'ipt_state' is in the 'IPTABLES' option in your vz.conf file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IPTABLES=&amp;quot;ipt_REJECT ipt_tos ipt_limit ipt_multiport iptable_filter iptable_mangle ipt_TCPMSS ipt_tcpmss ipt_ttl ipt_length ipt_state&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also make sure the 'xt_state' module is loaded on the host:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
modprobe xt_state&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[Traffic accounting with iptables]]&lt;br /&gt;
&lt;br /&gt;
[[Category: Networking]]&lt;/div&gt;</summary>
		<author><name>Iandunn</name></author>
		
	</entry>
</feed>