Viewing the IP address of NICs on a virtual machine

You can view the IP address for a network interface controller (NIC) by using the web console or the oc client. The QEMU guest agent displays additional information about the virtual machine’s secondary networks.

Prerequisites

  • Install the QEMU guest agent on the virtual machine.

Viewing the IP address of a virtual machine interface in the CLI

The network interface configuration is included in the oc describe vmi <vmi_name> command.

You can also view the IP address information by running ip addr on the virtual machine, or by running oc get vmi <vmi_name> -o yaml.

Procedure

  • Use the oc describe command to display the virtual machine interface configuration:

    1. $ oc describe vmi <vmi_name>

    Example output

    1. ...
    2. Interfaces:
    3. Interface Name: eth0
    4. Ip Address: 10.244.0.37/24
    5. Ip Addresses:
    6. 10.244.0.37/24
    7. fe80::858:aff:fef4:25/64
    8. Mac: 0a:58:0a:f4:00:25
    9. Name: default
    10. Interface Name: v2
    11. Ip Address: 1.1.1.7/24
    12. Ip Addresses:
    13. 1.1.1.7/24
    14. fe80::f4d9:70ff:fe13:9089/64
    15. Mac: f6:d9:70:13:90:89
    16. Interface Name: v1
    17. Ip Address: 1.1.1.1/24
    18. Ip Addresses:
    19. 1.1.1.1/24
    20. 1.1.1.2/24
    21. 1.1.1.4/24
    22. 2001:de7:0:f101::1/64
    23. 2001:db8:0:f101::1/64
    24. fe80::1420:84ff:fe10:17aa/64
    25. Mac: 16:20:84:10:17:aa

Viewing the IP address of a virtual machine interface in the web console

The IP information displays in the Virtual Machine Overview screen for the virtual machine.

Procedure

  1. In the OKD Virtualization console, click WorkloadsVirtualization from the side menu.

  2. Click the Virtual Machines tab.

  3. Select a virtual machine name to open the Virtual Machine Overview screen.

The information for each attached NIC is displayed under IP Address.