This section describes how to delete a VNIC.
Before You Begin
Ensure that your role has the appropriate rights profile to perform this procedure. See Using Rights Profiles to Perform Network Configuration.
You can delete a VNIC only when it is not busy. A VNIC can be busy for multiple reasons. You need to perform the following steps to check whether the VNIC busy:
$ ipadm show-if $ ipadm show-addr
If the VNIC is plumbed and associated with IP addresses, remove the IP interface.
$ ipadm delete-ip interface
$ flowadm
If flows are configured over the VNIC, remove the flow.
$ flowadm remove-flow flowname
$ dladm show-link -Z
For more information about how to delete a VNIC that is attached to a zone, see How to Delete a VNIC Attached to a Zone.
$ dladm show-vnic
Only a system-created VNIC contains a hyphen (-), which helps you to differentiate between a system-created VNIC and a user-created VNIC. You cannot modify, rename, plumb, or delete system-created VNICs.
$ snoop $ tshark
If the VNIC is snooped by using the snoop command, terminate the process.
$ pkill snoop
If the VNIC is snooped by using the tshark command, terminate the process.
$ pkill tshark
$ dladm delete-vnic VNIC
This procedure assumes that the VNIC is attached to a zone. You must be in the global zone to perform this procedure.
global$ zoneadm -z zone halt
global$ zonecfg -z zone remove net physical=VNIC
global$ dladm delete-vnic VNIC
global$ zoneadm -z zone boot
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$ zoneadm -z zoneB boot