|
|
|
Re: How to make broadcasting work in a VE [message #48809 is a reply to message #48807] |
Fri, 07 December 2012 10:47 |
maka
Messages: 3 Registered: December 2012
|
Junior Member |
|
|
Hello maya,
I too had some problems with this initially, but I think I have got the hang of it now. (I'm not sure every description below is 100% accurate, but it works at least )
First, you are correct in that it is not possible to broadcast from CT via venet interfaces. You need veth!
In order to keep a consistency between everything, I try to use the container id to identify things like MAC and IP addresses, hence I use 100 below for this purpose (since your container has id 100).
From your configuration file it looks like you at least use debian for your CT. I assume you use debian also for the host? In that case, this is how I solved it:
On the host
-----------
Install the bridge-utils package (apt-get install bridge-utils)
Edit the /etc/network/interfaces file. Mine looks like this:
auto lo
iface lo inet loopback
iface eth0 inet manual
auto vzbr0
iface vzbr0 inet dhcp
bridge_ports eth0
bridge_fd 0
This will automatically create the vzbr0 bridge and "connect" it to the physical eth0 device. Note that I use dhcp to obtain ip address for the host!
You should now restart your host and test that everything works as before. The adding of the bridge shall not break anything! Try ifconfig to see that the vzbr0 interface is added and has an IP address. It shall also have an identical MAC address as your eth0 interface.
Next is editing your CT.conf file (100.conf).
You have to remove (or uncomment) the IP_ADDRESS line. If I understand correct, that line essentially creates the venet interface in the container.
Then add the following line:
NETIF=" ifname=eth0,bridge=vzbr0,mac=00:00:00:00:01:00,host_ifname=v eth100.0,host_mac=FE:FF:FF:FF:FF:FF "
(there shouldn't be any whitespaces in this line, the fonts control in this forum might mess this up?)
This will create an interface in the CT named eth0. The same interface will also be available on the host called veth100.0. The interface is connected to the bridge vzbr0.
The interface has to have a MAC address. On the CT side I name it to the same number as my CTID. I hope I never get a device in my network that starts with that many zeros in the MAC address , in that case there will of coarse be a conflict. On the host side however you need to use the ethernet multicast address in order to be able to broadcast from within the CT.
On the container
----------------
Now you probably have to edit the /etc/network/interfaces in the CT. Mine looks like this:
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.0.100
netmask 255.255.255.0
gateway 192.168.0.1
broadcast 192.168.0.255
Restart the container. Enter the container and confirm that the MAC and IP address is correct with ifconfig.
|
|
|