Red de Contenedor OpenVZ

Maquinas virtuales, herramientas...

Moderador: frank

Responder
Avatar de Usuario
_itachi_
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
_itachi_
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 192.168.0.0/24 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 192.168.0.101 dev eth0
[ve-101]# /sbin/ip route add default dev eth0

Notes:

Until you ifconfig eth0 it won't appear. When you do it will use the mac address netif_add added earlier
192.168.0.101 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
http://openvz.org/pipermail/users/2005- ... 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 192.168.0.101 dev veth101.0

Fin 1ra parte

Responder