LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 01-22-2009, 07:28 AM   #1
gugamare
LQ Newbie
 
Registered: Dec 2004
Location: São Paulo, Brazil
Distribution: Ubuntu 9.10
Posts: 24

Rep: Reputation: 15
Sharing internet connection via wireless


Hey guys,

I'm looking for a cool way to share my internet connection between my desktop running debian (lenny) and a laptop running Windows XP. Here is my situation: I plug my desktop's wired Ethernet card to a DLS modem on the wall. The desktop has a separate wireless Ethernet card, which is currently not being used for anything.

I'd like to share the connection with the laptop using the desktop's wireless card. Kind of turning my desktop into a wireless router I've looked into the Zebra, and Quagga projects and they seem to provide the functionality for this.

http://www.quagga.net/

The problem is that I'm not too savvy with all the networking lingo. I'm not sure I got the right equipment, and I'm afraid to turn my computer into a bloated food processor instead of a wireless router.

So here are my questions:

1- Is this even possible or am I wasting my time?

2- If possible, is this a monstrous task or no so much?

3- Am I on the right track with Zebra/Quagga or are there more appropriate (easier to use) tools?

4- Finally, can any one recommend an article or tutorial where I can get some step-by-step instructions in achieving my objective?


Thank you all in advance.
 
Old 01-22-2009, 11:41 AM   #2
vladmihaisima
Member
 
Registered: Oct 2002
Location: Delft, Netherlands
Distribution: Gentoo
Posts: 196

Rep: Reputation: 33
I did somnething similar and it works quite well. As far I remember I used just the iptables from the kernel. I will post additional info when I'm back at that computer.

One important point. What wireless card do you have on the desktop ? You should be able to put it into ad-hoc mode (I was not able to configure mine to be an AP, but the ad-hoc mode worked well)

Edit:

So this is what I did. Providing your wireless driver supports I issued this commands:
Code:
ifconfig wlan0 down
iwconfig wlan0 essid phoenix
iwconfig wlan0 mode ad-hoc
iwconfig wlan0 key s:vvvvv
ifconfig wlan0 192.168.0.1 up
For configuring iptables you can do:

Code:
# First we flush our current rules 
iptables -F
iptables -t nat -F

# Setup default policies to handle unmatched traffic 
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT

# Copy and paste these examples ... 
export LAN=wlan0
export WAN=eth0

echo Adding input rules
iptables -I INPUT 1 -i ${LAN} -j ACCEPT
iptables -I INPUT 1 -i lo -j ACCEPT

echo Adding ssh input rule
iptables -A INPUT -p TCP --dport ssh -i ${WAN} -j ACCEPT

echo Adding forward tables
iptables -A FORWARD -i ${LAN} -s 192.168.0.0/255.255.0.0 -j ACCEPT
iptables -A FORWARD -i ${WAN} -d 192.168.0.0/255.255.0.0 -j ACCEPT

echo Adding nat tables
iptables -t nat -A POSTROUTING -o ${WAN} -j MASQUERADE
# Tell the kernel that ip forwarding is OK 
echo 1 > /proc/sys/net/ipv4/ip_forward
for f in /proc/sys/net/ipv4/conf/*/rp_filter ; do echo 1 > $f ; done
You will also need a simple DNS server on the 'router' machine. I use dnsmasq for that, so, after all of the above I also do:

Code:
/etc/init.d/dnsmasq start
I didn't write this by myself, I copied them from somewhere, but I do not remember where. The only problem would be that you would need to configure the needed things in the kernel (like iptables and the necesssary targets). With some google-ing you should be able to do that, if you do not manage I can lookup the kernel configuration I have...

Last edited by vladmihaisima; 01-22-2009 at 05:20 PM.
 
Old 01-23-2009, 08:39 PM   #3
gugamare
LQ Newbie
 
Registered: Dec 2004
Location: São Paulo, Brazil
Distribution: Ubuntu 9.10
Posts: 24

Original Poster
Rep: Reputation: 15
Thanks allot Vlad. I'll try this out.
 
Old 01-27-2009, 04:02 PM   #4
gugamare
LQ Newbie
 
Registered: Dec 2004
Location: São Paulo, Brazil
Distribution: Ubuntu 9.10
Posts: 24

Original Poster
Rep: Reputation: 15
Hey Vlad,

I've tried your suggestion but I can't seem to get it working.

When I issue the command

Code:
ifconfig wlan0 192.168.0.1 up
I get a message

Code:
SIOCSIFFLAGS: Operation not supported
Do you have any suggestions?

----------------------------

Some more data on my system. Im running a debian lenny, kernel 2.6.26-amd64.

When I issue lspci my wireless cards show as

Code:
Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8185 IEEE 802.11a/b/g Wireless LAN Controller (rev 20)
iwconfig gives me

Code:
wlan0     IEEE 802.11  ESSID:"phoenix"  
          Mode:Ad-Hoc  Frequency:2.412 GHz  Cell: BA:4F:45:84:79:CF   
          Tx-Power=20 dBm   
          Retry min limit:7   RTS thr:off   Fragment thr=2352 B   
          Encryption key:7676-7676-76
          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
Thanks again

Last edited by gugamare; 01-27-2009 at 04:03 PM.
 
Old 01-28-2009, 03:54 AM   #5
vladmihaisima
Member
 
Registered: Oct 2002
Location: Delft, Netherlands
Distribution: Gentoo
Posts: 196

Rep: Reputation: 33
I think you can ignore the message of the 'ifconfig up' command, as what you posted later is looking ok.

Now, you should be able to connect from the other computer to the 'phoenix' network in adhoc mode. (the default search is for AP mode). I am not sure how you dod that on windows, I used a special program that came with the wireless adapter. For my case after setting it it took something like 1-2 minutes to connect (so, it was not 'instant')
)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sharing Wireless Internet Connection Mandriva winXP glassnominal Linux - Wireless Networking 5 11-27-2007 06:40 PM
Internet Connection Sharing for Private Wireless Network kanwar_rajan Linux - Wireless Networking 0 09-18-2007 12:37 PM
Sharing Internet Connection lmangwanda Linux - Networking 3 09-07-2007 09:56 AM
internet connection sharing meinzorn Linux - Software 22 04-23-2005 01:32 AM
sharing an internet connection bubba169 Linux - General 9 06-02-2002 09:50 AM


All times are GMT -5. The time now is 02:32 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration