Verify the IP address and default gateway on a VM

Verify the IP address and default gateway on a VMΒΆ

This section describes how to verify and troubleshoot issues with the IP address and the default gateway of a VM.

To verify the IP address and default gateway on a VM:

  1. Log in to the VM in question.

  2. Run the following command:

    ip a
    

    Example of system response:

    1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
        link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
        inet 127.0.0.1/8 scope host lo
           valid_lft forever preferred_lft forever
        inet6 ::1/128 scope host
           valid_lft forever preferred_lft forever
    3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
        link/ether ac:de:48:92:9d:69 brd ff:ff:ff:ff:ff:ff
        inet 10.167.4.21/24 brd 10.167.4.255 scope global eth1
           valid_lft forever preferred_lft forever
        inet6 fe80::aede:48ff:fe92:9d69/64 scope link
           valid_lft forever preferred_lft forever
    
    • If Ethernet does not have an IP address, run the following command:

      dhclient eth1
      
    • If Ethernet has an IP address with the /32 mask:

      1. Restart the VM.
      2. Verify ifmap-server.
    • If the interface is down, run the following command:

      ifcongfig eth1 up
      
  3. Display the default gateway:

    route -n
    

    Example of system response:

    Kernel IP routing table
    Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
    0.0.0.0         10.167.4.1      0.0.0.0         UG    0      0        0 eth1
    10.167.4.0      0.0.0.0         255.255.255.0   U     0      0        0 eth1
    
  4. Ping the default gateway.