Red de Contenedor OpenVZ

Maquinas virtuales, herramientas...

Moderador: frank

Avatar de Usuario
Mensajes: 44
Registrado: Jue, 20 Feb 2014, 16:12

Red de Contenedor OpenVZ

Mensaje por _itachi_ » Lun, 06 Jul 2015, 13:34

Hola comunidad, he instalado recientemente Proxmox-ve v3.2 en mi servidor para virtualizar un server de clientes ligeros en Debian. El problema es que le agrego una red virtual a la pc y el servidor dhcp que instalo en ella no inicia, el log dice que no encuentra una targeta de red disponible o no se encuentra.

Sin enbargo me conecto a dicho contenedor via ssh perfectamente desde el server fisico. Como configuro esa red virtual para que me trabaje por una de las targetas de red del servidor? :shock:

Avatar de Usuario
Mensajes: 44
Registrado: Jue, 20 Feb 2014, 16:12

Re: Red de Contenedor OpenVZ

Mensaje por _itachi_ » Jue, 09 Jul 2015, 11:22

Bueno familia, ya resolvi el problema, tuve que ir al sitio oficial del proxmox y buscar en la wiki algo relacionado con el tema y aqui les muestro la socion. :) Disculpen que esta en Ingles pero Google es un poco malo traduciendo OK. :D

Common configurations with virtual Ethernet devices

Module vzethdev must be loaded to operate with veth devices.
Simple configuration with virtual Ethernet device

Assuming that is being used on your LAN, the following sections show how to configure a container for the LAN using veth.
Start a CT

[host-node]# vzctl start 101

Add veth device to CT

[host-node]# vzctl set 101 --netif_add eth0 --save

This allocates a MAC address and associates it with the host eth0 port.
Configure devices in CT0

The following steps are needed when the CT is not bridged to a CT0 network interface. That is because the CT is connected to a virtual network that is "behind" CT0. CT0 must forward packets between its physical network interface and the virtual network interface where CT is located. The first step below to configure the interface is not necessary if the container has been started, since the device will have been initialized.

[host-node]# ifconfig veth101.0 0
[host-node]# echo 1 > /proc/sys/net/ipv4/conf/veth101.0/forwarding
[host-node]# echo 1 > /proc/sys/net/ipv4/conf/veth101.0/proxy_arp
[host-node]# echo 1 > /proc/sys/net/ipv4/conf/eth0/forwarding
[host-node]# echo 1 > /proc/sys/net/ipv4/conf/eth0/proxy_arp

Configure device in CT

The following steps show an example of a quick manual configuration of the CT network interface. Typically, you would configure the network settings in /etc/network/interfaces (Debian, see below) or however it is normally configured on your distribution. You can also comment or remove the configuration for venet0, if it exists, because that device will not be used.

[host-node]# vzctl enter 101
[ve-101]# /sbin/ifconfig eth0 0
[ve-101]# /sbin/ip addr add dev eth0
[ve-101]# /sbin/ip route add default dev eth0


Until you ifconfig eth0 it won't appear. When you do it will use the mac address netif_add added earlier is chosen to be an unrouteable private ip address. Where 101 reminds you that it is node 101.
The "ip route" tells all traffic to head to "device eth0"
In theory you could use dhcpd with OpenVZ and dhclient to pick up an DHCP address from your router instead of hardwiring it ... 00020.html

Add route in CT0

Since CT0 is acting as a router between its physical network interface and the virtual network interface of the CT, we need to add a route to the CT to direct traffic to the right destination.

[host-node]# ip route add dev veth101.0

Fin 1ra parte