shareInternet-2.2.6.pet - Puppy as router - bugfix

Configuration wizards, scanners, remote desktop, etc.
Message
Author
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

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

#36 Post by ecomoney »

Greets Gyro

Please would you explain, from the point of view of someone sat at the screen, how the wizard behaves. For example, What exactly happens if ShareInternet doesnt find two active connections?

What would happen in the case of ShareInternet being run, and one internet interface is already up and configured? Would it then be able to seek out another, possible non-"upped" interface (or offer a choice of several if it finds more than one), and offer to share out the connection to that? Could it even share the internet out to several *at the same time*?

For example, if share internet were to run, and discover an active connection on eth0 already configured via DHCP, but also an unconfigured eth1 and wlan1? Would it offer the choice to share the connection out via either, or both of them? Just one would be fine for a start for sure. Sharing a connection from a mobile phone out via wireless or ethernet would also be a

What happens if ShareInternet finds no active connections at all? Would it then offer to launch the internet connection wizard? One idea...could the existing internet connection sharing wizard have an extra option upon a successful connection to the internet, the share this out via Shareinternet?

You may also wish to point out that to share a connection from one computer with a live connection, to one without a live connection via ethernet, a crossover cable is required.

I think its important to design a feature like this from the User Interface down, rather than from the internal mechanics up. I would be happy to spend a few hours designing the look and logic of the user interface, if you would write the internal code to put underneath it. Ive done a lot this before
Puppy Linux's [url=http://www.murga-linux.com/puppy/viewtopic.php?p=296352#296352]Mission[/url]

Sorry, my server is down atm!

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

Version 2.0

#37 Post by gyro »

01micko,

V2.0 is now available for download. I've updated the original post. I hope that it is useful.

ecomoney,

ShareInternet V2.0 is not a wizard. It's more of a backend that just does things.

