ifup fails, NetworkManager works

Hello,

My objective: connect wireless (wlan0) to internet at boot with ifup. I would also like to assign a specific ip to the adapter, but first let’s get it working without this extra, shall we?

Why not NetworkManager? I want to turn an old desktop into a server. As I lack cables for the moment, I will connect it with a wireless adapter. First, I’m trying this with my laptop, because it’s a l0t faster than my old desktop. The network involves WPA2 personal. I tried both with passphrase and with the psk returned by wpa_passphrase.

What works: NetworkManager
What doesn’t: Internet with ifup, but I can access local machines through ssh.

Is there any additional information that I must provide to ifup that I don’t have to with NetworkManager?

I searched, and kept stumbling on instructions involving /etc/network/interfaces, obviously for Debian, so that does not help us.

When I’m finished setting this up in yast, it hooks for quite some time at “Activate network services” (a minute or two). A lot more than when I switch on to NetworkManager.

I’m not a networking expert, but I will try to provide useful info.

If I issue ifdown wlan0, after yast setup, I get


#ifdown wlan0 -o debug

    wlan0     device: Intel Corporation Centrino Wireless-N 1000
executing additional global stop script if-down.d/21-cifs
executing additional global stop script if-down.d/21-dhcpcd-hook-samba
executing additional global stop script if-down.d/ndp-proxy
scripts/ifdown-wireless: line 692: kill: (8082) - No such process

Huh??

After this, the output of ifup:

#ifup wlan0 -o debug

    wlan0     device: Intel Corporation Centrino Wireless-N 1000
    wlan0     warning: WPA configured, but is untested
    wlan0     warning: with this device
    wlan0     starting wpa_supplicant
Starting DHCP4 client on wlan0. . .  
    wlan0     IP address: 192.168.1.102/24

If only it said what’s up with the “warning: with this device”…

DHCP6 disabled. I’m not bothering with it, as the ip6 tab is not even accessible under NetworkManager for that connection.

Ping: no problem to ping the router, but for targets out there, it instantly says “connect: Network is unreachable”.

ifstatus: it says that we got a connection though, but I would expect 54 Mb/s.

#ifstatus wlan0  #can't compare with NetworkManager to see where it crashes
    
    wlan0     device: Intel Corporation Centrino Wireless-N 1000
DHCP4 client (dhcpcd) is running
IP address: 192.168.1.102/24
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1492 qdisc mq state UP qlen 1000
    link/ether <<adapter's mac address>> brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.102/24 brd 192.168.1.255 scope global wlan0
    inet6 fe80::226:c7ff:fe8c:1656/64 scope link 
       valid_lft forever preferred_lft forever
Configured IPv4 routes for interface wlan0:
  169.254.0.0/16 - - wlan0  
Active IPv4 routes for interface wlan0:
  169.254.0.0/16  scope link
1 of 1 configured IPv4 routes for interface wlan0 up

    wlan0     is up
wlan0     IEEE 802.11bgn  ESSID:<< my network>>  
          Mode:Managed  Frequency:2.427 GHz  Access Point: <<router's mac address>>   
          Bit Rate=5.5 Mb/s   Tx-Power=14 dBm   
          Retry  long limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off
          Link Quality=48/70  Signal level=-62 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:40   Missed beacon:0

About the adapter:

# from /sbin/lspci -v

02:00.0 Network controller: Intel Corporation Centrino Wireless-N 1000
        Subsystem: Intel Corporation Centrino Wireless-N 1000 BGN
        Flags: bus master, fast devsel, latency 0, IRQ 44
        Memory at b2400000 (64-bit, non-prefetchable) [size=8]
        Capabilities: [c8] Power Management version 3
        Capabilities: [d0] MSI: Enable+ Count=1/1 Maskable- 64bit+
        Capabilities: [e0] Express Endpoint, MSI 00
        Capabilities: [100] Advanced Error Reporting
        Capabilities: [140] Device Serial Number <<mac address>>
        Kernel driver in use: iwlwifi

Reboot? Same results.
Why reboot? For lack of a better idea.

Setup:
HP Pavilion dv5 | opensuse 12.2 x86_64 | KDE4[/size]

