Configuring the VM NIC Configuration File
Configure the VM NIC file to enable the network. If you adopt the SR-IOV solution, create a NIC configuration file following instructions in this section.
- Check the VM NIC name.
ip a

- Create a configuration file.
- If you adopt the SR-IOV solution in Configuring the Host Network, run the following commands to create a NIC configuration file:
nmcli connection add ifname enp1s0 con-name enp1s0 type ethernet cd /etc/sysconfig/network-scripts/ ls
As shown in the following figure, the VM NIC configuration file is created.

- If the bridge mode is adopted in Configuring the Host Network, a NIC configuration file is automatically generated on the VM. The file name is the same as the NIC name in the ip a command output. In this case, skip this step.
If possible, you are advised to use the SR-IOV solution, which provides better computing performance and shorter latency.
- If you adopt the SR-IOV solution in Configuring the Host Network, run the following commands to create a NIC configuration file:
- Log in to the VM and configure IPADDR, NETMASK, GATEWAY, and DNS for the VM. Ensure that ONBOOT is set to yes.
The VM and host share the values of NETMASK, GATEWAY, and DNS. IPADDR can be customized. Confirm with the network administrator to ensure that the IP address does not conflict with other IP addresses on the LAN.
vi ifcfg-enp1s0

If the configuration file contains the content in the red box in the following figure, delete the content.

- Reload network connections. You are advised to run the commands in the shell of virt-manager. If you perform remote operations through SSH, connections will be interrupted due to network configuration modification.
virt-manager

nmcli connection reload nmcli connection down enp1s0 nmcli connection up enp1s0

- Ping the gateway and check whether the configuration takes effect over SSH remote connection. The gateway IP address can be queried in the configuration file of bridge br0.
ping 192.168.20.1

On any server in the same network segment, connect to the VM using ssh.
ssh IP address

In this example, data communication with the VM inside the LAN of the server has been achieved. If you want to access the VM inside the LAN from an external VM, contact the network administrator to configure the external VM following server configurations inside the LAN.