[CentOS] OpenVZ – container based virtualization quick guide. Part 2

In this guide, we will be exploring how to use the tools which come with OpenVZ and setup a internet facing container/vm. This part of the guide also assumes you have followed part 1 to setup the container already and have a working environment.

In part 1, we setup a CentOS container which we could enter/exit but we didn’t do anything else on the network. What we want to do is set it up so we have the ability to bridge our hosts’ network and define static IP for network interface.


yum install bridge-utils

[root@tooncent ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
# Broadcom Corporation NetXtreme BCM5761 Gigabit Ethernet PCIe
DEVICE=eth0
ONBOOT=yes
BRIDGE=bridge0

[root@tooncent ~]# cat /etc/sysconfig/network-scripts/ifcfg-bridge0
DEVICE=bridge0
TYPE=Bridge
BOOTPROTO=dhcp
ONBOOT=yes
DHCP_HOSTNAME="tooncent.com"

/etc/init.d/network restart

[root@tooncent ~]# cat ifcfg-veth101.0
# Broadcom Corporation NetXtreme BCM5761 Gigabit Ethernet PCIe
DEVICE=veth101.0
ONBOOT=yes
BRIDGE=bridge0

vzctl set 101 --netif_add eth0 --save
echo '
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=dhcp
' > /vz/private/101/etc/sysconfig/network-scripts/ifcfg-eth0

After this just start and you should be good to go.

[CentOS] OpenVZ – container based virtualization quick guide. Part 1 of 2

[Bash] Performing array intersection with Bash

Error while compiling apache on CentOS 5.5

How do you print number of files for each folder in a directory [Linux]

Next Page »