LinuxQuestions.org
Help answer threads with 0 replies.
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 09-03-2010, 12:26 PM   #1
chymeira
Member
 
Registered: Dec 2008
Location: CH/IL
Distribution: Slackware 13.1 Fedora 12
Posts: 73

Rep: Reputation: 16
sharing wireless using eth


Hello everyone,

I just bought a new computer and installed slackware 13 on it. Unfortunately my new desktop doesnt have a wireless adaptor to connect to the wireless in our place, but I have a laptop that can connect to the wireless internet. So I was wondering if theres a way that my laptop can provide internet connection to my dekstop using ethernet ?

Thank you very much.
 
Old 09-03-2010, 02:20 PM   #2
hogar.strashni
Member
 
Registered: Dec 2007
Distribution: cp6
Posts: 44

Rep: Reputation: 2
You can check this solved thread at LQ. I'm quite sure you'll find your answer here.
Port forwarding 80 to lan (web server)
 
Old 09-03-2010, 02:46 PM   #3
MotherDawg
LQ Newbie
 
Registered: Aug 2010
Location: Montreal Quebec Canada
Distribution: RPMs... RedHat, CentOS & Fedora
Posts: 13

Rep: Reputation: Disabled
Wow... that tread is so cryptic, you have to decode what that guy wanted in the first place. A few post down he goes " i got all wrong "... I got IT all wrong maybe
The guys that answered it all had trouble figuring it out.
And on top, I think that guy is already advanced in the connection.

Throwing thread links as an answer is, in my opinion, a bad way to help someone.
If the need arises, it is important that the tread is readable and informative. I stopped reading that post halfway through.

Chymeira, It is called a bridge between the networks.
You have to forward ports and adjust IPs and firewalls.
In everything that I found, you have to wire the laptop down direct to the PC.

Where I live there's a slow 1mb internet connection available for free. My PCs are wired to my router and getting a wireless internet signal from one to the others through the router is out of my league for now.

This is the best I found for me, I'm fedora, an RPM distro.
http://forums.fedoraforum.org/showthread.php?t=231374

I'll look in it again but I hope some network guru can help us figure it out in an understandable manner... in english.

BTW, that laptop, Windoz or Linux too ?

We'll see

Last edited by MotherDawg; 09-03-2010 at 03:02 PM. Reason: I write like a pig!
 
Old 09-03-2010, 03:06 PM   #4
chymeira
Member
 
Registered: Dec 2008
Location: CH/IL
Distribution: Slackware 13.1 Fedora 12
Posts: 73

Original Poster
Rep: Reputation: 16
My laptop is fedora 12
 
Old 09-03-2010, 03:46 PM   #5
MotherDawg
LQ Newbie
 
Registered: Aug 2010
Location: Montreal Quebec Canada
Distribution: RPMs... RedHat, CentOS & Fedora
Posts: 13

Rep: Reputation: Disabled
Did you try the link

Last edited by MotherDawg; 09-03-2010 at 03:51 PM.
 
Old 09-03-2010, 04:19 PM   #6
chymeira
Member
 
Registered: Dec 2008
Location: CH/IL
Distribution: Slackware 13.1 Fedora 12
Posts: 73

Original Poster
Rep: Reputation: 16
Yes I tried the link, it gave me ideas what to do ... Thank you very much for all the replies
 
Old 09-04-2010, 03:18 AM   #7
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
I did exactly the same thing using my laptop a few years ago. If you configure the wired network on a different subnet or network than the wired network, the routing table in the laptop will route the internet traffic to the wireless interface. That is what the default gateway is for. On the desktop, configure the laptop's wired Ethernet IP as the default gateway. On the Laptop, you may need to load the nf_conntrack module if it isn't loaded. ( I found I needed it when it was called tc_conntrack for forwarding to work )

I subnetted the 192.168.1.0 network space to use 192.168.1.0/25 on wireless and 192.168.1.128/25 between my laptop and the desktop. Doing this I didn't need to configure NAT on my laptop to enable network sharing. I let the router do it.

You also need to enable IP forwarding on your laptop. There should be a setting in your networking GUI control for Fedora for that. Another way is to edit /etc/sysctl.conf, probably editing the line with net.ipv4.ip_forward=1, uncommenting it or changing 0 to 1. A newer kernel may use a different location. Check Fedora 12 docs for this.

If instead you use a different network space altogether for the wired part of the network. (e.g. 10.0.0.0 network) then you will need to enable masquerading on the laptop. Check that network sharing is offered in your gui network control. Otherwise you will need to use ip_tables rules yourself. You will save yourself a lot of work if your configuration does it for you.
 
Old 09-15-2010, 01:01 AM   #8
MotherDawg
LQ Newbie
 
Registered: Aug 2010
Location: Montreal Quebec Canada
Distribution: RPMs... RedHat, CentOS & Fedora
Posts: 13

Rep: Reputation: Disabled
Question

