HOW TO? Script to connect dev "eth1" to WiFi after booting?

Questions about WIFI networks and devices
Forum rules
Before you post please read this

HOW TO? Script to connect dev "eth1" to WiFi after booting?

Postby Webtest on Sun Sep 22, 2013 2:00 pm

Esteemed Forum Participants and Lurkers:
========================================
Mint 13 Mate 32-bit LiveDVD

EDITED 9/22/13 21:04 EST - new info at bottom ...

I'm trying to get a script working on my IBM Thinkpad 1861-2BU Laptop to connect to my in-home WiFi network "aardvark". I don't wan't it to always connect after booting ... just when the script is run. My network router security is an Access Control List, which only permits a very few selected devices (laptop, ipod, etc.) and is not encrypted and has no password. The laptop does connect just fine if I click on the "Network" icon in the Menu Bar and select "aardvark".

I've scoured the internet and found a few references, and all of them have referred to "wlan0" as the device name, but that isn't the case on this machine. I was able to find the following:
Code: Select all
mint ~ # cat /proc/net/wireless
Inter-| sta-|   Quality        |   Discarded packets               | Missed | WE
 face | tus | link level noise |  nwid  crypt   frag  retry   misc | beacon | 22
  eth1: 0000   68.  -57.  -88.       0      0      0    728      0       56
mint ~ # iwlist eth1 scan
eth1      Scan completed :
            . . .
          Cell 03 - Address: 00:11:22:33:44:55
                    ESSID:"aardvark"
                    Protocol:IEEE 802.11g
                    Mode:Master
                    Frequency:2.437 GHz (Channel 6)
                    Encryption key:off
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s
                              9 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s; 36 Mb/s
                              48 Mb/s; 54 Mb/s
                    Quality=68/100  Signal level=-57 dBm 
                    Extra: Last beacon: 40ms ago
So, the device name on this machine is evidently "eth1". I found the following promising script on this web site http://www.ghacks.net/2009/04/14/connect-to-a-wireless-network-via-command-line/ and I replaced each instance of "wlan0" with "eth1":
Code: Select all
ifconfig wlan0
iwconfig wlan0 essid NETWORK_ID key WIRELESS_KEY
dhclient wlan0
Here is my version ...
Code: Select all
mint@mint ~ $ sudo -i
mint ~ # ifconfig eth1
eth1      Link encap:Ethernet  HWaddr 00:16:6f:92:27:17 
          inet6 addr: fe80::216:6fff:fe92:2717/64 Scope:Link
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:14 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:3261 (3.2 KB)
          Interrupt:21 Base address:0x2000 Memory:90301000-90301fff

mint ~ # iwconfig eth1 essid aardvark    <-- also tried:  essid "aardvark"
mint ~ # dhclient eth1
mint ~ #
The last instruction takes just over 5 minutes to come back to the prompt, but the network is NOT connected. I have run out of ideas and could use some help!

EDITED 9/22/13 20:07 EST
====================
The following is after I try the scripts to connect ...
Code: Select all
mint ~ # iwconfig eth1
eth1      IEEE 802.11bg  ESSID:"f2\x0D\xB71X\xA3Z%]\x05\x17X\xE9^\xD4\xAB\xB2\xCD\xC6\x9B\xB4T\x11\x0E\x82tA!=\xDC\x87" 
          Mode:Managed  Channel:0  Access Point: Not-Associated   
          Bit Rate:0 kb/s   Tx-Power=20 dBm   Sensitivity=8/0 
          Retry limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off
          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
Notice the STRANGE ESSID compared to the following, done AFTER connecting "normally" with the Menu Bar Network icon ...
Code: Select all
mint ~ # iwconfig eth1
eth1      IEEE 802.11bg  ESSID:"aardvark" 
          Mode:Managed  Frequency:2.437 GHz  Access Point: 00:11:22:33:44:55   
          Bit Rate:54 Mb/s   Tx-Power=20 dBm   Sensitivity=8/0 
          Retry limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off
          Link Quality=31/100  Signal level=-60 dBm  Noise level=-88 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:65
Somehow I don't seem to be able to set the ESSID for eth1 from the command line!

EDITED 9/22/13 21:04 EST
====================
I found this link ...
http://www.linuxquestions.org/questions ... 175445452/
"Is NetworkManager or Wicd running? If so, they may be interfering with your attempts at manual configuration."
Code: Select all
mint ~ # ps ax|grep NetworkManager
 3376 pts/0    S+     0:00 grep --colour=auto NetworkManager
mint ~ # ps ax|grep wicd
 3378 pts/0    S+     0:00 grep --colour=auto wicd
The article info does not match this Mint13 system, but I was able to:
Code: Select all
mint ~ # service network-manager stop
mint ~ # iwconfig eth1 essid aardvark
mint ~ # iwconfig eth1
eth1      IEEE 802.11bg  ESSID:"aardvark" 
          Mode:Managed  Frequency:2.437 GHz  Access Point: 00:11:22:33:44:55   
          Bit Rate:54 Mb/s   Tx-Power=20 dBm   Sensitivity=8/0 
          Retry limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off
          Link Quality=47/100  Signal level=-62 dBm  Noise level=-88 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:1   Missed beacon:36
mint ~ # dhclient eth1
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service smbd reload

Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the reload(8) utility, e.g. reload smbd
mint ~ # service smbd reload
mint ~ # service network-manager start
network-manager start/running, process 3581
Dev eth0 is still not connected to the net, but I've been going round and round for over an hour now, so I'll have to reboot and try to make a clean pass. Any clues as to what to do about "wicd" (whatever that is?)?

Last EDIT: Somewhere between the "service smbd reload" and the "service network-manager start", the ESSID got scrogged again, but I can still connect with the Network Icon.
Does "service smbd reload" properly perform the operation of "dhclient eth1"? What script is supposed to be run by the 1st service command to connect eth1 to the WiFi network? Finally, "service network-manager start" is what crashes the ESSID. Connecting with the Network Icon sets it back to "aardvark".

Thank you for any and all comments, suggestions, and assistance with this task.

Blessings in abundance, all the best, & ENJOY!
Art in Carlisle PA USA
BOAT - a hole in the water that you pour money into
LINUX - a hole in your life that you pour TIME into

HP dx2400 Core 2 Duo 4 GB - Mint 10 Gnome, Mint 13 Mate, Mint 15 Mate <on LOCKED Kanguru USB drives>
Webtest
Level 3
Level 3
 
Posts: 176
Joined: Sun Feb 21, 2010 4:45 pm
Location: Carlisle, Pennsylvania, USA

Linux Mint is funded by ads and donations.
 

Return to Wireless

Who is online

Users browsing this forum: No registered users and 5 guests