On 03/04/2013 01:26 PM, p barill wrote:
>
> Hello,
>
> My objective: connect wireless (wlan0) to internet at boot with ifup. I
> would also like to assign a specific ip to the adapter, but first let’s
> get it working without this extra, shall we?
>
> Why not NetworkManager? I want to turn an old desktop into a server. As
> I lack cables for the moment, I will connect it with a wireless adapter.
> First, I’m trying this with my laptop, because it’s a l0t faster than my
> old desktop. The network involves WPA2 personal. I tried both with
> passphrase and with the psk returned by wpa_passphrase.
>
> What works: NetworkManager
> What doesn’t: Internet with ifup, but I can access local machines
> through ssh.
>
> Is there any additional information that I must provide to ifup that I
> don’t have to with NetworkManager?
>
> I searched, and kept stumbling on instructions involving
> /etc/network/interfaces, obviously for Debian, so that does not help us.
>
> When I’m finished setting this up in yast, it hooks for quite some time
> at “Activate network services” (a minute or two). A lot more than when I
> switch on to NetworkManager.
>
> I’m not a networking expert, but I will try to provide useful info.
>
> If I issue ifdown wlan0, after yast setup, I get
>
> Code:
> --------------------
>
> #ifdown wlan0 -o debug
>
> wlan0 device: Intel Corporation Centrino Wireless-N 1000
> executing additional global stop script if-down.d/21-cifs
> executing additional global stop script if-down.d/21-dhcpcd-hook-samba
> executing additional global stop script if-down.d/ndp-proxy
> scripts/ifdown-wireless: line 692: kill: (8082) - No such process
> --------------------
>
>
>
> Huh??
>
> After this, the output of ifup:
>
>
> Code:
> --------------------
> #ifup wlan0 -o debug
>
> wlan0 device: Intel Corporation Centrino Wireless-N 1000
> wlan0 warning: WPA configured, but is untested
> wlan0 warning: with this device
> wlan0 starting wpa_supplicant
> Starting DHCP4 client on wlan0. . .
> wlan0 IP address: 192.168.1.102/24
> --------------------
>
>
> If only it said what’s up with the “warning: with this device”…
>
> DHCP6 disabled. I’m not bothering with it, as the ip6 tab is not even
> accessible under NetworkManager for that connection.
>
> Ping: no problem to ping the router, but for targets out there, it
> instantly says “connect: Network is unreachable”.
>
> ifstatus: it says that we got a connection though, but I would expect
> 54 Mb/s.
>
>
> Code:
> --------------------
> #ifstatus wlan0 #can’t compare with NetworkManager to see where it crashes
>
> wlan0 device: Intel Corporation Centrino Wireless-N 1000
> DHCP4 client (dhcpcd) is running
> IP address: 192.168.1.102/24
> 3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1492 qdisc mq state UP qlen 1000
> link/ether <<adapter’s mac address>> brd ff:ff:ff:ff:ff:ff
> inet 192.168.1.102/24 brd 192.168.1.255 scope global wlan0
> inet6 fe80::226:c7ff:fe8c:1656/64 scope link
> valid_lft forever preferred_lft forever
> Configured IPv4 routes for interface wlan0:
> 169.254.0.0/16 - - wlan0
> Active IPv4 routes for interface wlan0:
> 169.254.0.0/16 scope link
> 1 of 1 configured IPv4 routes for interface wlan0 up
>
> wlan0 is up
> wlan0 IEEE 802.11bgn ESSID:<< my network>>
> Mode:Managed Frequency:2.427 GHz Access Point: <<router’s mac address>>
> Bit Rate=5.5 Mb/s Tx-Power=14 dBm
> Retry long limit:7 RTS thr:off Fragment thr:off
> Encryption key:off
> Power Management:off
> Link Quality=48/70 Signal level=-62 dBm
> Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
> Tx excessive retries:0 Invalid misc:40 Missed beacon:0
> --------------------
>
>
>
> About the adapter:
>
>
> Code:
> --------------------
> # from /sbin/lspci -v
>
> 02:00.0 Network controller: Intel Corporation Centrino Wireless-N 1000
> Subsystem: Intel Corporation Centrino Wireless-N 1000 BGN
> Flags: bus master, fast devsel, latency 0, IRQ 44
> Memory at b2400000 (64-bit, non-prefetchable) [size=8]
> Capabilities: [c8] Power Management version 3
> Capabilities: [d0] MSI: Enable+ Count=1/1 Maskable- 64bit+
> Capabilities: [e0] Express Endpoint, MSI 00
> Capabilities: [100] Advanced Error Reporting
> Capabilities: [140] Device Serial Number <<mac address>>
> Kernel driver in use: iwlwifi
> --------------------
>
>
>
>
>
> Reboot? Same results.
> Why reboot? For lack of a better idea.
>
>
> Setup:
> HP Pavilion dv5 | opensuse 12.2 x86_64 | KDE4

