How to use NetworkManager in console?

Messed up installing the proprietary ATI graphics driver on openSUSE 11.1 (GNOME), and reboot drops me to console login. X won’t start, so I’d like to reinstall some packages from the console. However, the network connection is disconnected. It was set to use NetworkManager (which is running), and I don’t know how to manipulate NetworkManager on the cli. After checking that the interface was up (ifconfig), and no DHCP clients were running, I tried this as root:

iwconfig wlan0 essid "my-essid" key my-key open
iwconfig wlan0 enc on
iwconfig wlan0 essid "my-essid" key "my-key" open
iwconfig
dhcpcd wlan0

dhcpcd times out. Wifi card and connection were working flawlessly before, so the hardware is compatible. Only after the botched driver compile/install + reboot did the connection problem occur.

I tried to use yast2 to configure network (and X, but this fails and fails), but got a warning that it wouldn’t work because of NetworkManager, and to disable NetworkManager if I’d like to configure through yast. What would be the cons of disabling NetworkManager? I like the unified configuration tool of yast, so wonder why, after much effort was apparently put into that tool, another tool is preferred for this task.

Perhaps I’m missing something? I am new to SUSE, or any rpm-based distro. Going slowly to avoid distro-shock. :slight_smile:

Hi. Try to replace the proprietary fglrx driver with the opensource drivers, maybe that works:

 sax2 -r -m 0=radeonhd 

Then you should be able to login into X.
As far as I know there are no commandline options for NetworkManager. To connect to your wlan try “dhclient wlan0” instead of “dhcpd wlan0”, because the dhcp server should be running on your wireless router.

What would be the cons of disabling NetworkManager?
You would have to use the cli everytime you want to connect to a new network or vpn. Therefore, I prefer NetworkManager. Of course, you can disable NetworkManager now and reenable it later.

Thanks, I’ll try this. It would be nice to be able to reclaim the nicely working, original GUI.

As far as I know there are no commandline options for NetworkManager. To connect to your wlan try “dhclient wlan0” instead of “dhcpd wlan0”, because the dhcp server should be running on your wireless router.

Ah, I was confused by having both of them–didn’t realize there was a distinction.

you can disable NetworkManager now and reenable it later.

How can NetworkManager be disabled and reenabled? The yast -> network… didn’t provide any hints, just the warning about them being mutually exclusive. No help in man -k networkmanager, either.

yast → network devices → network settings → global options

Thanks!

Neither dhclient nor dhcpcd got an IP, so I just disabled NetworkManager as suggested. Once that was done, yast configuration of the wireless connection got me online in console. This became moot, however, once a working GUI was achieved by running sax2-vesa. I found this command after failing with suggested sax2 -r -m 0=radeonhd. Useful fallback.

Anyway, thanks again for all the help!

Hello, there is a console program in the repo for manipulating NetworkManager: cnetworkmanager. Here’s some more info:

user@compy:~> zypper if cnetworkmanager
Loading repository data...
Reading installed packages...


Information for package cnetworkmanager:

Repository: @System
Name: cnetworkmanager
Version: 0.8-2.5
Arch: noarch
Vendor: openSUSE
Installed: Yes
Status: up-to-date
Installed Size: 65.0 K
Summary: Command-line client for NetworkManager
Description: 
Cnetworkmanager is a command-line client for NetworkManager, intended
to supplement and replace the GUI applets

user2compy:~> cnetworkmanager --help
cnetworkmanager 0.8 - Command Line Interface for NetworkManager
Usage: cnetworkmanager [options]

Options:
  --version             show program's version number and exit
  -h, --help            show this help message and exit
  -d, --dev             list devices
  -c, --actcon          list active connections
  -u, --usrcon          list user connection settings (can CRASH nm-applet)
  -s, --syscon          list system connection settings
  -a, --ap              list found access points
  -n, --nets            list found wireless networks
  -w BOOL, --wifi=BOOL  enable or disable wireless
  -o BOOL, --online=BOOL
                        enable or disable network at all
  -C NET, --connect=NET
                        connect to a wireless network NET (using
                        knetworkmanagerrc or the key options below)
  --unprotected         network does not require a key
  --wep-hex=KEY         use this WEP key of 26 hex digits
  --wep-pass=KEY        use this WEP passphrase
  --wpa-psk-hex=KEY     use this WPA key of 64 hex digits
  -m, --monitor         loop to show dbus signals