<?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=Sblaydes</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=Sblaydes"/>
	<link rel="alternate" type="text/html" href="https://wiki.openvz.org/Special:Contributions/Sblaydes"/>
	<updated>2026-05-15T15:02:37Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.1</generator>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Quick_Installation_CentOS_6&amp;diff=15870</id>
		<title>Quick Installation CentOS 6</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Quick_Installation_CentOS_6&amp;diff=15870"/>
		<updated>2015-03-05T18:19:19Z</updated>

		<summary type="html">&lt;p&gt;Sblaydes: Added ploop to the OpenVZ utils yum install line.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Warning|This is an unofficial guide, use at your own risk. For an official guide, see [[Quick installation]].}}&lt;br /&gt;
&lt;br /&gt;
This quick installation quide assumes you have CentOS 6 64-bit installed with [http://wiki.centos.org/HowTos/Virtualization/OpenVZ SELinux and Firewall disabled], and that the containers will be on the same subnet as the host node.&lt;br /&gt;
&lt;br /&gt;
The node's IP is 192.168.1.99/24 and the gateway is 192.168.1.1. The containers will have 192.168.1.101, 192.168.1.102, etc...&lt;br /&gt;
&lt;br /&gt;
* Add the OpenVZ yum repo&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# wget -O /etc/yum.repos.d/openvz.repo 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;
* Ensure the yum repo points to RHEL6 packages&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# vi /etc/yum.repos.d/openvz.repo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Install the OpenVZ kernel and ensure it's the 1st option in grub&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# yum install vzkernel&lt;br /&gt;
# vi /boot/grub/menu.lst&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Install the OpenVZ utilities&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# yum install vzctl vzquota ploop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Tune /etc/sysctl.conf&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# vi /etc/sysctl.conf&lt;br /&gt;
net.ipv4.ip_forward = 1&lt;br /&gt;
net.ipv4.conf.default.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.all.rp_filter = 1&lt;br /&gt;
kernel.sysrq = 1&lt;br /&gt;
net.ipv4.conf.default.send_redirects = 1&lt;br /&gt;
net.ipv4.conf.all.send_redirects = 0&lt;br /&gt;
net.ipv4.icmp_echo_ignore_broadcasts=1&lt;br /&gt;
net.ipv4.conf.default.forwarding=1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last 2 steps are necessary only if you are planning on using '''veth''' containers&lt;br /&gt;
&lt;br /&gt;
* Create a vmbr0 bridge and add the host's interface to it&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# vi /etc/sysconfig/network-scripts/ifcfg-vmbr0 &lt;br /&gt;
DEVICE=&amp;quot;vmbr0&amp;quot;&lt;br /&gt;
BOOTPROTO=&amp;quot;static&amp;quot;&lt;br /&gt;
IPV6INIT=&amp;quot;no&amp;quot;&lt;br /&gt;
ONBOOT=&amp;quot;yes&amp;quot;&lt;br /&gt;
TYPE=&amp;quot;Bridge&amp;quot;&lt;br /&gt;
DELAY=0&lt;br /&gt;
IPADDR=192.168.1.99&lt;br /&gt;
NETMASK=255.255.255.0&lt;br /&gt;
GATEWAY=192.168.1.1&lt;br /&gt;
&lt;br /&gt;
# vi /etc/sysconfig/network-scripts/ifcfg-eth0 &lt;br /&gt;
DEVICE=&amp;quot;eth0&amp;quot;&lt;br /&gt;
ONBOOT=&amp;quot;yes&amp;quot;&lt;br /&gt;
IPV6INIT=&amp;quot;no&amp;quot;&lt;br /&gt;
TYPE=&amp;quot;Ethernet&amp;quot;&lt;br /&gt;
BRIDGE=&amp;quot;vmbr0&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Create /etc/vz/vznet.conf with the following content. This will automatically add/remove the container's interface to the bridge when you start/stop the container.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# vi /etc/vz/vznet.conf &lt;br /&gt;
#!/bin/bash&lt;br /&gt;
EXTERNAL_SCRIPT=&amp;quot;/usr/sbin/vznetaddbr&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Done. Reboot&lt;br /&gt;
&lt;br /&gt;
== Create a VENET Container ==&lt;br /&gt;
&lt;br /&gt;
* Create a CT&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# vzctl create 101 --ostemplate centos-6-x86_64 --config vswap-1g&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Configure the CT&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# vzctl set 101 --save --name server101&lt;br /&gt;
# vzctl set 101 --save --onboot yes&lt;br /&gt;
# vzctl set 101 --save --hostname server101.example.com&lt;br /&gt;
# vzctl set 101 --save --ipadd 192.168.1.101&lt;br /&gt;
# vzctl set 101 --save --searchdomain example.com&lt;br /&gt;
# vzctl set 101 --save --nameserver 8.8.8.8 --nameserver 8.8.4.4&lt;br /&gt;
# vzctl set 101 --save --cpus 4&lt;br /&gt;
# vzctl set 101 --save --ram 8G&lt;br /&gt;
# vzctl set 101 --save --swap 4G&lt;br /&gt;
# vzctl set 101 --save --diskspace 100G&lt;br /&gt;
# vzctl start 101&lt;br /&gt;
# vzctl exec 101 passwd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Done. Enjoy your new VENET container&lt;br /&gt;
&lt;br /&gt;
== Create a VETH Container ==&lt;br /&gt;
&lt;br /&gt;
* Create a CT&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# vzctl create 102 --ostemplate centos-6-x86_64 --config vswap-1g&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Configure the CT&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# vzctl set 102 --save --name server102&lt;br /&gt;
# vzctl set 102 --save --onboot yes&lt;br /&gt;
# vzctl set 102 --save --hostname server102.example.com&lt;br /&gt;
# vzctl set 102 --save --netif_add eth0,,,FE:FF:FF:FF:FF:FF&lt;br /&gt;
# vzctl set 102 --save --searchdomain example.com&lt;br /&gt;
# vzctl set 102 --save --nameserver 8.8.8.8 --nameserver 8.8.4.4&lt;br /&gt;
# vzctl set 102 --save --cpus 4&lt;br /&gt;
# vzctl set 102 --save --ram 8G&lt;br /&gt;
# vzctl set 102 --save --swap 4G&lt;br /&gt;
# vzctl set 102 --save --diskspace 100G&lt;br /&gt;
# vzctl start 102&lt;br /&gt;
# vzctl exec 102 passwd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
FE:FF:FF:FF:FF:FF will ensure a permanent MAC address on the bridge interface.&lt;br /&gt;
&lt;br /&gt;
(Linux bridges behave strangely. They use the smallest MAC address of all the attached interfaces. If you add a new interface to the bridge with an even smaller MAC, the MAC of the bridge will change causing network interruption until the switch re-learns the new MAC) &lt;br /&gt;
&lt;br /&gt;
* Configure the network of a RHEL-based container &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# cat &amp;lt;&amp;lt; _EOF_ &amp;gt; /vz/root/102/etc/sysconfig/network-scripts/ifcfg-eth0&lt;br /&gt;
DEVICE=&amp;quot;eth0&amp;quot;&lt;br /&gt;
HOSTNAME=&amp;quot;server102&amp;quot;&lt;br /&gt;
IPV6INIT=&amp;quot;no&amp;quot;&lt;br /&gt;
MTU=&amp;quot;1500&amp;quot;&lt;br /&gt;
TYPE=&amp;quot;Ethernet&amp;quot;&lt;br /&gt;
ONBOOT=yes&lt;br /&gt;
BOOTPROTO=static&lt;br /&gt;
IPADDR=192.168.1.102&lt;br /&gt;
NETMASK=255.255.255.0&lt;br /&gt;
GATEWAY=192.168.1.1&lt;br /&gt;
_EOF_&lt;br /&gt;
&lt;br /&gt;
# vzctl exec 102 /etc/init.d/network restart&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Configure the network of a Debian-based container&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# cat &amp;lt;&amp;lt; _EOF_ &amp;gt; /vz/root/102/etc/network/interfaces&lt;br /&gt;
auto lo eth0&lt;br /&gt;
iface lo inet loopback&lt;br /&gt;
iface eth0 inet static&lt;br /&gt;
	address 192.168.1.102&lt;br /&gt;
	netmask 255.255.255.0&lt;br /&gt;
	gateway 192.168.1.1&lt;br /&gt;
_EOF_&lt;br /&gt;
&lt;br /&gt;
# vzctl exec 102 /etc/init.d/networking restart&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Done. Enjoy your new VETH container&lt;br /&gt;
&lt;br /&gt;
[[Category: Installation]]&lt;br /&gt;
[[Category: HOWTO]]&lt;/div&gt;</summary>
		<author><name>Sblaydes</name></author>
		
	</entry>
</feed>