You either failed to set the routing, or the name server settings in
/etc/resolv.conf are wrong. When you use NM, it does all the little niggly
things right.

[/size]

Why do you not use YaST > Network devices > Network Settings. There you see all the tabs that reveal all the possibilities so you cannot realy forget to configur something. It lets you choose to use ifup or NM and when yoou choose for ifup, you can e.g. choose to use DHCP or nor. And when not you can fill in there IP address, netmask, router(s), DNS servers and for Wifi credentials.

You should not tell about your ping but show it.

Did you ping by IP address or by name?

Wat is your routing table

netstat -rn

You can do this with NetworkManager. Just set the connection to be a “System Connection” and it will then be available to all users, even without a desktop login.

If you want it to work with “ifup”, then go into Network Settings in Yast, and edit the settings for your ethernet card. Click the “general” tab. And then, for “activate device”, select “On Cable Connection”.

What is probably happening, is that your default route is set to go through the ethernet card. When you switch to “On Cable Connection”, then the default routing will go through your wireless card unless there is a live ethernet cable plugged in.

Seems more like it’s about the routing. The access point is a wireless router. So I guess that’s the “gateway” entry we are talking about. Nope, I did not set anything in there, as I never dealt with this for eth0, but it’s obviously simpler for ethernet as it just follows the tube.

I am using yast for this. The thought occurred of dealing directly with /etc/sysconfig/network/ifcfg-wlan0, and was promptly discarded.

netstat heh? I learned quite a few network commands lately. I will take note of that one.

What it gave (with the above issues):

#netstat -rn
127.0.0.0       0.0.0.0         255.0.0.0       U         0 0          0 lo
169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0 wlan0
192.168.1.0     0.0.0.0         255.255.255.0   U         0 0          0 wlan0

After entering the router’s IP address as gateway in the routing tab in yast, and specifying device wlan0:

#netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         192.168.1.1     0.0.0.0         UG        0 0          0 wlan0
127.0.0.0       0.0.0.0         255.0.0.0       U         0 0          0 lo
169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0 wlan0
192.168.1.0     0.0.0.0         255.255.255.0   U         0 0          0 wlan0

It’s alive!!! I see now that the first line of netstat -rn is the same as that returned under NetworkManager.

And from that point I could easily assign a static IP to the adapter.

Many thanks.

Actually I saw that the default route was set to go through no device at all. I’ve never used ethernet so far on that install.

This System Connection way is interesting. If I configure it, say through KDE, and then have the system in runlevel 3, will it still work? Is the configuration file for this /etc/sysconfig/network/ifcfg-wlan0 ?

I think so, since NetworkManager (the daemon, not the applet) is started outside any desktop. But configuring might be a problem. You might have to start a desktop for that.

I just booted an old laptop into recovery mode (selected at the grub2 prompt). And when it came up, the network was up using WiFi. That system is running 32bit 12.3 RC2, and is configured for network with a system connection. I logged in at the command line to do “/sbin/ifconfig -a” to check that the network was up.

No. It will be something like “/etc/NetworkManager/system-connections/SSID-name-of-network” and you probably need the GUI applet to configure it, at least initially.

On 03/05/2013 10:46 AM, nrickert wrote:
>
> p_barill;2532197 Wrote:
>> This System Connection way is interesting. If I configure it, say
>> through KDE, and then have the system in runlevel 3, will it still work?
> I think so, since NetworkManager (the daemon, not the applet) is
> started outside any desktop. But configuring might be a problem. You
> might have to start a desktop for that.

If you use ifup and configure the device to start “onboot”, then the connection
will come up at run level 3. I have one ancient laptop used for testing PCMCIA
devices that only boots to run level 3 as it has no GUI environment, and its
wireless network is up and running before ever I log in.

> I just booted an old laptop into recovery mode (selected at the grub2
> prompt). And when it came up, the network was up using WiFi. That
> system is running 32bit 12.3 RC2, and is configured for network with a
> system connection. I logged in at the command line to do
> “/sbin/ifconfig -a” to check that the network was up.
>
> p_barill;2532197 Wrote:
>> Is the configuration file for this /etc/sysconfig/network/ifcfg-wlan0 ?
>
> No. It will be something like
> “/etc/NetworkManager/system-connections/SSID-name-of-network” and you
> probably need the GUI applet to configure it, at least initially.

No GUI is needed, and /etc/sysconfig/network/ifcfg-xxxxx are the files that
control networking when using ifup. YaST writes those files when you use it to
configure devices.