Posted by: isaraffee | September 15, 2009

Exploring Wireless in Slackware 12

Exploring Wireless in Slackware 12

You will have to download the wireless package for Slackware. In my case my wireless adapter is manufactured by Ralink, and thus I have found some websites that provide packages for download. You will need to check that the package that is suitable for the Slackware version, kernel version, architecture and so on.

I have downloaded rt2500 module package which is in slackbuild format.

root@galaxy:~/Desktop/build# sh rt2500.SlackBuild

root@galaxy:/tmp# installpkg rt2500-20080517_2.6.21.5_smp-i486-1alien.tgz

Installing package rt2500-20080517_2.6.21.5_smp-i486-1alien…

PACKAGE DESCRIPTION:

rt2500: rt2500 (driver for RaLink 802.11g)

rt2500:

rt2500: RaLink rt2500 is a chipset for 802.11g wireless cards.

rt2500: The rt2500 driver supports cards based on this chipset in Linux.

rt2500: For 802.11b based cards, you’ll need it’s sister: rt2400.

rt2500:

rt2500: rt2500 project info at http://rt2x00.serialmonkey.com/

rt2500:

Executing install script for rt2500-20080517_2.6.21.5_smp-i486-1alien…

root@galaxy:~# modprobe rt2500

root@galaxy:~# lsmod | grep rt2500

rt2500 237920 0

After I have installed the rt2500 module but I still unable to get the wifi device to work. Thus I the downloaded another Ralink module:

rt73-20070901_2.6.21.5_smp-i486-1.tgz

Install the package :

#nstallpkg rt73-20070901_2.6.21.5_smp-i486-1.tgz

Check that the module is loaded

root@galaxy:~/Desktop# lsmod | grep rt

rt2500 237920 0

agpgart 31432 0

parport_pc 27812 1

parport 34760 2 lp,parport_pc

rt73 214784 0

Then you will have to edit the /etc/rc/d/rc.inet1.conf file to look something like this:

root@galaxy:~# more /etc/rc.d/rc.inet1.conf | grep -v “^#”

IPADDR[0]=””

NETMASK[0]=””

USE_DHCP[0]=”yes”

DHCP_HOSTNAME[0]=””

IPADDR[1]=””

NETMASK[1]=””

USE_DHCP[1]=””

DHCP_HOSTNAME[1]=””

IPADDR[2]=””

NETMASK[2]=””

USE_DHCP[2]=””

DHCP_HOSTNAME[2]=””

IPADDR[3]=””

NETMASK[3]=””

USE_DHCP[3]=””

DHCP_HOSTNAME[3]=””

GATEWAY=”192.168.1.1″

DEBUG_ETH_UP=”no”

IFNAME[4]=”wlan0″

IPADDR[4]=”192.168.1.101″

NETMASK[4]=”255.255.255.0″

USE_DHCP[4]=”no”

WLAN_ESSID[4]=gateway1

WLAN_MODE[4]=Managed

WLAN_RATE[4]=”54M auto”

WLAN_CHANNEL[4]=”auto”

WLAN_KEY[4]=”some password in hex.i converted it via Ubuntu network settings!”

Please note that I have set the IP address, wlan0 and the gateway address. This is because of earlier failures which I tried when using dhcp. But you can try to use dhcp

After you edit the file, you need to restart the network services:

root@galaxy:/etc/rc.d# ./rc.inet1 stop

root@galaxy:/etc/rc.d# ./rc.inet1 start

Polling for DHCP server on interface eth0:

No carrier detected on eth0. Reducing DHCP timeout to 10 seconds.

dhcpcd: MAC address = 00:e0:4d:69:5b:94

./rc.inet1: wlan0 information: ‘Any ESSID’

Then you type the following to see the network routing

root@galaxy:/etc/rc.d# ip route show

192.168.1.0/24 dev wlan0 proto kernel scope link src 192.168.1.101

127.0.0.0/8 dev lo scope link