Hi everyone,

I'm trying it again. :-|
My present physical setup is:
Laptop = Fedora 13
Main Home PC = Win XPP
Other PCs = CentOS and a good old Win98sr2
All wired up to a small router
I used to have a modem plugged in to the WAN of the router and life was good for years.
Things are what they are today...

The Internet connection now only comes from the laptop's wlan0 = 192.168.2.13
I am sure that this could be done by either using the router as a switch or having the laptop give an ip to the WAN of the router... ??? Both need the laptop's NICs to exchange their packets.

Router as a switch:
All PCs are wired to the router ports including the laptop.
I need to Route and/or bridge the laptop's wlan0 with it's eth0 to redistribute the internet connection to the other PCs.
Every thing I've read in this and on other Forums all have a single Desktop wired to the eth0 of the laptop. Keeping the router so that my 3 other desktop... can all re-enjoy the net... is important to me. This does not seem to be a problem as I can ping from one client to the other.

OK :
Laptop's wlan0 = 192.168.2.13
Laptop's eth0 = 10.10.10.103


WinXP ip = 10.10.10.107
Since the laptop bridging/routing is not done yet, when I try to add a route to the default gateway of 192.168.2.13 in the WinXP I get:
"The route addition failed: Either the interface index is wrong or the gateway does not lie on the same network as the interface. Check the IP Address Table for the machine."
That default gw might need to be 192.168.2.1 (the laptop's gw).

WinXP .107 pings .103 (laptop's eth0) with out a problem.
.107 cannot ping .2.13 (laptop's wlan0).


Following my bible: Prentice.Hall.A.Practical.Guide.to.Red.Hat.Linux.Fedora.Core.and.Red.Hat.Enterprise.Linux.3rd Bouhou my hard cover is disintegrating. 8-((

Chap.25 went like this:
iptables -A FORWARD -i wlan0 -o eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -i eth0 -o wlan0 -j ACCEPT
iptables -A FORWARD -j LOG
iptables -t NAT -A POSTROUTING -o wlan0 -j MASQUERADE

2 things are funny here:

1- When I use these commands, the iptable rules do not appear in the iptables file !?!?!? I added them Manually

2- When I punch in the 4th one, I get a NAT error. Searching for it like crazy... I got 3 windows of Firefox open with multiple tabs and no answers fit. #-((

NAT error: iptables v1.4.7: can't initialize iptables table `NAT': Table does not exist (do you need to insmod?)Perhaps iptables or your kernel needs to be upgraded.

The Masquerade (line 7) in the following was added when I used system-config-firewall (the FW's gui). Open System -> Administration -> Firewall, and under 'Masquerading' selected wlan0

cat /etc/sysconfig/iptables
1 # Firewall configuration written by system-config-firewall
2 # Manual customization of this file is not recommended. yadayadayada...
3 *nat
4 :PREROUTING ACCEPT [0:0]
5 :OUTPUT ACCEPT [0:0]
6 :POSTROUTING ACCEPT [0:0]
7 -A POSTROUTING -o wlan0 -j MASQUERADE
8 COMMIT
9 *filter
10 :INPUT ACCEPT [0:0]
11 :FORWARD ACCEPT [0:0]
12 :OUTPUT ACCEPT [0:0]
13 -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
14 -A INPUT -p icmp -j ACCEPT
15 -A INPUT -i lo -j ACCEPT
16 -A INPUT -m state --state NEW -m udp -p udp --dport 137 -j ACCEPT
17 -A INPUT -m state --state NEW -m udp -p udp --dport 138 -j ACCEPT
18 -A INPUT -m state --state NEW -m tcp -p tcp --dport 139 -j ACCEPT
19 -A INPUT -m state --state NEW -m tcp -p tcp --dport 445 -j ACCEPT
20 -A INPUT -m state --state NEW -m udp -p udp --dport 137 -j ACCEPT
21 -A INPUT -m state --state NEW -m udp -p udp --dport 138 -j ACCEPT
22 -A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
23 -A INPUT -m state --state NEW -m udp -p udp --dport 1043 -j ACCEPT
24 -A INPUT -m state --state NEW -m tcp -p tcp --dport 1043 -j ACCEPT
25 -A INPUT -m state --state NEW -m udp -p udp --dport 62565 -j ACCEPT
26 -A INPUT -m state --state NEW -m tcp -p tcp --dport 62565 -j ACCEPT
27 ###
28 # Practical guide RedHatLinux - ch25: Sharing an Internet Connection Using NAT
29 #
30 -A FORWARD -i wlan0 -o eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT
31 -A FORWARD -i eth0 -o wlan0 -j ACCEPT
32 -A FORWARD -j LOG
33 ###
34 -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
35 -A FORWARD -p icmp -j ACCEPT
36 -A FORWARD -i lo -j ACCEPT
37 -A FORWARD -o wlan0 -j ACCEPT
38 -A INPUT -j REJECT --reject-with icmp-host-prohibited
39 -A FORWARD -j REJECT --reject-with icmp-host-prohibited
40 COMMIT


Where to... I'll continue.


Thanks to all who read down to this line.
Gilles

Last edited by MotherDawg; 09-15-2010 at 01:14 AM. Reason: I do not know how to write!
 
Old 09-19-2010, 04:45 PM   #9
hogar.strashni
Member
 
Registered: Dec 2007
Distribution: cp6
Posts: 44

Rep: Reputation: 2
Quote:
Originally Posted by MotherDawg View Post
Hi everyone,


The Internet connection now only comes from the laptop's wlan0 = 192.168.2.13
All PCs are wired to the router ports including the laptop.
I need to Route and/or bridge the laptop's wlan0 with it's eth0 to redistribute the internet connection to the other PCs.
OK :
Laptop's wlan0 = 192.168.2.13
Laptop's eth0 = 10.10.10.103


WinXP ip = 10.10.10.107
Since the laptop bridging/routing is not done yet, when I try to add a route to the default gateway of 192.168.2.13 in the WinXP I get:
"The route addition failed: Either the interface index is wrong or the gateway does not lie on the same network as the interface. Check the IP Address Table for the machine."
That default gw might need to be 192.168.2.1 (the laptop's gw).

WinXP .107 pings .103 (laptop's eth0) with out a problem.
.107 cannot ping .2.13 (laptop's wlan0).


Thanks to all who read down to this line.
I can't give you exact solution, because I don't and I won't have computers to try one.
Still, I hope I can help you a little. Default gateway for your desktops, and XP as well, should be either 10.10.10.103(which I find more probable) or 10.10.10.1(which is I suppose your router's address and I think, less probable answer to your problem)

What you need to do is to direct your internet traffic to go outside your local network. And the only way is to send it through the gateway to the neighbouring network, and let it deal with it. It's just like real life: when you find a snake in your yard, just take a stick and through it to your neighbours yard(just kidding ). But that's how it works with network - if you don't know what to do with it, just throw it through your default gateway to the dearest neigbour Your default gateway is your laptop and your LAN interface has address 10.10.10.103, and now you must tell your laptop, what's his new roll in your network. That's were forwarding takes place. You have to forward your traffic from .10.103 to .2.13.

Less probable solution is that you have to throw it to 10.10.10.1(your router) which will pass it to your lap top, which will again pass it to the internet. I wrote this "just in case".

My sister is sharpening the knife, so I have to give her back her computer, or I'll be a stеak. Else I would try to make this post shorter. Sorry. Hope I helped you.

Last edited by hogar.strashni; 09-19-2010 at 04:48 PM.
 
Old 10-17-2010, 03:07 PM   #10
MotherDawg
LQ Newbie
 
Registered: Aug 2010
Location: Montreal Quebec Canada
Distribution: RPMs... RedHat, CentOS & Fedora
Posts: 13

Rep: Reputation: Disabled
Finally !

Hogar, after you answered me, I hack at it again but it just did not want to forward packets.

I had to find a job this summer and since the laptop had internet, I mainly worked with it.

I fixed my job problem last week: I now work for Datavalet... YA-HO! Done sending CVs.

Today, October 17, I rewired everything and verified all IPs.

When I connect the laptop eth0 to the router, it's GW changes from the wlan GW to the router's GW because of the better Metrics. Laptop looses internet.

Punched in route add default gw 192.168.2.1 and got internet back.

XP desktop was now at .121, verified the routes ??? The default GW is already the laptop's IP. As I said before, XP was giving me an error when I tried to add the laptop's IP as the GW. Now it had found it by itself ??? I had shutdown my XP Desktop many time since then (and work with it as a stand alone).

The only thing I can come up with is I had probably messed it up before. I dunno! I hate that. #-/

So my antivirus & firewall on the XP are presently updating, I have a huge backlog of stuff to do... like get Samba running, users and all.

I Got to find the way to hard code the default GW when the laptop gets wired, preventing it from changing to the router's.

WoooHooo! 8-)))

Thanks a lot for your help.

Cya
Gilles
 
  


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
Make Ubuntu Linux work as a wireless router--wireless Internet sharing erossmith Linux - General 6 04-21-2013 09:59 PM
Can Eth device names(or macs) be correlated to the physical eth port? VG1 Linux - Networking 1 12-01-2009 06:13 PM
Sharing connection (pc + wireless + wired ++ laptop + wireless) Lullly Linux - Networking 1 03-28-2009 06:34 PM
setting up a wireless router using eth.cable?? nikoz Linux - Wireless Networking 2 02-04-2007 01:00 PM
Internet Sharing with 3 eth devices problem, Mandriva 2006 muhon Linux - Networking 2 11-08-2005 06:08 PM

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

All times are GMT -5. The time now is 03:16 PM.

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