Este contenido no está disponible en el idioma seleccionado.
4.10. nic
nic resource type groups network interface resources in a Red Hat Virtualization environment. These resources acts as sub-resources for both host and vm resources but are defined differently for each. This section contains two tables with parameters for each.
	| Name | Type | Description | Required | User Creatable | User Updatable | 
|---|---|---|---|---|---|
 --network-id|name
					 |   
						 string
					 
					  |   
						A reference to the network, if any, that the interface is attached.
					 
					  |   
						Yes
					 
					  |   
						Yes
					 
					  |   
						Yes
					 
					  | 
 --name
					 |   
						 string
					 
					  |   
						The name of the host network interface, e.g.  
					 eth0.
					 |   
						Yes
					 
					  |   
						Yes
					 
					  |   
						Yes
					 
					  | 
 --bonding-slaves-host_nic
					 |   
						 collection
					 
					  |   
						A collection of slave network interfaces that form a bonded interface.
					 
					  |   
						No
					 
					  |   
						Yes
					 
					  |   
						Yes
					 
					  | 
 --bonding-options-option
					 |   
						 collection
					 
					  |   
						A list of options for a bonded interface. Each option contains property  
					 name and value attributes.
					 |   
						No
					 
					  |   
						Yes
					 
					  |   
						Yes
					 
					  | 
 --ip-gateway
					 |   
						 string
					 
					  |   
						The IP address for the network's gateway.
					 
					  |   
						No
					 
					  |   
						Yes
					 
					  |   
						Yes
					 
					  | 
 --boot_protocol
					 |   
						 string
					 
					  |   
						The protocol for IP address assignment when the host is booting, such as  
					 dhcp or static.
					 |   
						No
					 
					  |   
						Yes
					 
					  |   
						Yes
					 
					  | 
 --mac
					 |   
						 string
					 
					  |   
						The MAC address of the interface.
					 
					  |   
						No
					 
					  |   
						Yes
					 
					  |   
						Yes
					 
					  | 
 --ip-address
					 |   
						 string
					 
					  |   
						The IP address of the interface.
					 
					  |   
						No
					 
					  |   
						Yes
					 
					  |   
						Yes
					 
					  | 
 --ip-netmask
					 |   
						 string
					 
					  |   
						The netmask for the interface's IP address.
					 
					  |   
						No
					 
					  |   
						Yes
					 
					  |   
						Yes
					 
					  | 
 --ip-mtu
					 |   
						int
					 
					  |   
						The maximum transmission unit for the interface.
					 
					  |   
						No
					 
					  |   
						No
					 
					  |   
						Yes
					 
					  | 
| Name | Type | Description | Required | User Creatable | User Updatable | 
|---|---|---|---|---|---|
 --network-id|name
					 |   
						 string
					 
					  |   
						A reference to the network, if any, that the interface is attached.
					 
					  |   
						Yes
					 
					  |   
						Yes
					 
					  |   
						Yes
					 
					  | 
 --name
					 |   
						 string
					 
					  |   
						The name of the interface, e.g.  
					 eth0.
					 |   
						Yes
					 
					  |   
						Yes
					 
					  |   
						Yes
					 
					  | 
 --mac-address
					 |   
						 string
					 
					  |   
						The MAC address of the interface.
					 
					  |   
						No
					 
					  |   
						Yes
					 
					  |   
						Yes
					 
					  | 
 --interface
					 |   
						 string
					 
					  |   
						Defines the interface type, such as  
					 e1000, virtio, rtl8139 and  rtl8139_virtio.
					 |   
						No
					 
					  |   
						Yes
					 
					  |   
						Yes
					 
					  | 
 --port_mirroring-networks-network
					 |   
						 collection
					 
					  |   
						Defines a set of networks to copy (mirror) network data from the network interface.
					 
					  |   
						No
					 
					  |   
						Yes
					 
					  |   
						Yes
					 
					  | 
--bonding-slaves-host_nic parameter is a collection that uses the sub-parameters in the following table.
	| Name | Type | Description | 
|---|---|---|
 host_nic.id|name
					 |   
						string
					 
					  |   
						A reference to another host NIC to bond.
					 
					  | 
--bonding-options-option parameter is a collection that uses the sub-parameters in the following table.
	| Name | Type | Description | 
|---|---|---|
 option.name
					 |   
						string
					 
					  |   
						The bonding option name.
					 
					  | 
 option.value
					 |   
						string
					 
					  |   
						The bonding option value.
					 
					  | 
 type
					 |   
						string
					 
					  |   
						The bonding option type.
					 
					  | 
--port_mirroring-networks-network parameter is a collection that uses the sub-parameters in the following table.
	| Name | Type | Description | 
|---|---|---|
 network.id
					 |   
						string
					 
					  |   
						A reference to the network to mirror.
					 
					  | 
| Option | Description | 
|---|---|
 --host-identifier  |  Adds the NIC to a host as a sub-resource.  | 
 --vm-identifier  |  Adds the NIC to a vm as a sub-resource.  | 
Example 4.25. Creating a new network interface on a virtual machine
[RHEVM shell (connected)]# add nic --vm-identifier MyVM1 --name eth0 --network-name MyNetwork
[RHEVM shell (connected)]# add nic --vm-identifier MyVM1 --name eth0 --network-name MyNetwork
Example 4.26. Updating a network interface on a virtual machine
[RHEVM shell (connected)]# update nic eth0 --vm-identifier MyVM1 --ip-address 10.5.68.123
[RHEVM shell (connected)]# update nic eth0 --vm-identifier MyVM1 --ip-address 10.5.68.123
Example 4.27. Deleting a network interface on a virtual machine
[RHEVM shell (connected)]# remove nic eth0 --vm-identifier MyVM1
[RHEVM shell (connected)]# remove nic eth0 --vm-identifier MyVM1
Example 4.28. Configuring network bonding on a host
[RHEVM shell (connected)]# add nic --host-identifier MyHost1 --name bond1 --network-name MyNetwork --bonding-slaves-host_nic host_nic.name=eth0 --bonding-slaves-host_nic host_nic.name=eth1
[RHEVM shell (connected)]# add nic --host-identifier MyHost1 --name bond1 --network-name MyNetwork --bonding-slaves-host_nic host_nic.name=eth0 --bonding-slaves-host_nic host_nic.name=eth1
Example 4.29. Assigning a logical network to a host network interface
[RHEVM shell (connected)]# action nic eth0 attach --host-identifier MyHost1 --network-name MyNetwork
[RHEVM shell (connected)]# action nic eth0 attach --host-identifier MyHost1 --network-name MyNetwork
| Action | Description | 
|---|---|
 attach  | Attach a NIC to a host. | 
 detach  | Detach a NIC from a host. | 
| Action | Description | 
|---|---|
 activate  | Activate a NIC on a virtual machine. | 
 deactivate  | Deactivate a NIC on a virtual machine. |