Skip Navigation Links | |
Exit Print View | |
Using Virtual Networks in Oracle Solaris 11.1 Oracle Solaris 11.1 Information Library |
1. Network Virtualization and Resource Management in Oracle Solaris
2. Creating and Administering Virtual Networks in Oracle Solaris
Configuring the Components of Network Virtualization
How to Configure VNICs and Etherstubs
How to Configure VNICs With VLAN IDs
How to Configure a Zone for the Virtual Network
How to Reconfigure a Zone to Use a VNIC
How to Create a Private Virtual Network
3. Managing Network Resources in Oracle Solaris
4. Monitoring Network Traffic and Resource Usage in Oracle Solaris
This section describes tasks you can perform on VNICs after performing basic configuration. This section covers the following topics:
Note - VNICs can be configured as VLANs. A parallel subcommand, dladm modify-vlan, enables you to modify direct VLANs that have been created with the dladm create-vlan command.. You must use the correct subcommand depending on whether you are modifying VLANs or VNICs configured as VLANs. Use the modify-vlan subcommand on VLANs displayed by the dladm show-vlan subcommand. Use the modify-vnic subcommand on VNICs, including those with VLAN IDs,, displayed by the dladm show-vnic subcommand. To modify direct VLANs, see Modifying VLANs in Managing Oracle Solaris 11.1 Network Performance.
Two types of VNIC modification are available:
Global modification changes an attribute of all the VNICs on a specific datalink at once. You use the -L option to identify the underlying datalink whose VNICs you want to modify.
Selective modification modifies an attribute of selected VNICs. Instead of using the -L option to identify the underlying datalink, you specify the VNICs whose attribute you want to change.
You can modify the following attributes: the VLAN ID, the MAC address, and the underlying link. Modifying the underlying link means moving a VNIC to another datalink. The following sections discuss these modifications in detail.
To change a VNIC's VLAN ID, use one of the following commands:
dladm modify-vnic -v vid -L datalink
In this command, vid specifies the new VLAN ID that you assign to the VNIC. datalink refers to the underlying link over which the VNIC is configured. You can use this command syntax if only a single VNIC exists on the datalink. The command fails on a datalink that has multiple configured VNICs because these VNICs must have unique VLAN IDs.
dladm modify-vnic -v vid vnic
Use this command to change the unique VLAN IDs of multiple VNICs over a single datalink. Because each VLAN ID is unique for VNICs on the same datalink, you must change the VLAN IDs one at a time. Suppose that you want to change the VLAN IDs of vnica0, vnicb0, and vnicc0, which are configured over net0. You would proceed as follows:
# dladm modify-vnic -v 123 vnica0 # dladm modify-vnic -v 456 vnicb0 # dladm modify-vnic -v 789 vnicc0
dladm modify-vnic -v vid vnic,vnic,[...]
Use this command to change the VLAN ID of VNICs as a group, provided that each VNIC is on a different datalink. Suppose that you want to change the VLAN IDs of vnic0, vnic1, and vnic2. These VNICs are configured over net0, net1, and net2, respectively. You would use the following command:
# dladm modify-vnic -v 123 vnic0,vnic1,vnic2
VNICs have unique MAC addresses. To modify these addresses, use one of the following commands as appropriate to your specific circumstances:
dladm modif-vnic -m mac-address vnic
Use this command to assign a specific MAC address to a specific VNIC.
dladm modif-vnic -m random -L datalink
This command performs a global modification, in which you change the MAC address of all the VNICs on the datalink. The system automatically assigns unique MAC addresses to the VNICs. In this command, the -m random option is equivalent to the -m auto option.
dladm modif-vnic -m random vnic,vnic,[...]
This command performs a selective VNIC modification. Note that for both global and selective modifications, you specify random for the -m option.
You can modify a VNIC's VLAN ID and MAC address with a single command. However, be careful about using commands to modify multiple VNIC attributes globally, which might cause unexpected behavior. Changing multiple attributes one VNIC at a time is preferable to changing multiple attributes of a group of VNICs all at the same time.
The following example shows the output before and after you modify a VNIC's VLAN ID and MAC address:
# dladm show-vnic vnic0 LINK OVER SPEED MACADDRESS MACADDRTYPE VID vnic0 net0 1000 2:8:20:ec:c4:1d random 0 # dladm modify-vnic -m random -v 123 vnic0 # dladm show-vnic vnic0 LINK OVER SPEED MACADDRESS MACADDRTYPE VID vnic0 net0 1000 2:8:20:0:1:2 random 123
You can move one or more VNICs from one underlying datalink to another underlying datalink without deleting and reconfiguring the VNICs. The underlying link can be a physical link, a link aggregation, or an etherstub.
To successfully migrate VNICs, the underlying datalink to which the VNICs are moved must be able to accommodate the datalink properties of the VNICs. If those properties are not supported, then migration fails and the user is notified. After a successful migration, all the applications that use the VNICs continue to operate normally, provided that the VNICs remain connected to the network.
Certain hardware-dependent properties might change after a VNIC migration, such as the datalink state, link speed, MTU size, and so on. The values of these properties are inherited from the datalink to which the VNICs are migrated.
You can also migrate VNICs globally or selectively. Global migration means that you migrate all the VNICs over a datalink to another datalink. To perform a global migration, you only need to specify the source datalink and the target datalink. The following example moves all the VNICs from ether0 to net1:
# dladm modify-vnic -l net1 -L ether0
where
-l datalink refers to the destination datalink to which the VNICs are migrated.
-L datalink refers to the original datalink over which the VNICs are configured.
Note - You must specify the destination datalink before the source datalink.
To perform selective VNIC migration, you specify the VNICs that you want to move. The following example moves selected VNICs from net0 to net1:
# dladm modify-vnic -l net1 vnic0,vnic1,vnic2
Note - The -L option is restricted to global modification only.
While migrating a group of VNICs, you can also modify their VLAN IDs at the same time. However, to assign new VLAN IDs, you must migrate the VNICs one at a time, as shown in the following example:
# dladm modify-vnic -l net1 -v 123 vnic0 # dladm modify-vnic -l net1 -v 456 vnic1 # dladm modify-vnic -l net1 -v 789 vnic2
The effects of migration on the MAC address depend on whether the VNIC is using a factory MAC address from the source datalink.
If you do not specify the -m option during migration, then after migration, the factory MAC address is replaced by an address randomly assigned from the target datalink.
If you use the -m address option during migration, then that address is assigned to the VNIC after migration.
Randomly assigned MAC addresses are unaffected and are retained by their respective VNICs after migration.
The following example shows how to migrate multiple VNICs. Note that the VNICs are using randomly assigned MAC addresses. Thus, these addresses are unchanged after migration.
# dladm show-vnic LINK OVER SPEED MACADDRESS MACADDRTYPE VID vnic1 net0 1000 2:8:20:c2:39:38 random 0 vnic2 net0 1000 2:8:20:5f:84:ff random 0 # dladm modify-vnic -l net1 -L net0 # dladm show-vnic vnic0 LINK OVER SPEED MACADDRESS MACADDRTYPE VID vnic1 net1 1000 2:8:20:c2:39:38 random 0 vnic2 net1 1000 2:8:20:5f:84:ff random 0
To obtain information about the VNICs on your system, use the dladm show-vnic command.
# dladm show-vnic LINK OVER SPEED MACADDRESS MACADDRTYPE vnic1 net0 1000 Mbps 2:8:20:c2:39:38 random vnic2 net0 1000 Mbps 2:8:20:5f:84:ff random
VNICs are also datalinks. Thus, you can also use any dladm command that shows information about datalinks to include information about VNICs if these exist on the system. For example, dladm show-link includes VNICs on the list. Or, you can use the dladm show-linkprop command to check the properties of VNICs. To obtain property information about a single VNIC, specify the VNIC when you display link properties:
# dladm show-linkprop [-p property] vnic
This procedure explains how to delete a VNIC configuration from the system. The steps assume that the VNIC is attached to a zone. You must be in the global zone to perform this procedure.
global# zoneadm -z zone halt
Note - To determine the links used by a zone, use the dladm show-link command.
global# zonecfg -z zone remove net physical=vnic
global# dladm delete-vnic vnic
global# zonecfg -z zone boot
Example 2-5 Deleting a VNIC From the System
In this example, vnic1 is removed from zoneB and from the system.
Global# dladm show-link LINK CLASS MTU STATE OVER net0 phys 1500 up -- net2 phys 1500 up -- net1 phys 1500 up -- net3 phys 1500 up -- zoneA/net0 vnic 1500 up net0 zoneB/net0 vnic 1500 up net0 vnic0 vnic 1500 up net1 zoneA/vnic0 vnic 1500 up net1 vnic1 vnic 1500 up net1 zoneB/vnic1 vnic 1500 up net1 Global# zoneadm -z zoneB halt Global# zonecfg -z zoneB remove net physical=vnic1 Global# dladm delete-vnic vnic1 Global# zonecfg -z zoneB reboot