Este conteúdo não está disponível no idioma selecionado.

4.10. nic


The 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.
Expand
Table 4.24. Host network interface parameters
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
Expand
Table 4.25. Virtual Machine network interface parameters
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
The --bonding-slaves-host_nic parameter is a collection that uses the sub-parameters in the following table.
Expand
Table 4.26. --bonding-slaves-host_nic
Name Type Description
host_nic.id|name
string
A reference to another host NIC to bond.
The --bonding-options-option parameter is a collection that uses the sub-parameters in the following table.
Expand
Table 4.27. --bonding-options-option
Name Type Description
option.name
string
The bonding option name.
option.value
string
The bonding option value.
type
string
The bonding option type.
The --port_mirroring-networks-network parameter is a collection that uses the sub-parameters in the following table.
Expand
Table 4.28. --port_mirroring-networks-network
Name Type Description
network.id
string
A reference to the network to mirror.
The following table lists additional NIC options for resource-based commands.
Expand
Table 4.29. Additional command options
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
Copy to Clipboard Toggle word wrap

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
Copy to Clipboard Toggle word wrap

Example 4.27. Deleting a network interface on a virtual machine

[RHEVM shell (connected)]# remove nic eth0 --vm-identifier MyVM1
Copy to Clipboard Toggle word wrap

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
Copy to Clipboard Toggle word wrap

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
Copy to Clipboard Toggle word wrap
The following table lists actions for a host NIC resource.
Expand
Table 4.30. Host NIC actions
Action Description
attach Attach a NIC to a host.
detach Detach a NIC from a host.
The following table lists actions for a virtual machine NIC resource.
Expand
Table 4.31. Virtual machine NIC actions
Action Description
activate Activate a NIC on a virtual machine.
deactivate Deactivate a NIC on a virtual machine.
Voltar ao topo
Red Hat logoGithubredditYoutubeTwitter

Aprender

Experimente, compre e venda

Comunidades

Sobre a documentação da Red Hat

Ajudamos os usuários da Red Hat a inovar e atingir seus objetivos com nossos produtos e serviços com conteúdo em que podem confiar. Explore nossas atualizações recentes.

Tornando o open source mais inclusivo

A Red Hat está comprometida em substituir a linguagem problemática em nosso código, documentação e propriedades da web. Para mais detalhes veja o Blog da Red Hat.

Sobre a Red Hat

Fornecemos soluções robustas que facilitam o trabalho das empresas em plataformas e ambientes, desde o data center principal até a borda da rede.

Theme

© 2025 Red Hat