Sometimes I need to do some operational work in text mode and I need to setup internet connection from command line (without any networkmanager applet).
(Please note: that when I run Window Manager, I have network connection immediately, thanks to NetworkManager applet.)
When I list my connections and look for wired one:
# nmcli con | grep Wired
New Wired Connection b15ffacf-a5c58-44af-b755-b30c6d52e53e 802-3-ethernet Thu Dec 27 21:31:21 2012
I get uuid and with it it's easy:
nmcli con up uuid b15ffacf-a5c58-44af-b755-b30c6d52e53e eth0
If someone wants to automate stuff, it goes like this:
nmcli con up uuid "$( nmcli con | awk '/Wired/ {print $4}' )" eth0
It's correct and working solution, but I have a feeling that there must be more elegant way to "up" this "Wired" device.
Could you suggest more elegant way ?
grepwithawk:awk '/Wired/ {print $4}'will suffice... – jasonwryan Dec 27 '12 at 22:23nm-onlineshould connect you to the available network(s). – vonbrand Jan 22 at 1:11