<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hello!<br>
<br>
In this message I will try to explain the situation with bridged and
host-only networks <br>
and bridges and VLANs and bonding in OpenVZ/Virtuozzo.<br>
<br>
It also covers the issues mentioned (and worked around) in<br>
<pre wrap=""><a class="moz-txt-link-freetext" href="https://lists.openvz.org/pipermail/users/2016-February/006788.html">https://lists.openvz.org/pipermail/users/2016-February/006788.html</a></pre>
(I will refer to this message as [6788])<br>
<br>
So, here we talk about bridged and host-only networks.<br>
<br>
=================<br>
<br>
The host-only network is intended to connect only vm/ct interfaces,
so<br>
it does not have to be connected to a host network adapter.<br>
To create it, it is necessary to have just a bridge. But in current
implementation<br>
of OpenVZ and libvirt, you need an adapter for the bridge to be
used.<br>
<br>
A host-only network is created by<br>
> prlsrvctl net add XXX<br>
<br>
So on creation of host-only bridge (named <b>virbrN</b>) the
virtual interface virbrN-nic <br>
is created and connected to bridge. So the name of interface one may
provide on<br>
> prlsrvctl net add XXX -i <interface><br>
is <b>ignored</b>. Thus it is impossible to create a host-only
network over specific<br>
user-defined bridge using prlsrvctl (as in question referenced by
[6788]).<br>
<br>
There are two possibilities to achieve the effect you need:<br>
1) Proposed in [6788]: create a host-only network without specifying
interface,<br>
and then change bridge name in libvirt config.<br>
<br>
2) Create a fake interface (e.g. tun/tap) and connect it to a bridge
<br>
(in fact, virbrN-nic is a tun device itself).<br>
Then you will be able to create a <b>bridged</b> network over this
bridge using<br>
> prlsrvctl net add XXX -i tun1 -t bridged<br>
The tun device may be down, bridge (if up) will work, connecting the
vm/ct interfaces.<br>
<br>
=================<br>
<br>
The bridged network is intended to connect vm/ct interfaces to a
host network adapter.<br>
So you can provide an interface name, and OpenVZ will try to find a
bridge <br>
connected to this interface, and create a network over it <br>
(the interface does not have to be a physical one; that was used in
previous section).<br>
<br>
=================<br>
<br>
The problem mentioned in message being replied is related to a bug
in OpenVZ, <br>
and must not reproduce now (prl-disp-service-7.0.321+).<br>
<br>
An important notice about networks over vlan/bond interfaces is that
interfaces<br>
must be carefully configured (e.g. in ifcfg-* scripts). <br>
Libvirt usually gathers information about these interfaces using a
library called <i>netcf<br>
</i>(package <i>netcf-libs</i> in my distro). So if you face some
issues with bridged networks over<br>
vlan/bond interfaces, and you have <i>libnetcf.so.* </i>installed,
you should check if<br>
> ncftool dumpxml <bridge> (may require
installing <i>netcf</i> package)<br>
outputs correct configuration (mentions vlan/bond, not just
ethernet).<br>
If not, you should probably fix your configs.<br>
<br>
<br>
<blockquote type="cite">
<pre wrap="">Hello.
Previously we used something like
NETIF="ifname=eth0,bridge=br100,mac=E2:18:28:65:35:AA,host_ifname=veth118.0,host_mac=00:18:51:89:A9:D7"
to configure bridged networks for containers.
Now this evidently doesn't work.
I've tried to follow Virtuozzo 7 documentation (where bond0.100 is
interface for vlan 100 over bond0).
# prlsrvctl net add vlan100 -t bridged -i bond0.100
Failed to add Virtual Network vlan100: Operation failed. Failed to
execute the operation.
What am I doing wrong? How am I supposed to configure bridged network
for container?
I've tried to follow
<a class="moz-txt-link-freetext" href="https://lists.openvz.org/pipermail/users/2016-February/006788.html">https://lists.openvz.org/pipermail/users/2016-February/006788.html</a>, but
it doesn't work for me, prlsrvctl net list doesn't see the network after
modification.</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Your sincerely,
Maxim Perevedentsev</pre>
</body>
</html>