shareInternet-2.2.6.pet - Puppy as router - bugfix

Configuration wizards, scanners, remote desktop, etc.
Post Reply
Message
Author
User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#16 Post by 01micko »

Hey gyro

SMB (Pnethood) is working fine.

Only native file sharing is broken (scanning) I'll test manually.
Puppy Linux Blog - contact me for access

jaymac407
Posts: 2
Joined: Sun 01 Feb 2009, 18:16

#17 Post by jaymac407 »

Is it possible to do port routing?

For example, Puppy's Internet IP is 192.168.1.2 and I want it to forward port 8080 to 192.168.3.2 (My computer's IP by Puppy)

Is this possible?


THX!

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#18 Post by 01micko »

01micko wrote:
Only native file sharing is broken (scanning) I'll test manually.
Yep, fine manually. I can put up with that! The pros far outweigh the cons...
Puppy Linux Blog - contact me for access

gyro
Posts: 1798
Joined: Tue 28 Oct 2008, 21:35
Location: Brisbane, Australia

#19 Post by gyro »

jaymac407 wrote:Is it possible to do port routing?
Yes.
Use the "iptables" utility to add extra functionality to the firewall. Google "iptables".

gyro

gyro
Posts: 1798
Joined: Tue 28 Oct 2008, 21:35
Location: Brisbane, Australia

#20 Post by gyro »

jaymac407 wrote:For example, Puppy's Internet IP is 192.168.1.2 and I want it to forward port 8080 to 192.168.3.2 (My computer's IP by Puppy)
Try something like the following:

Code: Select all

iptables -A PREROUTING -t nat -p tcp -d 192.168.1.2 --dport 8080 -j DNAT --to 192.168.3.2:8080
iptables -I FORWARD 2 -p tcp -d 192.168.3.2 --dport 8080 -o ${INSIDE_DEVICE} -j ACCEPT
# This rule helps the "I can't reach my web server from the inside" problem.
#iptables -A POSTROUTING -t nat -p tcp -d 192.168.3.2 --dport 80 -s 192.168.3.0/255.255.255.0 -j SNAT --to 192.168.1.2
You woud need to replace "${INSIDE_DEVICE}" with the name of you inside interface, e.g. eth1
Or you could just omit "-o ${INSIDE_DEVICE}" from the second line.

Note: The above is based on code from the "floppyfw" project.

gyro

User avatar
ecomoney
Posts: 2178
Joined: Fri 25 Nov 2005, 07:00
Location: Lincolnshire, England
Contact:

#21 Post by ecomoney »

Internet connection sharing has been a "holy grail" for many people for quite some time. This actually seemed promising because it had a gui, and it said it works with wireless, but it seems to lack instructions. I tried for two hours without success to get it to "work". Gyro, if you know how to do this, its only half the story, actually making it work easily is the rest!

I wanted to forward an internet connection from my wireless adaptor (wlan0) on my laptop out of the ethernet port. I was using a crossover ethernet cable to attach from the laptop to the computer it was being shared to, but I suppose I could have used a switch, router and normal cables. On the host computer I want to be able to attach easily, preferably via dhcp (autodetect through the network wizard).

Would you post step by step instructions on how to do this? Including how to get the interfaces "up" (cant they be brought "up" automatically via the program?).

The other use for this program would to be able to effectively turn the puppy p.c. into a wireless router, taking a wired ethernet internet connection and turning into a wireless "hotspot" that clients can connect to via dhcp. This would add a major blindspot in puppy's current useability, that would take very little space.

If this were made simple and easy, I for one would push very hard for its inclusion in mainstream puppy linux. Thank you for your work so far.

Ecomoney
Puppy Linux's [url=http://www.murga-linux.com/puppy/viewtopic.php?p=296352#296352]Mission[/url]

Sorry, my server is down atm!

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#22 Post by 01micko »

Rob,
I think this may be a case of RTFM! There is a readme.

I connected my old 486 thru my machine which is on my wireless network easily. Your machine with the 2 interfaces, assign a static IP to the ethernet interface, then try.

Cheers

Mick
Puppy Linux Blog - contact me for access

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#23 Post by 01micko »

Rob

I just installed shareinternet on my 4.2 machine and am now posting on my 486. The slowest part was waiting for the 486 :) .
Step by step
1) Install shareinternet, don't touch it!
2)Go to internet wizard, choose LAN, eth0 (or whatever your ethernet card is)
3) configure a static IP of 192.168.x .1 making sure x is differrent from the wireless interface, subnet 255.255.255.0, ALL OTHER FIELDS BLANK.
3)Save
4) click on ~/MyRoxApps/Shareinternet. A box will pop up. Choose the wireless interface, a big green dot will appear on the icon. Do not try to configure a firewall or anything.
5) On the client machine, run network wizard as usual, choose automatic IP and you are done!

Cheers.

Mick
Puppy Linux Blog - contact me for access

User avatar
ecomoney
Posts: 2178
Joined: Fri 25 Nov 2005, 07:00
Location: Lincolnshire, England
Contact:

#24 Post by ecomoney »

I have found the holy grail!!!!

Many thanks Micko, you have succeeded in showing me something I have been trying to achieve for years.

I assumed I would have to set up my wireless connection first, which is open and able to connect via dhcp. I chose a static i.p. of 192.168.2.1 for my ethernet, as my wireless (wlan0) was given 192.168.1.12. I also had to right click the shareInternet icon in /root/my-roxapps which brought up a right-click menu...this is where I found the manual (the readme file), and also the "configure sharing internet" option which brought up the dialog box. I was a bit confused here, so I guessed and chose the "wlan0_eth0" option...and I must have guess right.

I read the readme file...once I found it.....for a bit, but it made my head spin. Do we really expect new linux users to wade through that, when the operation is so much simpler in Windows? Dont get me wrong...this is the only thing that works for puppy I have seen in 4 years of using it (including the built in puppy firewall wizard, which says it can share the internet but doesnt), so I am grateful at least for that.

Its possible to tell via the thread hit rankings what a popular feature this would be if puppy included it. Because I havnt (until now Micko) found a definitive solution I can only assume a lot of people (like me) decided it was impossible and either switched distro, or went out and bought a £50 router.

It there a way that this program could detect if an internet connection was already set up, and via which interface? It could then find out what I.P address number the x in 192.168.x.1 was (see above) and increment it by 1, and set up the outbound port with a static ip automatically?

Also how would I use this to work the other way around, i.e. connect to the modem via a ethernet cable, and create a wireless hotspot using a common garden usb wireless adaptor (I believe this is call a "peer-to-peer" wireless network) that could be attached to via a laptop with built in wireless or a pcmcia or usb adaptor? I darnt touch the current setup in case I cant get it working again.

This would make so much "old junk" so much more useable, and save a lot of people money if it worked easily.
Puppy Linux's [url=http://www.murga-linux.com/puppy/viewtopic.php?p=296352#296352]Mission[/url]

Sorry, my server is down atm!

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#25 Post by 01micko »

Hey Rob

Glad you got her going!
t there a way that this program could detect if an internet connection was already set up, and via which interface? It could then find out what I.P address number the x in 192.168.x.1 was (see above) and increment it by 1, and set up the outbound port with a static ip automatically?
Well a fairly simple script should do itm I might even do that as a side project, and my buddy Trio will surely help!
Also how would I use this to work the other way around, i.e. connect to the modem via a ethernet cable, and create a wireless hotspot using a common garden usb wireless adaptor (I believe this is call a "peer-to-peer" wireless network) that could be attached to via a laptop with built in wireless or a pcmcia or usb adaptor? I darnt touch the current setup in case I cant get it working again.
Easy, exactly the same way... The one you click is your connection to the internet.... no matter the signal source. Even better, you don't have a peer to peer network, you have a router, an address assigning router with dhcp server, neat eh? Theoretically you could piggy back unlimited networks!

Cheers
Puppy Linux Blog - contact me for access

User avatar
ecomoney
Posts: 2178
Joined: Fri 25 Nov 2005, 07:00
Location: Lincolnshire, England
Contact:

#26 Post by ecomoney »


PostPosted: Today, at 6:36 am Post subject:
Hey Rob

Glad you got her going!
Quote:
t there a way that this program could detect if an internet connection was already set up, and via which interface? It could then find out what I.P address number the x in 192.168.x.1 was (see above) and increment it by 1, and set up the outbound port with a static ip automatically?


Well a fairly simple script should do itm I might even do that as a side project, and my buddy Trio will surely help!
That is good to know, and if you have the skills it would be a very worthwhile use of your time. Perhaps also when the icon is clicked upon, it might run a quick test to see if there is internet connectivity already present ("ping www.google.co.uk"?), and if not offer to run the internet connection wizard to set it up ("exec /usr/sbin/net-setup.sh"...see I am not a total "noob", although I may feel it sometimes.) Clicking the icon again would then show a list of ports (minus the one that the web was currently connected by) that the user would wish to share out the connection via. If this were a list of interfaces in the machine, with a tick box next to each one, then it would be possible to to share the internet from a wireless (or cable) to any number of wired and wireless interfaces....so this could make puppy into a wireless repeater too.....am I getting ahead of myself here? I have wanted a skilled coder to address this for so long. :oops:

I hope you get the picture, it offers so many more possiblities for reuse. Many thanks for your help micko.
Puppy Linux's [url=http://www.murga-linux.com/puppy/viewtopic.php?p=296352#296352]Mission[/url]

Sorry, my server is down atm!

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#27 Post by 01micko »

I'm not much of a coder! :lol: But we are Puppy! I'll write a basic script with gui over the next week or two including your suggestions (they were on my mind anyway :wink: ) and when I get something going, I'll start a thread, maybe even gyro will jump on board. I'm sure more devs will come on board, that's how it works around here! :)

How about "PInternet-Sharing"? hehe!

Cheers
Puppy Linux Blog - contact me for access

gyro
Posts: 1798
Joined: Tue 28 Oct 2008, 21:35
Location: Brisbane, Australia

#28 Post by gyro »

Hi,

Sorry for the absence, I thought I had been keeping an eye on things, but obviously not.

ShareInternet doesn't attempt to touch the interfaces, since it's designed to work with any two interfaces in any direction. So it looks for any two useful interfaces, either ppp0 or interfaces with ethernet encapsulation. Once it has found two and only two active interfaces, it asks the user to say which one is the "internet/upstream" one. The easiest way to be agnostic about which interfaces to use, is to do nothing until two are provided.
When it's starting it attempts to guess which configuration to use based on the two interfaces provided. In my machine I have "ppp0_eth0" and "ppp0_wlan0" configured. I bring up either the ethernet or wireless interface with a static definition, then attach my 3G mobile phone, and "dial" to produce ppp0, then start ShareInternet, and it automatically chooses the appropriate config to use.

Process:
1) Using the network wizard, get your upstream/internet interface active using dhcp.
2) Using the network wizard, get you downstream interface active using a static configuration.
3) Run ShareInternet.
4) If it asks you which interface is the Internet one, click on the interface you setup in 1)

Actually attempting to guess which is the Internet interface, could try the following:
a) If ppp0 is one of the interfaces, then it is most likely the Internet one.
b) The interface that connects to the network that contains the default gateway, is very most likely the Internet interface. This should be discern-able from the output from " iproute | grep default | cut -d' ' -f5".
Hm, if the above two rules do not produce the correct result, then there's a good chance that the configuration won't work anyway.

Interesting, thanks for stimulating this idea.
I'll look at a new version of ShareInternet that implements a) and b) above. I'll most likely chuck out the whole concept of storing configurations altogether, including the configuration dialog. ShareInternet will just keep on complaining, with hopefully meaningful error messages, until it gets two interfaces that should work. Doing a "ping" to a well known server might be the final test.
I'll get to it as soon as I've gotten my current project to a working version.
But I have no intention of ShareInternet actually controlling any interfaces. The Puppy network wizard, plus rc.network, plus "StoredNetConfigs" should provide all that's necessary to manage the interfaces.

Producing good documentation is always the hardest part.

gyro

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#29 Post by 01micko »

gyro,

Thanks for your response mate.

What ecomoney wants and what I reckon can be done with some good bash should give puppy a good reliable ICS alternative.

Cheers

Mick
Puppy Linux Blog - contact me for access

User avatar
ecomoney
Posts: 2178
Joined: Fri 25 Nov 2005, 07:00
Location: Lincolnshire, England
Contact:

#30 Post by ecomoney »

What ecomoney wants
It isnt just me I assure you! This has been one of the most asked for requests by new users on the forum.

Like I say, if the program were to check for internet connectivity to start with, it could pretty much guess at the interface that the internet connection was needed to be served out via. If there was no connectivity then it would start the internet connection wizard.

If the "outgoing" interface was a wireless device (I dont know how this is checked for, but the current internet connection wizard has code for it), then an additional dialog would be needed for the user to insert wireless parameters (SSID, possibly encryption etc) to create the "hotspot". I cant see anyone wanting to "dish out" their internet connection, from whatever source, by any other method than either an ethernet port or a wireless device.

I know "incoming" and outgoing dont "technically" apply, but they help describe the process. :-)
But I have no intention of ShareInternet actually controlling any interfaces. The Puppy network wizard, plus rc.network, plus "StoredNetConfigs" should provide all that's necessary to manage the interfaces.
On a technical level your completely correct Gyro (thanks for looking over this), but "isnt working" and "cant be got to work without spending hours RTFM'ing" will amount to the same thing for people without your level of networking knowledge. To be useable it needs to be simple, and just do the work in the background, how it does that could be in the readme if people are interested. It should bring all the interfaces up and assign i.p. automagically, so people can *just get their computer working* and read about the details when they have to.

Like I say, this is a huge blindspot in functionality in the current puppy linux, and has been for some time.....you wouldnt want 100mb puppy not to be able to do something as easily a windows would you?? :twisted: :wink:
Puppy Linux's [url=http://www.murga-linux.com/puppy/viewtopic.php?p=296352#296352]Mission[/url]

Sorry, my server is down atm!

User avatar
ttuuxxx
Posts: 11171
Joined: Sat 05 May 2007, 10:00
Location: Ontario Canada,Sydney Australia
Contact:

#31 Post by ttuuxxx »

ecomoney wrote:you?? :twisted: :wink:
Its always best say get a wack of used company / school / government pc's if your going to say setup a internet cafe, that way they are all the same make models, cards etc. Thats a real ideal situation where you could basically have a large hub and have them all wired together, with a remastered puppy cd with the internet settings already saved on it, Then you just do a ghost image and boom 30 pc's all up and running on 2 hubs. in like 3-4mins using a server. In college when I took networking management thats what we used to do every morning using server 2003 and Nortons Ghost, we did try linux type ghosting, but at the time Nortons Ghost was the only one which could do windows and linux, since we were using fedora, ubuntu, linux mint, puppy, what ever I would bring in that day. The thing about Nortons Ghost you could make images for different machines, and just call them out, a full xp installl with office was about 20mins, and you would just boot up using a floppy disk do a few clicks and then it was set.
anyways thats my 2c

ttuuxxx
http://audio.online-convert.com/ <-- excellent site
http://samples.mplayerhq.hu/A-codecs/ <-- Codec Test Files
http://html5games.com/ <-- excellent HTML5 games :)

User avatar
ecomoney
Posts: 2178
Joined: Fri 25 Nov 2005, 07:00
Location: Lincolnshire, England
Contact:

#32 Post by ecomoney »

You did a network management course at college?

Im not surprised you had to reinstall windows every day, probably the safest bet.. :lol:
Puppy Linux's [url=http://www.murga-linux.com/puppy/viewtopic.php?p=296352#296352]Mission[/url]

Sorry, my server is down atm!

User avatar
ttuuxxx
Posts: 11171
Joined: Sat 05 May 2007, 10:00
Location: Ontario Canada,Sydney Australia
Contact:

#33 Post by ttuuxxx »

ecomoney wrote:You did a network management course at college?

Im not surprised you had to reinstall windows every day, probably the safest bet.. :lol:
Yes I spent 3 Yrs doing I.T full time, due to the fact I had Visa issues for Australia, So the First Year I took Network management, and the Second and 3rd year I took Web development/ management diploma.
ttuuxxx
http://audio.online-convert.com/ <-- excellent site
http://samples.mplayerhq.hu/A-codecs/ <-- Codec Test Files
http://html5games.com/ <-- excellent HTML5 games :)

gyro
Posts: 1798
Joined: Tue 28 Oct 2008, 21:35
Location: Brisbane, Australia

Re: ICS lookalike for Puppy

#34 Post by gyro »

01micko, ecomoney,

a) Puppy already has utilities to manage and automatically activate interfaces.

b) I have just re-written ShareInternet as v2.0, (done proof of concept testing, but needs more testing, expect release in a couple of days.)
The thing about v2.0 is that given 2 or more, appropriately configured, active interfaces it does it's thing automatically. No more questions. No more stored configs. No more configuration dialog. Just "UP" a few interfaces, and run it. The interfaces can be any combination of ethernet, wifi, and upto one ppp0.

Given that, I would humbly suggest that to produce an ICS equivalent, you might look at producing a wizard that does the following:
1) Sends them into the Puppy network wizard to setup the Internet interface using dhcp.
2) Sends them into the Puppy network wizard to setup the local interface statically.
3) runs ShareInternet v2.0

Enhancements:
1) Create a customised version of the network wizard for step 2), that only shows "IP address" and "Network Mask", and both these already filled with default values "10.10.1.1" and "255.255.255.0". No confusing extra fields, and make it accept the above without complaint.
2) Nice if step 3) also provides them with an option to automatically run ShareInternet at boot time.
3) Create a customised version of the network wizard for step 1) e.g. automatically uses dhcp.
4) Further customise network wizard for step 2) so that it provides an oportunity to loop to define more than one local interface. (The second time round the loop the IP address would be "10.10.2.1" etc...)

You might consider making a single pet that contains the ShareInternet files as well as the new wizard stuff.

Have fun!

gyro

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#35 Post by 01micko »

gyro

Thanks for that info... I was leaning toward that approach.

I will not start anything until V2.0 is available. Looking forward to it. :wink:

Mick
Puppy Linux Blog - contact me for access

Post Reply