Before you can connect a virtual network adapter inside a Container to a physical or a virtual LAN, you first have to create a network bridge on the Hardware Node. The bridge will act as a binding interface between the adapter inside a Container and a physical or VLAN adapter on the Hardware Node.
To create a VLAN adapter, use net_bridgeType
as the data type for the net_device
element. The following explains how to populate the structure parameters:
id
-- a unique name that you would like to use for the new bridge.
network_id
-- a unique name identifying the Virtuozzo virtual network associated with this bridge. Again, you can use any name you prefer (e.g. vznet1
). You will use this ID later to attach LAN/VLAN adapters and virtual network interfaces inside Containers to the bridge.
The ip_address
and dhcp
parameters are optional.
Example:
The following example shows how to create a bridge.
We use vzbridge5
as the bridge name, and vznet5
as the network ID.
Input
<packet xmlns:ns2="http://www.swsoft.com/webservices/vzl/4.0.0/networkm" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="4.0.0">
<target>vzanetworkm</target>
<data>
<vzanetworkm>
<add>
<net_device xsi:type="ns2:net_bridgeType">
<ns2:id>vzbridge5</ns2:id>
<ns2:network_id>dnpuZXQ1</ns2:network_id>
</net_device>
</add>
</vzanetworkm>
</data>
</packet>
Output
The output contains the information about the created network bridge, which indicates that the bridge was created successfully.
<ns1:packet xmlns:ns4="http://www.swsoft.com/webservices/vzl/4.0.0/types" xmlns:ns1="http://www.swsoft.com/webservices/vzl/4.0.0/protocol" xmlns:ns3="http://www.swsoft.com/webservices/vzl/4.0.0/networkm" xmlns:ns2="http://www.swsoft.com/webservices/vza/4.0.0/vzanetworkm" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="14c45c07df5t7e87rd5c" time="2007-01-31T09:14:17+0000" priority="0" version="4.0.0">
<ns1:origin>vzanetworkm</ns1:origin>
<ns1:target>vzclient4</ns1:target>
<ns1:dst>
<ns1:director>gend</ns1:director>
</ns1:dst>
<ns1:data>
<ns2:vzanetworkm>
<ns2:net_device xsi:type="ns3:net_bridgeType">
<ns4:id>vzbridge5</ns4:id>
<ns4:network_id>dnpuZXQ1</ns4:network_id>
</ns2:net_device>
</ns2:vzanetworkm>
</ns1:data>
<ns1:src>
<ns1:director>gend</ns1:director>
</ns1:src>
</ns1:packet>