Sam Hooke

nmcli tips

nmcli is used to control NetworkManager from the command line. This can be very useful to troubleshoot and configure headless machines.

VM has no IP address §

Situation: A VM has a network adapter, but no IP address is shown when running ip a.

To investigate, run nmcli d (short for nmcli device), which lists all devices:

$ nmcli device
DEVICE                   TYPE      STATE         CONNECTION        
eno16777984              ethernet  disconnected  --               
lo                       loopback  unmanaged     -- 

The device in question, eno16777984, is listed as “disconnected”.

Run nmcli con up eno16777984 to bring the connection up.

Then run nmcli d again to check the device status:

$ nmcli device
DEVICE                   TYPE      STATE         CONNECTION        
eno16777984              ethernet  connected     eno16777984               
lo                       loopback  unmanaged     -- 

The device is now connected. Running ip a shows that an IP address has now been assigned!

  • Tagged

These are rough notes from whatever I was working on, interested in or thinking about at the time. They vary greatly in quality and length, but prove useful to me, and hopefully to you too!

← Previous: Workaround for installing Dropbox on Debian with libpango transitional package
Next: Docker build invalid reference format →