default via 192.168.1.1 dev wlan0 metric 1

The above output results are good signs that you can serve the Internet.

Check that the /etc/resolv.conf entry points to the gateway IP address:

root@galaxy:/etc/rc.d# more /etc/resolv.conf

nameserver 192.168.1.1

Next ping the broadband router:

root@galaxy:/etc/rc.d# ping 192.168.1.1

PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.

64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=9.91 ms

64 bytes from 192.168.1.1: icmp_seq=2 ttl=64 time=2.27 ms

PIng to the route is good. And let’s check out the /var/log/messages file:

Sep 14 00:36:55 localhost logger: /etc/rc.d/rc.inet1: /sbin/ifconfig lo 127.0.0.1

Sep 14 00:36:55 localhost logger: /etc/rc.d/rc.inet1: /sbin/route add -net 127.0.0.0 netmask 255.0.0.0 lo

Sep 14 00:36:55 localhost kernel: ADDRCONF(NETDEV_UP): eth0: link is not ready

Sep 14 00:36:56 localhost logger: /etc/rc.d/rc.inet1: /sbin/dhcpcd -d -t 10 eth0

Sep 14 00:36:56 localhost kernel: ADDRCONF(NETDEV_UP): eth0: link is not ready

Sep 14 00:37:06 localhost kernel: ***rt73***: net_device supplies MAC, activating this one

Sep 14 00:37:06 localhost kernel: ***rt73***: Active MAC is: 00:19:e0:18:6f:d8.

Sep 14 00:37:08 localhost logger: ./rc.inet1: /sbin/iwconfig wlan0 mode Managed

Sep 14 00:37:08 localhost logger: ./rc.inet1: /sbin/iwconfig wlan0 nick galaxy

Sep 14 00:37:08 localhost logger: ./rc.inet1: /sbin/iwconfig wlan0 channel auto

Sep 14 00:37:08 localhost logger: ./rc.inet1: /sbin/iwconfig wlan0 key ************

Sep 14 00:37:08 localhost logger: ./rc.inet1: /sbin/iwconfig wlan0 key restricted

Sep 14 00:37:08 localhost logger: ./rc.inet1: /sbin/iwconfig wlan0 rate 54M auto

Sep 14 00:37:09 localhost logger: ./rc.inet1: /sbin/iwconfig wlan0 essid “gateway1”

Sep 14 00:37:09 localhost logger: ./rc.inet1: /sbin/iwconfig wlan0 essid “gateway1”

Sep 14 00:37:09 localhost logger: /etc/rc.d/rc.inet1: /sbin/ifconfig wlan0 192.168.1.101 broadcast 192.168.1.255 netmask 255.255.255.0

Sep 14 00:37:09 localhost logger: /etc/rc.d/rc.inet1: /sbin/route add default gw 192.168.1.1 metric 1

The above logs definitely shows that the wifi device is working fine, and that you can surf the Net.

Now launch your web browser and you should be able to surf. Enjoy.

Before I forget, let’s see the output of some of the wireless commands:

root@galaxy:/etc/rc.d# iwconfig

lo no wireless extensions.

wlan0 RT73 WLAN ESSID:”gateway1″ Nickname:”galaxy”

Mode:Managed Frequency=2.462 GHz Access Point: 00:1E:10:09:8D:58

Bit Rate=54 Mb/s

RTS thr:off Fragment thr:off

Encryption key:676F-7469-74

Link Quality=76/100 Signal level:-60 dBm Noise level:-99 dBm

Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0

Tx excessive retries:0 Invalid misc:0 Missed beacon:0

eth0 no wireless extensions.

root@galaxy:/etc/rc.d# ifconfig wlan0

wlan0 Link encap:Ethernet HWaddr 00:19:E0:18:6F:D8

inet addr:192.168.1.101 Bcast:192.168.1.255 Mask:255.255.255.0

inet6 addr: fe80::219:e0ff:fe18:6fd8/64 Scope:Link

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

