Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Installation/Configuration

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 8th February 2010, 18:21
JBD JBD is offline
Junior Member
 
Join Date: Feb 2010
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Question /etc/network/interfaces: transition from jaunty to karmic

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 !
Reply With Quote
Sponsored Links
  #2  
Old 9th February 2010, 15:17
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,752 Times in 2,582 Posts
Default

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.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 9th February 2010, 23:57
JBD JBD is offline
Junior Member
 
Join Date: Feb 2010
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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
Reply With Quote
  #4  
Old 15th April 2010, 14:49
alidrus alidrus is offline
Junior Member
 
Join Date: Apr 2010
Posts: 3
Thanks: 0
Thanked 1 Time in 1 Post
Default 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
Reply With Quote
  #5  
Old 15th April 2010, 15:26
alidrus alidrus is offline
Junior Member
 
Join Date: Apr 2010
Posts: 3
Thanks: 0
Thanked 1 Time in 1 Post
Default 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.
Reply With Quote
  #6  
Old 15th April 2010, 17:48
alidrus alidrus is offline
Junior Member
 
Join Date: Apr 2010
Posts: 3
Thanks: 0
Thanked 1 Time in 1 Post
Default 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.
Reply With Quote
The Following User Says Thank You to alidrus For This Useful Post:
falko (16th April 2010)
  #7  
Old 24th April 2010, 14:48
JBD JBD is offline
Junior Member
 
Join Date: Feb 2010
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
 
Default

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 ?
Reply With Quote
Reply

Bookmarks

Tags
/etc/network/interfaces, ubuntu 9.10, wireless network

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How To Upgrade Ubuntu 9.04 (Jaunty Jackalope) To 9.10 (Karmic Koala) melwood HOWTO-Related Questions 6 6th November 2009 21:30


All times are GMT +2. The time now is 22:03.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.