OpenVZ Forum


Home » General » Support » How to make broadcasting work in a VE
How to make broadcasting work in a VE [message #48595] Wed, 24 October 2012 15:19 Go to next message
maya is currently offline  maya
Messages: 4
Registered: October 2012
Location: vienna
Junior Member
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?
  • Attachment: 100.conf
    (Size: 1.02KB, Downloaded 254 times)
Re: How to make broadcasting work in a VE [message #48685 is a reply to message #48595] Tue, 30 October 2012 19:55 Go to previous messageGo to next message
maya is currently offline  maya
Messages: 4
Registered: October 2012
Location: vienna
Junior Member
nobody has an idea?
Re: How to make broadcasting work in a VE [message #48807 is a reply to message #48595] Thu, 06 December 2012 12:30 Go to previous messageGo to next message
maya is currently offline  maya
Messages: 4
Registered: October 2012
Location: vienna
Junior Member
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?
Re: How to make broadcasting work in a VE [message #48809 is a reply to message #48807] Fri, 07 December 2012 10:47 Go to previous message
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 Wink)

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 Smile, 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.

Previous Topic: how to switch off automatic suspend/resume?
Next Topic: container start error (/bin/grep permission)
Goto Forum:
  


Current Time: Sun Nov 03 19:49:27 GMT 2024

Total time taken to generate the page: 0.03537 seconds