RX packets:40777 errors:0 dropped:0 overruns:0 frame:0

TX packets:15044 errors:0 dropped:17 overruns:0 carrier:0

collisions:0 txqueuelen:1000

RX bytes:20284531 (19.3 MiB) TX bytes:1363244 (1.3 MiB)

root@galaxy:/etc/rc.d# iwlist wlan0 scan

wlan0 Scan completed :

Cell 01 – Address: 00:1E:10:09:8D:58

ESSID:”gateway1″

Mode:Managed

Channel:11

Encryption key:on

Bit Rates:0 kb/s

Cell 02 – Address: 00:22:B0:8F:54:2D

ESSID:”Maverick”

Mode:Managed

Channel:6

Encryption key:on

Bit Rates:0 kb/s

Cell 03 – Address: 00:90:CC:AD:67:2E

ESSID:””

Mode:Managed

Channel:11

Encryption key:on

Bit Rates:0 kb/s

Cell 04 – Address: 00:1D:7E:1E:65:C9

ESSID:”Sharol”

Mode:Managed

Channel:11

Encryption key:on

Bit Rates:148 Mb/s

Just for the record, you may want to explore the GUI method of configuring network. Lauch Control Centre, click Internet & Network–>Network Settings. In my case this is not configured.

There is however settings in the Internet & Network–>Wireless Network.

I have entered the network name which is my essid, interface wlan0, Operation mode as managed, speed auto, use encryption and load preset configuration on startup.

I found that when I click the Activate button, I could not surf the Internet anymore. But the settings are needed though.

After boot up, /var/log/messages recorded the following:

Sep 15 14:02:54 localhost kernel: usbcore: registered new interface driver rt73

Sep 15 14:02:56 localhost kernel: ***rt73***: Interface goes up for the first time, activating permanent MAC

Sep 15 14:02:56 localhost kernel: ***rt73***: Active MAC is: 00:19:e0:18:6f:d8.

root@galaxy:/var/log# less messages | grep rt73

I checked the output of some of the wireless commands:

root@galaxy:/var/log# ifconfig wlan0

wlan0 Link encap:Ethernet HWaddr 00:19:E0:18:6F:D8

inet addr:192.168.1.101 Bcast:192.168.1.255 Mask:255.255.255.0

inet6 addr: fe80::219:e0ff:fe18:6fd8/64 Scope:Link

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

RX packets:6648 errors:0 dropped:0 overruns:0 frame:0

TX packets:754 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:1000

RX bytes:583100 (569.4 KiB) TX bytes:92056 (89.8 KiB)

root@galaxy:/var/log# ip route show

192.168.1.0/24 dev wlan0 proto kernel scope link src 192.168.1.101

127.0.0.0/8 dev lo scope link

default via 192.168.1.1 dev wlan0 metric 1

root@galaxy:/var/log# ping 192.168.1.1

PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.

From 192.168.1.101 icmp_seq=2 Destination Host Unreachable

From 192.168.1.101 icmp_seq=3 Destination Host Unreachable

From 192.168.1.101 icmp_seq=4 Destination Host Unreachable

— 192.168.1.1 ping statistics —

5 packets transmitted, 0 received, +3 errors, 100% packet loss, time 3999ms

, pipe 3

root@galaxy:/var/log# iwconfig wlan0

wlan0 RT73 WLAN ESSID:”gateway1″ Nickname:”galaxy”

Mode:Managed Frequency=2.412 GHz Bit Rate=54 Mb/s

RTS thr:off Fragment thr:off

Encryption key:0000-0000-00

Link Quality=0/100 Signal level:-63 dBm Noise level:-107 dBm

Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0

Tx excessive retries:0 Invalid misc:0 Missed beacon:0

root@galaxy:/var/log# more /etc/resolv.conf

nameserver 192.168.1.1

root@galaxy:/var/log# netstat -rn

Kernel IP routing table

Destination Gateway Genmask Flags MSS Window irtt Iface

