Jump to content

Using wireless card to share internet connection


Andrewski
 Share

Recommended Posts

I have a computer in my bedroom (MDK) that I would like to set up to share its internet connection. Problem is, I'm using the madwifi driver on it, so the friendly wizard in MCC doesn't recognise the connection as one available to share... though it most definitely is. :P

 

Does anyone know how I could get around this? I'm looking for a fairly quick solution, though I'm willing to do a bit more work if necessary (but only after upgrading to OE first :thumbs: ).

Link to comment
Share on other sites

Here read through this. I did steal it from another site, but it helped me. Not sure if you needed all of it or not, but just in case.

 

This is a simple HOWTO to get your wireless card working in Linux.

All commands are given between `` '' and you'll have to edit most of them to suit your system. If you have any questions or adds to this HOW-TO, just post them below.

I should also add, that these drivers support a wide range of cards, and also should work independant on distribution, although things might have to be done slightly different for different distributions.

 

First off, we need a few programs;

wireless tools - you can download, search freshmeat for ``iwconfig'' and you'll find them.

 

Download and untar them using ``tar zxvf wireless_tools.26.tar.gz''

Now you can remove the downloaded file, you don't need it anymore ``rm wireless_tools.26.tar.gz''

Change directory to wireless_tools.26, ``cd wireless_tools.26''.

Now compile and install it using ``make && make install''.

If you get any errors, read the INSTALL file in the same directory, if all went well, we can cd out of the dir and delete it ``cd .. && rm -rf wireless_tools.26''.

 

Next we need to get the drivers, these are best to get from cvs.

If you have cvs installed, this command will download them for you ``cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/madwifi co madwifi''.

CD into the new directory that was made ``cd madwifi''.

Now you need to figure a few things out on your own; what kernel version (KERNELRELEASE) you have and where the sources are (KERNELPATH). You will also have to know wheter your distribution uses /usr/local/bin or just /usr/bin (TOOLPREFIX), and finally you need to know what sort of CPU you are building for (TARGET). If it is x86 then we will use i386-elf. When you know these things do ``export KERNELPATH=/path/to/sources && export KERNELRELEASE=2.4.x && export TOOLPREFIX=/usr/bin/ && export TARGET=i386-elf''. and change everything after the '=' to what you need.

Now it should be safe to build it with make, ``make && make install''.

You may have to copy hal/linux/<your target arch>.opt_ah.h to hal/linux/opt_ah.h

``cp hal/linux/i386-elf.opt_ah.h hal/linux/opt_ah.h && make && make install''.

 

Now the drivers should be complete and ready to be used, now we test to load the new modules which should be in /lib/modules/<kernel number>/net. If they are modprobe will suffice, else you might have to locate them with ``find / -iname ath_hal.o'' and go to that directory.

 

Use modprobe first ``modprobe wlan && modprobe ath_hal && modprobe ath_pci''. Note that wlan and ath_hal must be loaded before ath_pci is.

 

If this doesn't work, change dir as I described above and do ``insmod wlan && insmod ath_hal && ath_pci''.

 

If they complain about symbolic links, you need to recompile your kernel. Edit the .config file in your kernel source directory and look for the line CONFIG_MODVERSIONS= make sure it says ``n''. If it doesn't, change the ``y'' to ``n'' and recompile your kernel. Note; you only need to remake your image! ``make bzImage''. Copy it to the correct place and reboot Linux.

Now you just might have to redo the wireless drivers, which is why we haven't deleted that directory yet, go back up and redo those steps.

After reboot you can test loading the modules again, if no errors you don't have to recompile your drivers.

 

Next, get the card up and running.

If you have another ethernet card running, it appears you will need to turn it off ``route del -net default && ifconfig eth0 down''.

 

There are now two ways to get an IP# to your netcard, either setting it by hand or get it from a DHCP server, i'll describe the latter first.

 

Bring up the interface first ``ifconfig ath0 up''.

If you want to use anything else than 802.11a, you need to specify a mode with ``iwpriv ath0 mode X''. Find out what you should replace X with by reading the manpages for iwconfig ``man iwconfig'' look for ``mode''.

 

Set your essid (ssid applys here too) ``iwconfig ath0 essid any''. You can replace ``any'' with your own essid but then you need to use "" around the name ``iwconfig ath0 essied "Digital"''.

 

If you have a wep key, set it now ``iwconfig ath0 key XXXXX''. Replace XXXXX with your WEP key.

 

Set the channel you want to use ``iwconfig ath0 channel 5''. Replace 5 with your channel.

 

If you want to specify bitrate (you do) use ``iwconfig ath0 rate 24MB''. Replace 24 with your bitrate.

 

Now call dhcp to get route, nameservers and ip# for you ``dhcpcd ath0''. This might take a few.

 

If all is fine, you can now reach your LAN and internet where that is available.

 

For static ip#, you do it slightly different.

 

Bring up the interface first ``ifconfig ath0 up 192.168.0.1''.

Change ``192.168.0.1'' to whatever IP# you want to use.

 

Find out what your gateways IP# is and set it

``route add default gw 192.168.0.254''. Replace ``192.168.0.254'' with your gateway's IP#.

 

Find out what your nameservers ip# is and add them to /etc/resolv.conf file.

``echo "nameserver 192.168.0.254" >> /etc/resolv.conf''.

 

Change 192.168.0.254 to your name servers ip#.

 

If you want to use anything else than 802.11a, you need to specify a mode with ``iwpriv ath0 mode X''. Find out what you should replace X with by reading the manpages for iwconfig ``man iwconfig'' look for ``mode''.

 

Set your essid (ssid applys here too) ``iwconfig ath0 essid any''. You can replace ``any'' with your own essid but then you need to use "" around the name ``iwconfig ath0 essied "Digital"''.

 

If you have a wep key, set it now ``iwconfig ath0 key XXXXX''. Replace XXXXX with your WEP key.

 

Set the channel you want to use ``iwconfig ath0 channel 5''. Replace 5 with your channel.

 

If you want to specify bitrate (you do) use ``iwconfig ath0 rate 24MB''. Replace 24 with your bitrate.

 

Should work, and if it doesn't maybe I've helped you a bit on the way at least :)

 

Good luck!

P.S Any comments would be nice :)

 

Again not sure if I should have stolen that or not but it worked for me.

 

FX

Edited by FX
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...