Thursday, January 19, 2012

Using NetworkManager from the command line

As much as Network Manager can be annoying at times, it's often quite useful, especially if your network configuration is not fixed.

But what if you can't boot into X for whatever reason, or if for some reason you can't start nm-applet or equivalent? If you leave network setup to NetworkManager, you have no network now. This also means no way to google for help. :-)
You can find many guides telling you to just configure the network yourself. If it's a wired network this is quite easy (with DHCP just dhclient eth0 would often just do the right thing). But for wireless networks this gets more complicated. So you might be advised to use iwconfig (for open or WEP networks), or wpa_supplicant (for all).

But if you already have the network configured in NetworkManager (and the NetworkManager service is running, or you manage to start it), I suggest you just use that. There's a command line utility to interact with the NetworkManager, called nmcli.

Here are the basic usecases you might need:

nmcli con list
lists all the configured networks NetworkManager knows about; notice the columns NAME and UUID.

To bring up a connection use either:
nmcli con up id NAME
yes, I also find it a bit confusing - but you really are supposed to put a value from the name column after the id :-), e.g. nmcli con up id MyNetwork
nmcli con up uuid UUID
you normally don't need to use this

To bring a connection down use down instead of up.

For more details see man nmcli, and nmcli --help.

Tuesday, January 17, 2012

Linux 3.2.1 on ALIX 2d3

It's that time of the year again... Here is a linux 3.2.1 config file for ALIX 2. It's a basic config. It includes upport for the integrated Ethernet, USB, GPIO and watchdog. Also included is WiFi stack + an Atheros card, but you probably want to change this to suit your needs. Compared to the 3.0 version, this has working LEDs thanks to the new platform driver by Ed Wildgoose. The button should be accessible via raw gpio, but not via the evdev interface. Hopefully the platform driver will be extended to cover this, but this requires an GPIO evdev driver first.