I have just one network interface card (hardware) on my server. I run samba in a VE (openVZ), that means not in V0 (the main host). The samba VE uses venet by default which doesn't support UDP broadcasting. The problem is, that I cannot join machines to the samba domain because UDP broadcasts (netbios) for name lookups don't work with venet. The only way joining machines to the domain is to set a WINS server on the client I want to join to the domain. (UDP broadcasts are not needed in this case) But I don't want to use a WINS server. I want to use broadcasting. Just for fun to see if things are working without venet, I installed samba on the V0, the main host which is not using venet but operating over eth0 which allows broadcasts. With this setup I don't need to set a WINS server on the client I want to join to the domain. So the main question is: How can I make domain joins to the samba VE work without using WINS server? How do I need to set up the samba VE? I tried to configure veth but I didn't succeed. (wiki.openvz.org/Virtual_Ethernet_device) Do I need a bridge? Is there anyone who already did this and could give a detailed howto?
Re: How to make broadcasting work in a VE
this must be a standard problem. is there a reason why nobody is answering to my post? did I do something wrong? shouldn't I use samba in an openvz VE at all?
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.