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. |
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) |
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 |
My laptop is fedora 12
|
Did you try the link
|
Yes I tried the link, it gave me ideas what to do ... Thank you very much for all the replies
|
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. |
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 |
Quote:
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. |
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 |
All times are GMT -5. The time now is 08:38 AM. |