If you run it with less than 2 "UP" interfaces, it shows an error message stating this, and exits.
If you run it with 2 interfaces, but no default gateway is defined, it shows an error message, and exits. (Such a configuration wouldn't work anyway.)
If you run it with 3 "UP" interfaces, it will share the one that connects to the default gateway, with the other 2.

ShareInternet uses all the interfaces that are "UP". You control what it does by what interfaces are "UP" and how they are configured. If the Internet/upstream interface is configured with dhcpcd or pppd, and all local/downstream interfaces are statically configured with just an IP address and netmask, then it just works.

I don't use a crossover cable, rather a spare ethernet switch. These tend to be agnostic about which type of cable you use. Also, Puppy won't bring up an ethernet interface unless it is connected to a powered on device on the other end. Since I prefer to setup the router first and then startup the client, plugging Puppy into a powered on ethernet switch is my preferred method.

You, or anyone else, are most welcome to write a wizard/ frontend, and use ShareInternet as a backend.
I use "StoredNetConfigs" to easily control which interfaces are "UP" and how they are configured. This is so that I can quickly turn my laptop into any of the 3 types of router that I sometimes use.
(Share modem over ethernet, share modem over wifi, share local wifi over ethernet.)

Thanks for the stimulation.
I've just realised I should re-write "StoredNetConfigs" so that it works at a higher level, with configs having user defined names like "Ethernet workstation". "Wifi workstation", "Share PPP over ethernet", "Share PPP over wifi" and "Share wifi over ethernet". Ah well another project to keep me off the streets.

gyro

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

#38 Post by ecomoney »

ShareInternet V2.0 is not a wizard. It's more of a backend that just does things.
You, or anyone else, are most welcome to write a wizard/ frontend, and use ShareInternet as a backend.
A wizard really is what is needed, the whole idea of puppy is that it "just works" (see mission statement). However, what your saying is that this is a set of "libraries" that could be called by such a wizard in order to easily set up internet connection sharing for those new to networking? If this is the case would you document the API (Application Programming Interface) when you have completed your own testing, so that a "newb-friendly" front end can be developed from it.

It definitely sounds like ShareInternet 2.0 would be very useful in the further development of this much needed function. Thank you for your work.
Puppy Linux's [url=http://www.murga-linux.com/puppy/viewtopic.php?p=296352#296352]Mission[/url]

Sorry, my server is down atm!

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

#39 Post by gyro »

ecomoney wrote:However, what your saying is that this is a set of "libraries" that could be called by such a wizard in order to easily set up internet connection sharing for those new to networking? If this is the case would you document the API (Application Programming Interface) when you have completed your own testing, so that a "newb-friendly" front end can be developed from it.
No, it's not a library, it has no API. Its a standalone application that you execute once you have configured and activated the network interfaces you want to use in your router.

It doesn't care what software you use to configure the interfaces.
You can do it with the Puppy network wizard + rc.network.
If more flexibility is required you can do it with StoredNetConfigs.
You can write your own script to configure the interfaces using only command line utilities if you really want to do things the hard way.
Or you can write your own GUI to configure and activate the interfaces.

Just somehow get all the required interfaces configured and activated ("UP").
Then, execute ShareInternet to start the router running.
Later when you've finished with routing, click on ShareInternet's icon again, and routing will stop.

gyro

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

Re: ICS lookalike for Puppy

#40 Post by gyro »

01micko,

A snippet of bash code that calculates a static address in the next subnet. Just in case it is useful in presetting the IP address in a customized network wizard for static router local interfaces:

Code: Select all

#!/bin/bash

calcNextIpNet() {
XSNET=${XIP%.*}
XNET=${XSNET%.*}
XNETN=${XSNET##*.}
XNETN=$[XNETN+1]
[ $XNETN -gt 254 ] && XNETN="1"
XIP="$XNET.$XNETN.1"
}

X_IFCE="`iproute | grep default`"
[ "${X_IFCE:(-1)}" == " " ] && X_IFCE=${X_IFCE% *}
X_IFCE=${X_IFCE##* }
XIP=`ifconfig $X_IFCE | grep inet`
XIP=${XIP#*:}
XIP=${XIP%% *}
XSNET=${XIP%.*}
XNET=${XSNET%.*}
[ "$XNET" != "192.168" ] && XIP="192.168.0.1"

calcNextIpNet
echo "$XIP"

calcNextIpNet
echo "$XIP"

exit
Note: The code assumes that the internet interface is already "UP".

Edit: Fixed code so that it works with ppp0 interfaces.
And always uses subnets in 192.168.n.n,

gyro

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

shareInternet-2.2.1 available

#41 Post by gyro »

Changes in shareInternet v2.2.1:
1) Share Internet no longer conflicts with the use of rc.firewall. It uses it's own iptables code based on one of the Linux based software firewalls.
If you run rc.firewall before running shareInternet, everything rc.firewall did will be ignored. Running rc.firewall while shareInternet is running may stop it working, and is not supported.

2) Upgraded the included dnsmasq to v2.51, compiled on pup-431.

gyro

Edit: withdrawn, please use shareInternet v2.2.3, see first post
Last edited by gyro on Sat 12 Jun 2010, 01:43, edited 1 time in total.

alienx2
Posts: 13
Joined: Mon 24 May 2010, 08:16

#42 Post by alienx2 »

<DELETED>

I did solved the problem.... Thanks for made internet connection sharing for puppy...

alienx2
Posts: 13
Joined: Mon 24 May 2010, 08:16

#43 Post by alienx2 »

i got other problem about this software...

every 3-6 hours, other computer got disconnect network from puppy (with this software ICS) then i manual turn off this software then second, turn off then on eth1 (ISP) (like 'ifconfig eth1 [up/down]') then i turn on this software...

then it will work...so is there automatic? im tired of repeat every disconnect... :(

ICS = Internet connection sharing


Thanks. I'll be waiting for reply...

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

#44 Post by gyro »

alienx2 wrote:ICS = Internet connection sharing
Sorry, but I don't understand your setup.
Are you running ICS on a Windows box?
If so, which computer is upstream? (which one actually connects to the Internet?)

gyro

alienx2
Posts: 13
Joined: Mon 24 May 2010, 08:16

#45 Post by alienx2 »

no... i mean this software shareinternet running on puppy linux... im not running internet sharing on windows... windows box is client. only one puppy linux is sharing internet... :)


what i set up network? look at below:

[INTERNET (Motorola SB5100)]<--->[PUPPY LINUX with shareInternet]<--->[Linksys WIFI ROUTER]<--->[WINDOWS (1 PC with wired & 1 PC with Wireless & 3 Handheld wireless)]

but my internet keep always disconnect every 3-6 hours (maybe for new IP address. It's dynamic IP). so i tested with Xubuntu. its really working test 24 hours but i hate all ubuntu for my old computer. because it made my old computer so slow and overload memory and processor. only Puppy Linux can do with my old computer but problem is manual turn off then turn on eth1. that's why that will make conflict with 2 ethernet card after internet disconnect.

P.S. ICS = this software shareInternet... sorry for short word. hehehe...

thanks for responding...

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

#46 Post by gyro »

alienx2,

Thinking about this after my last response, I'm wondering if this is a dhcp problem, since it happens some time later.
(shareInternet only starts things going, and stops things. It doesn't actually run while traffic is flowing.)

That said, can we establish which link dies, when things fail:
Can the puppy machine still talk to the internet?
Can the puppy machine still talk to the Linksys router?

Other questions:
Is the ethernet port on the Puppy machine, that is connected to the Linksys router, defined statically?
Are you using the Linksys router as a router?
Is it running dhcp as a server?
(When I do something similar I plug the puppy machine into one of the client ports of the wireless router, and stop the dhcp server on the router. Effectively using the wireless router as an ethernet switch.)

gyro

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

shareInternet-2.2.2.pet

#47 Post by gyro »

I have attached the current version of shareInternet, 2.2.2.

The only change is a tweak to the iptables firewall rules.

gyro

Edit: withdrawn, please use v2.2.3 as per first post
Last edited by gyro on Sat 12 Jun 2010, 01:45, edited 1 time in total.

alienx2
Posts: 13
Joined: Mon 24 May 2010, 08:16

#48 Post by alienx2 »

gyro wrote:alienx2,

Thinking about this after my last response, I'm wondering if this is a dhcp problem, since it happens some time later.
(shareInternet only starts things going, and stops things. It doesn't actually run while traffic is flowing.)

That said, can we establish which link dies, when things fail:
Can the puppy machine still talk to the internet?
Can the puppy machine still talk to the Linksys router?
Its only one problem is talk to internet... Linksys is working connect to puppy linux (tested with Remote Desktop VNC, FTP)


Is the ethernet port on the Puppy machine, that is connected to the Linksys router, defined statically?
yes. eth0 = static IP to linksys. then eth1 = auto DHCP to internet...
Are you using the Linksys router as a router?
yes but gateway to puppy linux as router.
Is it running dhcp as a server?
only internet have dhcp.

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

#49 Post by gyro »

alienx2 wrote:Its only one problem is talk to internet... Linksys is working connect to puppy linux (tested with Remote Desktop VNC, FTP)
I think you are saying that all links stay up except the link between the Puppy box and the Internet.
Just to be sure, when the problem occurs can the windows box "ping" the puppy box?
If the puppy box is not running as a router, does not run shareInternet, can it maintain the link to the Internet?
alienx2 wrote:only internet have dhcp.
I would be surprised if this were the case.
If you run shareInternet, then it runs "dnsmasq" to provide a dhcp service downstream to the Linkysys router, and SOHO routers usually provide a dhcp service to their clients, in this case the windows box.
I would also suspect that the Linksys expects a dhcp service upstream on the puppy box.

gyro

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

#50 Post by gyro »

alienx2,

Just thought of another couple of questions.

What is the static IP address on eth0 of the puppy box?
What is the IP address of the windows box?

gyro

Post Reply