192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 wlan0

127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo

0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 wlan0

We can conclude that the IP address assigned to this server is good. The default gateway IP address is set correctly, but the ping test from the server to the gateway failed.Nevertheless the routing information shows that the packets are routed correctly.The ESSID, Mode and Managed parameters also reflected the correct values.

So now let’s run the rc.inet1 script to restart the network services.

root@galaxy:/etc/rc.d# ./rc.inet1 stop

root@galaxy:/etc/rc.d# ./rc.inet1 start

After restarting the network services, the /var/log/message recored:

root@galaxy:/var/log# tail -f messages

Sep 15 14:27:07 localhost logger: ./rc.inet1: /sbin/iwconfig wlan0 mode Managed

Sep 15 14:27:07 localhost logger: ./rc.inet1: /sbin/iwconfig wlan0 nick galaxy

Sep 15 14:27:07 localhost logger: ./rc.inet1: /sbin/iwconfig wlan0 channel auto

Sep 15 14:27:07 localhost logger: ./rc.inet1: /sbin/iwconfig wlan0 key ************

Sep 15 14:27:07 localhost logger: ./rc.inet1: /sbin/iwconfig wlan0 key restricted

Sep 15 14:27:07 localhost logger: ./rc.inet1: /sbin/iwconfig wlan0 rate 54M auto

Sep 15 14:27:07 localhost logger: ./rc.inet1: /sbin/iwconfig wlan0 essid “gateway1”

Sep 15 14:27:07 localhost logger: ./rc.inet1: /sbin/iwconfig wlan0 essid “gateway1”

Sep 15 14:27:07 localhost logger: /etc/rc.d/rc.inet1: /sbin/ifconfig wlan0 192.168.1.101 broadcast 192.168.1.255 netmask 255.255.255.0

Sep 15 14:27:07 localhost logger: /etc/rc.d/rc.inet1: /sbin/route add default gw 192.168.1.1 metric 1

And below are the output of nestat and ping results to the gateway:

root@galaxy:/var/log# netstat -rn

Kernel IP routing table

Destination Gateway Genmask Flags MSS Window irtt Iface

192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 wlan0

127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo

0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 wlan0

root@galaxy:/var/log# ping 192.168.1.101

PING 192.168.1.101 (192.168.1.101) 56(84) bytes of data.

64 bytes from 192.168.1.101: icmp_seq=1 ttl=64 time=0.024 ms

64 bytes from 192.168.1.101: icmp_seq=2 ttl=64 time=0.021 ms

WIth such ping results, you could definitely surf the Internet.

So with that I will now do two things; first test, I will remove the authentication password which is in hex in the /etc/rc.d/inet1.conf file. The second test, I will remove the settings in the GUI of Control Center–>Internet & Network–>WIreless Network.

The first test – Removal of the authentication password which is in hex in the /etc/rc.d/inet1.conf

Clear the value:

WLAN_KEY[4]=””

Quit and save. Then restart the network services.

Results of first test

Ping to gateway failed; which means Internet access failed.

Nevertheless the ESSID, Mode, and etc parameters were set up correctly.

Conclusion of first test

This test conclude that the password in hex is important in the configuration file, which may suggest that the password set in the GUI is not necessary. Let’s prove this by performing the second test.

Second test – Removal of network settings via GUI in the WIreless Network

Before performing this test, I have reinstate the network settings so that I can access the Internet.

Go to Control Center–>Internet & Network–>WIreless Network and clear the settings.

Restart the network services and try to access the Internet.

Results of second test.

Ping to gateway failed; which means Internet access failed.

Nevertheless the ESSID, Mode, and etc parameters were set up correctly.

Conclusion of second test.

The second test concluded that setting in the Control Center–>Internet & Network–>WIreless Network are necessary.

Note:

After you have restore settings in the Control Center–>Internet & Network–>WIreless Network, you will need to reboot the server. Otherwise you will not be able to access the Internet eventhough you have restart the network services.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: