LinuxQuestions.org
Visit Jeremy's Blog.
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 02-26-2010, 01:17 AM   #1
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
can we do mac-style internet connection sharing on gnu/linux?


On the mac they have this way to share an internet connection to other computers.

The closest I've come up with is a script which sets up forwarding or a bridge between two devices, taking the second device from a user input.

But it is so simple and obvious that someone must have written an app just for this that is much more elegant.

Anyone found one?
 
Old 02-26-2010, 03:14 AM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Maybe you could explain what "this way" does. Your link just indicates how to enable it not what it does.

Why do you want your LAN to use public IP addresses? Do you have a public IP address assigned for each one?

Last edited by jschiwal; 02-26-2010 at 03:19 AM.
 
Old 02-26-2010, 07:13 AM   #3
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Original Poster
Rep: Reputation: 198Reputation: 198
You misunderstand - what is described is what I am looking for. I am not trying to set up a home LAN - though the ability to act as a subnet at the drop of a hat would be good.

I know how to use iptables to bridge or forward packets between two interfaces.
I can set up a script to do this, and the ability to launch it from a desktop or a menu.
I'm not asking how to do the technical side.

What I am asking about is a turnkey solution where this is already set up.
Install the app, and you get a menu item which facilitates sharing an existing internet connection over a nominated interface - by any means. I don't care how it gets this done. Its an abstraction layer.

The specific context is the case of a kid in Africa with an XO. I want them to have the option to use their machine to share its connection with another kids without having the kid do any scripting.
 
Old 02-26-2010, 02:36 PM   #4
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
If you act as a dhcp server and perform NAT masquerading for any hosts on the lan, additional hosts added to the lan simply need to opt to use DHCP to configure their devices. I can't imagine anything easier than that. For many distro's this is just a matter of selecting that you want to share your internet connection in a network device configuration wizard. IMHO, bridging is the wrong method to use.

If you have only one interface, then you need to use a virtual NIC device with a LAN address. There is the disadvantage that Internet traffic will be exposed on the switch or wireless LAN.
 
Old 02-26-2010, 03:06 PM   #5
frieza
Senior Member
 
Registered: Feb 2002
Location: harvard, il
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,233

Rep: Reputation: 406Reputation: 406Reputation: 406Reputation: 406Reputation: 406
you might wanna check out firestarter
http://www.fs-security.com/
this should do what you want
 
Old 02-26-2010, 09:38 PM   #6
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Original Poster
Rep: Reputation: 198Reputation: 198
Quote:
Originally Posted by jschiwal View Post
If you act as a dhcp server and perform NAT masquerading for any hosts on the lan, additional hosts added to the lan simply need to opt to use DHCP to configure their devices. I can't imagine anything easier than that. For many distro's this is just a matter of selecting that you want to share your internet connection in a network device configuration wizard. IMHO, bridging is the wrong method to use.

If you have only one interface, then you need to use a virtual NIC device with a LAN address. There is the disadvantage that Internet traffic will be exposed on the switch or wireless LAN.
One possible situation is that an xo (olpc) has access to a mesh network and thus the internet but another computer cannot use the mesh method. The xo also has a wired nic. OR - perhaps it can access a household wireless network and the other computer does not have wifi.

Conceptually, the xo can share its access through the nic.

Its not something that comes up very often, but I have seen it done at a conference where a mac shared its access with several ubuntu computers by acting as a wap.

I concur that it is probably more robustly set up not to use bridging, but to allow each xo to act as a dhcp server - setting up forwarding with ip masquerade in iptables.

This produces the function I'm looking for.

What I was looking for was an existing solution which does this in a manner similar to the mac. For instance, I'd have got what I wanted if a user can click a menu item or a launcher, get a dialog where they select how to share their existing connection, and then the connection is shared.

Its probably not all that hard to impliment - I can probably write it myself. But I don't want to do that if there is already something that works.

firestarter I have seen.

It does do this, and quite a bit more. The process seems fairly complex compared with the mac experience. I could mess about with a couple of laptops here to see what can be leveraged.

For that matter, there are mac users around here - there may be limitations to this connection sharing on the mac I don't know about.

I do recall there are HW limits to using a laptop as a wap. (Some wifi cards do not support this.)
 
  


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
Sharing internet to a Mac from Linux using a crossover cable: is it possible? Blash Linux - Networking 3 12-05-2005 10:57 AM
Sharing internet from Mac to Linux(PC) - Some sort of DNS problem? lloyd_smart Linux - Networking 8 05-18-2005 05:08 PM
Linux internet sharing connection with XP des33 Linux - Networking 2 03-10-2005 07:05 AM
linux internet connection sharing usa1234 Linux - Networking 3 10-29-2004 11:27 AM
Internet Connection Sharing LINUX Please HELP MistroTHX Linux - Networking 2 10-06-2003 03:50 PM

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

All times are GMT -5. The time now is 07:03 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