Previous page

Next page

Locate page in Contents

Print this page

Adding a VLAN adapter to the Hardware Node.

To create a VLAN adapter, use net_vlanType as the data type for the net_device element. The following explains how to populate the structure parameters.

Mandatory input parameters:

vlan_id -- the VLAN adapter ID. The ID is an arbitrary number that must be unique on this Hardware Node. The call will automatically generate a unique name for this adapter using this number. For example, if you specify 5 and attach the adapter to the eth0 physical network adapter, the name of the VLAN adapter will be eth0.5. The name will be returned to the caller via the id element of the return structure.

base_device_id -- the name of the physical network adapter to attach the VLAN adapter to. This can be any physical network interface card installed on the Hardware Node. This association becomes permanent once the VLAN adapter is created. If later you decide to attach a VLAN adapter to a different physical adapter, you will have to delete and recreate it using the desired settings.

Optional input parameters:

ip_address -- assign an IP address (or multiple addresses) to the VLAN adapter if you would like the computers connected to it to be accessible from other networks.

dhcp -- a DHCP flag. Include this element in the request if you would like the VLAN adapter to receive the IP address through DHCP.

network_id -- Virtuozzo virtual network ID. Use this parameters if you would like to attach this VLAN adapter to a network bridge. A unique network ID is assigned to every Virtuozzo network bridge (see Creating a network bridge on the Hardware Node above).

Example:

The following example shows how to add a VLAN adapter to the Hardware Node running Linux OS. In the example, we are setting the device ID to 5, associating the VLAN adapter with the eth1 physical network adapter, and attaching the adapter to the vzbridge5 network bridge that we created earlier.

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_vlanType">

<ns2:vlan_id>5</ns2:vlan_id>

<ns2:base_device_id>eth1</ns2:base_device_id>

<ns2:network_id>dnpuZXQ1</ns2:network_id>

</net_device>

</add>

</vzanetworkm>

</data>

</packet>

Output

The output contains the information about the created VLAN adapter, including the ID that was generated automatically. In this case, the ID is eth1.5. As you can see, the ID is composed of the name of the physical interface this VLAN adapter is attached to (i.e. eth1) and the vlan_id that we specified in the request (i.e. 5).

As a result, we have a new VLAN adapter created, and plugged into a network bridge. If you have virtual network adapters inside Containers connected to the bridge, they now have access to the VLAN adapter. If you don't have any virtual adapters connected to the bridge, or if you want to connect more, you may connect them at any time now.

<?xml version="1.0" encoding="UTF-8"?><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="15c45c0814bt390crd5c" time="2007-01-31T09:25:44+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_vlanType">

<ns4:id>eth1.5</ns4:id>

<ns4:network_id>dnpuZXQ1</ns4:network_id>

<ns3:vlan_id>5</ns3:vlan_id>

<ns3:base_device_id>eth1</ns3:base_device_id>

</ns2:net_device>

</ns2:vzanetworkm>

</ns1:data>

<ns1:src>

<ns1:director>gend</ns1:director>

</ns1:src>

</ns1:packet>

Please send us your feedback on this help page