LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 04-30-2008, 02:24 PM   #1
Mehido
LQ Newbie
 
Registered: Apr 2008
Posts: 2

Rep: Reputation: 0
Connection sharing... complete newbie


Alright, so I've been looking around the net for awhile now, and everything on the subject I find seems to confuse me more. To be honest, I don't understand the tools I've downloaded at all (bridge-utils) and any help would be much appreciated.

Basically, I have no way of running cat5 cable to my attic, so the only way to access the internet up here is through wireless. My linux box (running Ubuntu gutsy) is connected to the router. My linux box has a free ethernet port. Now I have this other box, and it has no wireless card, and only onboard ethernet. That box runs Windows XP (sadly I still need it for school/other things wine won't run). So, to sum this up, is there any way to link the windows box to the linux box to share the wireless connection it has? Thank you in advance!
 
Old 04-30-2008, 08:58 PM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
You can simply configure IP forwarding on the linux box to forward the traffic from the XP host to the wireless router. You should indicate which distro you are running. Many like SuSE have a check box you can select to enable IP forwarding. On others you need to add "echo 1 > /proc/sys/net/ipv4/ip_forward" to a startup script in /etc/. You also may need to modprobe the "nf_conntrack" kernel module before ip forwarding will work. Also, you need to configure the routes. Routing works by forwarding packets based on the subnet that the NIC (or wireless) interface uses.

For IP forwarding, you want each network interface on a separate network or subnet. Then configure the routes, either through a GUI config utility (probably the same one you use to configure your device) or using the "route" or the "ip" command.

I used to use the wireless interface on my laptop to give my desktop internet access via the wireless router.
I subnetted the LAN so that the wireless network was on 192.168.1.0/255.255.255.128 ( the wireless interface was 192.168.1.100) and the desktop was using the 192.168.1.128/255.255.255.128 network ( its NIC used 192.168.1.132 ).

Code:
Wireless network(wireless): 192.168.1.0/25
Desktop network (jesnet):   192.168.1.128/25

Laptop wireless interface:   192.168.1.100/25
Laptop NIC address:          192.168.1.130/25 
Laptop default gateway:      192.168.1.1


Desktop eth0 interface:      192.168.1.132/25
Desktop gateway:             192.168.1.130/25

Route commands for Laptop:
route add -net 192.168.1.0 netmask 255.255.255.128 dev wlan0
route add -net 192.168.1.128 netmask 255.255.255.128 dev eth0
route add default gw 192.168.1.1

Route commands for Desktop:
route add -net 192.168.1.128 netmask 255.255.255.128 dev wlan0
route add default gw 192.168.1.130
I also had a printer and occasionally an old laptop for testing on the jesnet subnet (192.168.1.130/26). I also changed the router's config for the wireless network. The IP address stayed the same but the netmask changed: 192.168.1.1/255.255.255.128.

So to do what you want, you don't need to install or use bridge utils or use NAT on the Linux box if your wireless router is a NAT router. You simply need to configure the subnets/gateways/routes.

Lastly, because you have only two network devices using a wired connection, you can connect both computers using a cross-over cable, eliminating the need for a switch or hub.

Last edited by jschiwal; 04-30-2008 at 09:57 PM. Reason: fixed typo.
 
Old 05-01-2008, 04:11 PM   #3
Mehido
LQ Newbie
 
Registered: Apr 2008
Posts: 2

Original Poster
Rep: Reputation: 0
Wow! Thanks for all that info. I have a spare switch laying around from my last residence, so I suppose that would be easier to just use that than go buy another cable.

I'll try this when I get home from work. Thanks!
 
  


Reply



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
Greetings, complete newbie here Harmony LinuxQuestions.org Member Intro 1 11-25-2007 03:44 AM
Complete Newbie paulus Linux - Software 4 01-12-2007 08:08 AM
Complete Newbie beezum88 LinuxQuestions.org Member Intro 3 08-08-2006 04:54 PM
complete newbie karmologyclinic Linux - Hardware 1 04-02-2005 04:36 PM
complete file sharing to XP mightyer2 Linux - Networking 5 08-19-2004 09:07 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 09:11 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration