OpenVZ 7 (virtuozzo 7) Enable netfilter as standard

edited March 2022 in LES Talk

Written by Anthony Smith, 1 Aug 2020
Article was migrated from WordPress to Vanilla in March 2022

This quick tips post is aimed at hosts that use SolusVM and OpenVZ 7 or Virtuozzo 7.

I have probably had to answer this question around 30 times now so I thought I would make a quick blog post about it so it can be referred too by those that need it.

To build container config files solsuvm uses the file: /etc/vz/conf/ve-vswap-solus.conf-sample

The standard looks like this:

#  Copyright (C) 2000-2011, Parallels, Inc. All rights reserved.
#
#  This program is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 2 of the License, or
#  (at your option) any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software
#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#

# This config is valid for VSwap-enabled kernel (which currently means
# any RHEL6-based kernel, i.e. 042test* or 042stab*).
ONBOOT="yes"
# UBC parameters (in form of barrier:limit)
PHYSPAGES="0:512M"
SWAPPAGES="0:1G"
KMEMSIZE="233M:256M"
LOCKEDPAGES="256M"
PRIVVMPAGES="unlimited"
SHMPAGES="unlimited"
NUMPROC="unlimited"
VMGUARPAGES="0:unlimited"
OOMGUARPAGES="0:unlimited"
NUMTCPSOCK="unlimited"
NUMFLOCK="unlimited"
NUMPTY="unlimited"
NUMSIGINFO="unlimited"
TCPSNDBUF="unlimited"
TCPRCVBUF="unlimited"
OTHERSOCKBUF="unlimited"
DGRAMRCVBUF="unlimited"
NUMOTHERSOCK="unlimited"
DCACHESIZE="unlimited"
NUMFILE="unlimited"
NUMIPTENT="unlimited"

# Disk quota parameters (in form of softlimit:hardlimit)
DISKSPACE="50G:50G"
DISKINODES="131072:144179"
QUOTATIME="0"

# CPU fair scheduler parameter
CPUUNITS="1000"

For end-user containers to get full netfilter access which in simple terms allows many iptables functions and VPNs to start working within containers NETFILTER="full" needs to be added to the containers config file and the container restarted.

To save that hassle simply add the following at the end of: /etc/vz/conf/ve-vswap-solus.conf-sample

#Netfilter
NETFILTER="full"

That way they will get it as standard without any host intervention required, saving hassle for everyone and reducing tickets.

Users may report errors such as:

Error: iptables: No chain/target/match by that name

or

Error: iptables v1.4.21: can't initialize iptables table `nat

Not having netfilter=full in the container config is usually the cause, if you are a VPS user reading this and have found the errors above point your host to this article.

Thanked by (1)Abdullah
Sign In or Register to comment.