/etc/network/interfaces: transition from jaunty to karmic

Discussion in 'Installation/Configuration' started by JBD, Feb 8, 2010.

  1. JBD

    JBD New Member

    Hi,

    I installed ubuntu jaunty on an external USB drive (since I know more or less how to configure jaunty). I also installed karmic (kernel linux 2.6.31-17-generic) to test this karmic distribution. I have the following problem for configuring the network.
    On jaunty, my /etc/network/interfaces file was:

    Code:
    auto lo wlan0
    iface lo inet loopback
    
    iface wlan0 inet dhcp
            wireless-key ABCD-EFGH-IJ
            wireless-essid ABCDEF
            netmask 255.255.255.0
            channel 6
            mode Managed
            metric 10
            needhostname yes
    
    and the network worked, before I even connected via gdm or console.


    Keeping the same file does not work with karmic. At startup, I don't have wireless network. I can connect using the wireless tools in KDE and gnome, but I am not fully satisfied with this, because when I am connecting remotely, if the computer reboots I will not be able to be connected again. So I am trying to understand the new syntax in /etc/network/interfaces.
    My interface is still wlan0, since
    Code:
    sudo iwlist scan
    
    gives
    Code:
    
     lo        Interface doesn't support scanning.
    
    eth0      Interface doesn't support scanning.
    
    wmaster0  Interface doesn't support scanning.
    
    wlan0     Scan completed :
              Cell 01 - Address: aa:bb:cc:dd:ee:ff
                        Channel:6
                        Frequency:2.437 GHz (Channel 6)
                        Quality=52/70  Signal level=-58 dBm
                        Encryption key:on
                        ESSID:"ABCDEF"
                        Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s
                        Bit Rates:6 Mb/s; 9 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s
                                  36 Mb/s; 48 Mb/s; 54 Mb/s
                        Mode:Master
                        Extra:tsf=00000004c49b000e
                        Extra: Last beacon: 81308ms ago
                        IE: Unknown: 00065253464D4A42
                        IE: Unknown: 010482848B96
                        IE: Unknown: 030106
                        IE: Unknown: 0406000200000000
                        IE: Unknown: 2A0100
                        IE: Unknown: 32080C1218243048606C
    
    vboxnet0  Interface doesn't support scanning.
    
    

    I tried some variants below in /etc/network/interfaces, inspired by posts on http://forum.ubuntu-fr.org/ concerning karmic and networking, and in particular I tried to use the keywords wireless-keymode, wireless-channel, etc. instead of keymode, channel... but nothing works, so I am stuck.

    Code:
    auto lo wlan0
    iface lo inet loopback
    
    iface wlan0 inet dhcp
    wireless-mode Managed
    wireless-essid ABCDEF
    wireless-keymode restricted
    wireless-key ABCD-EFGH-IJ
    wireless-channel 6
    metric 10
    needhostname yes
    netmask 255.255.255.0
    
    Code:
    ifconfig
    gives
    Code:
    eth0      Link encap:Ethernet  HWaddr 00:0c:76:f1:f2:44  
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              Packets reçus:0 erreurs:0 :0 overruns:0 frame:0
              TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 lg file transmission:1000 
              Octets reçus:0 (0.0 B) Octets transmis:0 (0.0 B)
              Interruption:19 Adresse de base:0xe800 
    
    lo        Link encap:Boucle locale  
              inet adr:127.0.0.1  Masque:255.0.0.0
              adr inet6: ::1/128 Scope:Hôte
              UP LOOPBACK RUNNING  MTU:16436  Metric:1
              Packets reçus:8 erreurs:0 :0 overruns:0 frame:0
              TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 lg file transmission:0 
              Octets reçus:480 (480.0 B) Octets transmis:480 (480.0 B)
    
    wlan0     Link encap:Ethernet  HWaddr 00:18:f8:a9:f7:84  
              adr inet6: fe80::218:f8ff:fea9:f784/64 Scope:Lien
              UP BROADCAST MULTICAST  MTU:1492  Metric:1
              Packets reçus:7 erreurs:0 :0 overruns:0 frame:0
              TX packets:7 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 lg file transmission:1000 
              Octets reçus:1100 (1.1 KB) Octets transmis:944 (944.0 B)
    
    wlan0:avahi Link encap:Ethernet  HWaddr 00:18:f8:a9:f7:84  
              inet adr:169.254.11.116  Bcast:169.254.255.255  Masque:255.255.0.0
              UP BROADCAST MULTICAST  MTU:1492  Metric:1
    
    wmaster0  Link encap:UNSPEC  HWaddr 00-18-F8-A9-F7-84-00-00-00-00-00-00-00-00-00-00  
              UP RUNNING  MTU:0  Metric:1
              Packets reçus:0 erreurs:0 :0 overruns:0 frame:0
              TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 lg file transmission:1000 
              Octets reçus:0 (0.0 B) Octets transmis:0 (0.0 B)
    
    I also tried different network wifi cards, different wifi access points (netgear and linksys), and I cant make any of this work with /etc/netwkor/interfaces (unless I disable WEP).
    Any idea please ? Thank you !
     
  2. falko

    falko Super Moderator

    I think you forgot some whitespace in /etc/network/interfaces.
    Code:
    auto lo wlan0
    iface lo inet loopback
    
    iface wlan0 inet dhcp
    wireless-mode Managed
    wireless-essid ABCDEF
    wireless-keymode restricted
    wireless-key ABCD-EFGH-IJ
    wireless-channel 6
    metric 10
    needhostname yes
    netmask 255.255.255.0
    should be
    Code:
    auto lo wlan0
    iface lo inet loopback
    
    iface wlan0 inet dhcp
      wireless-mode Managed  
      wireless-essid ABCDEF
      wireless-keymode restricted
      wireless-key ABCD-EFGH-IJ
      wireless-channel 6
      metric 10
      needhostname yes
      netmask 255.255.255.0
    instead.
     
  3. JBD

    JBD New Member

    Thanks for the tip, Falko. I tried to insert whitespaces as you suggested. Unfortunately, the network does not work better (I restarted it using service networking --full-restart and also using ifdown -a ; ifup wlan0 to be sure). Now
    Code:
    ifdown -a
    gives
    Code:
    Error for wireless request "Set Mode" (8B06) :
        SET failed on device wlan0 ; Invalid argument.
    
    and
    Code:
    iwconfig
    gives
    Code:
    wlan0     IEEE 802.11bg  Mode:Managed  Frequency:2.437 GHz  
              Access Point: Not-Associated   Tx-Power=12 dBm   
              Retry  long limit:7   RTS thr:off   Fragment thr:off
              Encryption key:off
              Power Management:on
              Link Quality:0  Signal level:0  Noise level:0
              Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
              Tx excessive retries:0  Invalid misc:0   Missed beacon:0
    
     
  4. alidrus

    alidrus New Member

    Same here

    I am having exactly the same problem. These used to work before I upgraded to 9.10. Now, the only way I can get wifi to work is if I click on the network manager applet in gnome and like you i wont be able to connect remotely to my office if my PC is somehow rebooted while I am away.

    In my case, I have already tried manually editing /etc/network/interfaces, so I thought I must have done something wrong. So I install network-admin and configured wireless via that. The configuration that was added via the gui tool was:

    iface wlan0 inet dhcp
    wireless-key **********
    wireless-essid ********

    auto wlan0

    When I tried rebooting and logging in via a text console, the interface did not come back up. dmesg showed me this:

    [ 24.863155] ADDRCONF(NETDEV_UP): wlan0: link is not ready

    I am pretty convinced there is some script that is failing to configure the interface properly before dhclient runs.

    Please let me know if you found the solution to this problem. I have been searching the internet for some information for quite some time now and it has been frustrating.

    Thanks
     
  5. alidrus

    alidrus New Member

    Problem SOLVED!

    Please ignore my previous post.

    I have managed to solve my problem. Apparently Network Manager in karmic only allows your wifi to activate upon logging in to Gnome or KDE (not sure if this is a bug or what).

    I solved the problem by installing wicd (which replaces network manager) and configuring the wifi to automatically start. When the machine rebooted, the wifi was up even before I logged into Gnome.

    Hope this helps you as well.
     
  6. alidrus

    alidrus New Member

    Another solution: Use wpa_supplicant for your WEP connection.

    If you use WEP like me, here is how to solve the problem without using or installing wicd.

    Firstly, test that it will work by first stopping the network manager service:

    Code:
    /etc/init.d/network-manager stop
    
    This is to verify that you are running independently of network-manager.

    Then edit /etc/network/interfaces like this:

    Code:
    iface wlan0 inet dhcp
    pre-up wpa_supplicant -iwlan0 -c/etc/wpa_supplicant.conf &
    post-down kill -9 `pidof wpa_supplicant`
    auto wlan0
    
    Depending on your wifi card, you may need to use the -D option for wpa_supplicant.

    Then, edit /etc/wpa_supplicant.conf (this will probably be created as a new file) and make it look like this:

    Code:
    # Static WEP keys
    
    ctrl_interface=/var/run/wpa_supplicant
    
    network={
    	ssid="YOUR_SSID"
    	key_mgmt=NONE
    	wep_key0=YOUR_WEP_KEY
    	wep_tx_keyidx=0
    }
    
    (The above code was modified from examples in /usr/share/doc/wpa_supplicant/examples)

    Then restart networking:

    Code:
    /etc/init.d/networking restart
    
    Verify that your wlan0 interface has an IP and you can ping other hosts on your LAN. If it works you may safely remove network-manager via apt-get like i did.
     
  7. JBD

    JBD New Member

    Dear alidrus,

    thank you for your suggestion. I did not try it for the moment, but I used the following syntax for /etc/network/interfaces

    Code:
    auto lo wlan0
    iface lo inet loopback
    
    iface wlan0 inet dhcp
      pre-up iwconfig wlan0 mode managed
      pre-up iwconfig wlan0 channel 6
      pre-up iwconfig wlan0 essid ABCDEF
      pre-up iwconfig wlan0 key ABCD-EFGH-IJ
      metric 10
      netmask 255.255.255.0
      needhostname yes
    
    and everything works fine on karmic 32 bits.

    Then I changed my wireless device to an ANATEL - LITEON WN7600R with RaLink RT2860 chipset (if I understand correctly), and I also switched to jaunty 64bits. Since then, neither version of /etc/network/interfaces works - I have to use the NetworkManager on kde or gnome. Besides, I am not connected to the network automatically on kde, but only on gnome. On kde I have to click on the ESSID in the list of the wireless networks.

    This suggests that the syntax in /etc/network/interfaces may depend on which particular wireless card is used.

    If I have the patience to try other solutions, including that of alidrus, I will let you know about the results...

    PS. How do I mark this issues as "solved" in the forum please ?
     

Share This Page