Hi there is anyone familiar with the non-gui version of ubuntus network Manager?
I'd like to set up a static IP with it in virtualbox without touching the file /etc/network/interfaces
.
- IP: 192.168.56.101
- Gateway: 102.168.1.1
- Netmask: 255.255.255.0
Additionally I'd like to set up a second network interface with a dynamic IP to get connected to the internet with the Vbox.
Best Answer
You need to use Network Manger from the command line, this is nmcli.
First, you can list the available connections Network Manager knows about with the following, this is important to find the name, as the device id isn't used:
This will give you something like:
You can then modify the connection with the following:
When you enter the above use one line, I've just split it into separate lines to make it more clear.
If you want to set the connection to use DHCP, you can use the following:
You need all the empty quotes as they remove any settings they previously have.
To add a network, use:
With similar parameters.
To make the settings active, reboot. (I tried re-starting Network Manager, but that didn't seem to activate the changes, but a reboot did.)