Broadcast into Virtuozzo Container

Problem:
Broadcasting into a Virtuozzo container is not possible with the standard (host-routed) IP setup. So you cannot run e.g. a samba or dhcp server there.


Solution:

You have to set up IP in bridged networking mode:
If your container (here VEID 1006) already has some IP through your standard setup, remove it:

vzctl set 1006 --ipdel 192.168.1.6 --save

Now setting up bridged networking mode:
Container has IP 192.168.1.6, NS and gateway is 192.168.1.1, interface within the container will be eth0

vzctl set 1006 --netif_add eth0 --save
vzctl set 1006 --ifname eth0 --ipadd 192.168.1.6 --save
vzctl set 1006 --ifname eth0 --nameserver 192.168.1.1 --save
vzctl set 1006 --ifname eth0 --gateway 192.168.1.1 --save
vznetcfg net new vznetwork1
vzctl set 1006 --ifname eth0 --network vznetwork1 --save
vznetcfg net addif vznetwork1 eth0