shareInternet-2.2.6.pet - Puppy as router - bugfix

Configuration wizards, scanners, remote desktop, etc.
Message
Author
potong
Posts: 88
Joined: Fri 06 Mar 2009, 04:01

#61 Post by potong »

Is this the pet for me?

My current configuration is three computers and a network printer connected to a fast ethernet switching hub.
Internet access is normally (well as normal as can be accepted for my phone/isp company) via a Billion ADSL Router which runs DHCP and allocates the computers their IP addresses (the printer has a static address so as to avoid problems with DHCP), the router is attached to the hub too.

Presently the phone lines and thus ADSL as well, are down and so I've reverted to plan B for internet access i.e. GPRS/Edge via a mobile phone.
I log on to the internet on my main puppy 4.3.1 usually on the first available IP address 192.168.1.2 (192.168.1.1 is the router and 192.168.1.50 is the network printer).

When ADSL is up, all the computers can get access to the internet via the router.
But since it's down only I can get access via ppp on my machine: I would like the other machines to have access via my machine.

Also, in order to gain access to the internet via GPRS/Edge I have found I have to bring down my eth0 interface on my puppy machine using

Code: Select all

ifconfig eth0 down
logon to the internet via connections icon and then bring the eth0 back up via

Code: Select all

ifconfig eth0 up
otherwise I can not print to the network printer.
Could someone explain to me why, and how to remedy this situation.
I fumbled around on the router web setup but cannot see an obvious choice.

Lastly, when ADSL is up I allow port forwarding via my router so my friends can access my discs using python and SimpleHTTPServer.
Can I achieve this using this pet?

Sorry for the inordinate length of this post but I'm wary of changing my working setup too much and finding all goes tits up when they get around to fixing the phone lines and ADSL comes back on line.

Potong

p.s. almost forgot: will this also cater for any virtual machines running via VirtualBox on my puppy?

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

#62 Post by gyro »

potong wrote:Is this the pet for me?
I'm not sure if you would consider it to be "the" pet for you, but it can certainly help.

The best that could be achieved with this software is, to switch from ADSL to phone, you would have to:
1) Disconnect the ADSL router from the hub, (mostly to get rid of it's dhcp server).
2) Reconfigure eth0 to have a static IP of 192.168.1.2
3) Establish ppp0 as the Internet interface, using your phone.
4) Run shareInternet.
5) You may need to "repair" the ethernets of the other machines or simply reboot them.

Challanges:
1) Configure iptables in the puppy machine to do the necessary port forwarding. shareInternet has a facility for reading extra iptables rules for just this purpose. It installs a file called "/root/.shareInternet/iptablesExtraRules/serverExample"
2) If the fixed IP for the printer is controlled by the ADSL router, then we would need to find a way to get "dnsmasq" to do the same thing.
3) Changing the configuration of eth0 is a pain in standard puppy 431. That's why I wrote a script called storedNetConfigs, so you can have a dhcp config for eth0 and a static config for eth0 and easily choose which one you want enabled.
potong wrote:Could someone explain to me why, and how to remedy this situation.
It could be a dhcp conflict, but even if it's not, you need to configure eth0 not to use dhcp when you are using puppy as a router.
When the dhcp client (dhcpcd) gets an IP address it also writes a new copy of "/etc/resolv.conf" and a new routing table. This configures the machine to be able to talk to the up-stream network. It's not good to have 2 interfaces doing this at the same time. That's why it's a simple rule of thumb for routers, use dhcp on the up-stream interface, use static on the down-stream interface(s).
potong wrote:will this also cater for any virtual machines running via VirtualBox on my puppy?
I'm not sure, hopefully they will send a dhcp request onto the ethernet and get a response from eth0 as 192.168.1.2.

gyro

NOTE: if you want a copy of storedNetConfigs, I will upload a new one, since I've made a few cosmetic changes since the last version I published.

potong
Posts: 88
Joined: Fri 06 Mar 2009, 04:01

#63 Post by potong »

Thanks Gyro

There's a lot to assimilate here, perhaps I'll make my three computers all static IP addresses and remove the DHCP problem from the equation.
I did this with the network printer (the printer IP address is static set by the printers web interface).
This would also mean I can just disconnect the router until such time that the phone engineers get around to replacing the stolen line.
So all I need to do then is fix the shared internet.
I'm just having a gander at dnsmasq now, I'm afraid my knowledge of networking is woeful but I'll get there eventually.
Thank again for the detailed reply

Potong

p.s. please do update your storedNetConfigs pet I'll download and study it

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

#64 Post by gyro »

potong wrote:perhaps I'll make my three computers all static IP addresses and remove the DHCP problem from the equation.
Remember that dhcp does more than just provide IP addresses, it also provides DNS server IP's and the gateway IP.
I would go for a dhcp solution wherever possible, for a network that changes. Then you can just plug in a new client machine and it just works, (except for entering the password for a WAP2 wireless network). Also after a network rearrangement, the worst you have to do to a client is reboot.
potong wrote:I'm just having a gander at dnsmasq now
If you use shareInternet there's no need to configure dnsmasq yourself, since the static IP for your printer is not controlled by your current dhcp server.

gyro

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

#65 Post by gyro »

See http://www.murga-linux.com/puppy/viewtopic.php?t=37468 for latest storedNetConfigs.

gyro

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

#66 Post by alienx2 »

gyro wrote:
alienx2 wrote:so is there automatic?
Yes, its called "dhcpcd".
But the version of "dhcpcd" that's in the puppy you are using, doesn't seem to be working correctly in your situation.

I have compiled a newer version for puppy 431, see http://www.murga-linux.com/puppy/viewtopic.php?t=51424

gyro
but dhcpcd 5 still not work... :(

im currently using puppy linux "lucid" 5.00...

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

#67 Post by gyro »

alienx2 wrote:but dhcpcd 5 still not work... :(

im currently using puppy linux "lucid" 5.00...
Sorry, but I'm all out of guesses.
If the work around script that restarts dhcpcd every 15 minutes, still works for you, then this reinforces my suspicion that this is a dhcpcd problem.
If it is a dhcpcd problem, then if you don't run shareInternet, don't run the dhcpcd work around script, and just leave puppy running as a client machine connected to the Internet, the problem should still occur.

To begin working towards a solution for a dhcpcd problem, would require you to find a way to get the puppy you are running to run dhcpcd with the "-d" option and reporting all the dhcpcd messages in /var/log/messages. Unfortunately such an enterprise is more appropriately done in the thread for the puppy you are running, rather than here. If there is a problem with dhcpcd, it deserves to be brought to the attention of a wider audience than just those interested in shareInternet.

If you do decide to pursue the issue, by reporting the dhcpcd log messages. Please post here, a link to the thread you report in. I would be interested in seeing them, since dhcpcd is supposed to just work.

gyro

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

#68 Post by alienx2 »

gyro wrote:
alienx2 wrote:but dhcpcd 5 still not work... :(

im currently using puppy linux "lucid" 5.00...
Sorry, but I'm all out of guesses.
If the work around script that restarts dhcpcd every 15 minutes, still works for you, then this reinforces my suspicion that this is a dhcpcd problem.
If it is a dhcpcd problem, then if you don't run shareInternet, don't run the dhcpcd work around script, and just leave puppy running as a client machine connected to the Internet, the problem should still occur.

To begin working towards a solution for a dhcpcd problem, would require you to find a way to get the puppy you are running to run dhcpcd with the "-d" option and reporting all the dhcpcd messages in /var/log/messages. Unfortunately such an enterprise is more appropriately done in the thread for the puppy you are running, rather than here. If there is a problem with dhcpcd, it deserves to be brought to the attention of a wider audience than just those interested in shareInternet.

If you do decide to pursue the issue, by reporting the dhcpcd log messages. Please post here, a link to the thread you report in. I would be interested in seeing them, since dhcpcd is supposed to just work.

gyro
i prefer script is working for me :) anyway, thank you very much for making this work :)

Atle
Posts: 596
Joined: Wed 19 Nov 2008, 12:38
Location: Oslo, Norway
Contact:

#69 Post by Atle »

Wow... This script is fabulous. It should be integrated in the next release of Puppy. Its to me such a time saver and a fantastic tool that makes my life so much easier. I cant thank you enough for doing this work Gyro.

Before i was transferring files and what what what, using a USB memostick.

Or i even had to boot a Live Fedora 12, as i found this to be the only distro that makes internet sharing easy and possible for newbees...

This little Pet of your took me from a life in misery and made me nothing less than KING OF NETWORKS in Africa. I shall toast and honor you at the bar tonight...

Cheers:-)

cthisbear
Posts: 4422
Joined: Sun 29 Jan 2006, 22:07
Location: Sydney Australia

#70 Post by cthisbear »

" KING OF NETWORKS in Africa.

I shall toast and honor you at the bar tonight... "

Always nice to see a happy poster.

Chris.

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

#71 Post by gyro »

Atle wrote:Wow... This script is fabulous. It should be integrated in the next release of Puppy. Its to me such a time saver and a fantastic tool that makes my life so much easier. I cant thank you enough for doing this work Gyro.
Thank you very much, Atle. I'm glad someone is getting some use out of some the stuff I publish on this forum from time to time.

gyro

PS: I'm on holiday's at the moment so not very active on the forum.

User avatar
plankenstein
Posts: 120
Joined: Sun 16 Nov 2008, 00:49
Location: Arkansas, USA

#72 Post by plankenstein »

Just a quick THANK YOU! This wonderful pet has made me the hero of our house. You've done a great job, and I now have another name to add to my list of puppy heroes. :D "All hail gyro!" (At least those who want/need to use puppy as a router.) :lol:
I carefully plan ALL my random acts! :lol:

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

#73 Post by gyro »

plankenstein,

Thanks.

gyro

Unreal.2K7
Posts: 2
Joined: Tue 01 Feb 2011, 18:22

#74 Post by Unreal.2K7 »

Hello everyone. Bringing up this thread because i think my problem might belong here since it has to do with the shareInternet program. I apologize if this is not where it should belong.

First of all, i whish to thank gyro for having dedicated time to this nice tool.
I'm happy to see that others managed to set it up correctly, so i think i must be missing some steps to make it work too.


My network is the following:

Code: Select all

Internet -> 4 Port ethernet router -> Windows PC
                                   -> Ethernet Switch -> Windows PC
                                                      -> Windows PC
                                                      -> Network Storage
                                                      -> Lucid Puppy Server (Version: lupu-520   Kernel: 2.6.33.2)
Note: all the connections listed above are wired (ethernet 10/100). They all are in the 192.168.1.x subnet, gateway is at x=254.

My puppy server has an usb WiFi dongle which i would like to use to create a wifi access point to share internet to my smartphone.
The device is listed in the Puppy Network Wizard as ZyDAS USB 2.0 WLAN, and it's loaded with the zd1211rw module.
The usb wifi key was previously installed on a windows machine and shared the internet from there. Now i would like to move it to the server now to provide 24/7 uptime to the AP.

What i tried to do:

I installed the shareInternet package and launched the icon from my-roxapps. It told me that i didn't have two active connections. I read the manual and understood that in order to make it work i must set a static ip (on a different subnet) for the wlan interface and no gateway nor dns for it.

I did so and configured wlan to have ip 10.0.10.1 (gateway and dns set to 0.0.0.0 on that interface) and restarted the tool. This time it was happy and a green circle popped on it after it was finished.

The issue:

When i went to my phone and searched for the network it couldn't find it.

Now i wonder: if this tool was to share internet from the ethernet to the wlan by creating an access point, shouldn't it ask me for a SSID network name and eventually which encryption method i want and a password? It didn't ask me anything. What am i missing here?

Thanks for your patience with me :)

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

#75 Post by gyro »

Unreal.2K7 wrote:What am i missing here?
Sorry, I've been away.

What you're missing is that while puppy linux can connect to an AccessPoint it can't be one. (I would dearly love someone to show me I'm wrong by indicating how to do it.) I think that it's related to the wi-fi drivers/hardware.

gyro

Unreal.2K7
Posts: 2
Joined: Tue 01 Feb 2011, 18:22

#76 Post by Unreal.2K7 »

Well, thanks anyway. I managed to solve the problem by installing an hardware Access Point on my network.

walrus
Posts: 2
Joined: Fri 24 Jun 2011, 00:02

#77 Post by walrus »

hello,
thanks for this program! i have it doing 95% of what i need :-) but i have some slight issues, and im not sure if it is with the program per se, or because i am a noob at iptables.

my setup is as follows

Code: Select all

internet----->wireless router-------->laptop running puppy --->server
where the laptop connects to the router over wifi, and is crossover cabled to the server.

basically, i want the laptop to relay everything from the server to the router and vice versa, except port 5900 so i can vnc into the laptop to make changes as needed. the iptables firewall is just in the way other than for that purpose. i dont need the security behind the router already, and i would rather deal with the port forwarding only there.

i thought i had fixed this by port forwarding every port besides 5900 from the laptop to the server with something like:

Code: Select all

iptables -I FORWARD 1 -d [server IP] -o eth0-j ACCEPT
iptables -t nat -A PREROUTING -p tcp -d [laptop wifi ip] --dport 1:5899 -j DNAT --to [server ip]:1-5899
(another set that runs ports from 5901-65535, and both of those repeated for udp)
just to be sure, i also set the default policy for all chains to ACCEPT, and removed the DROP statements at the end of each chain.

this seems to do an ok job. from outside (over the internet) i can connect to the server with RDP, and my web pages are available again (yay!). i also can vnc into the puppy laptop. i cannot however access the server via ftp, nor can the server UPNP ports on my router. i have a vpn software called hamachi that relies on opening up random udp ports, and they never make it to the router. in fact, when i am on another machine on my routers lan, i STILL cannot connect directly to the server. (it gets relayed to a server that himachi runs as a backup)

the only time these problems occur is when i have screwed up the networking in the past. i am suspect of the job i did, or perhaps there is an issue with the "double nat" i dont know. any help or hints would be much appreciated.

thanks
walrus

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

#78 Post by gyro »

Sorry for not replying sooner, I've been away.
walrus wrote:when i am on another machine on my routers lan, i STILL cannot connect directly to the server.
NAT causes a problem with access from the local Lan, but it can be fixed with a couple of rules in iptables. Unfortunately I can't remember them right now, so I will do a bit of research and reply again.

In the mean time, a question:
Which iptables rules did you change?

gyro

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

#79 Post by gyro »

walrus,

Just two things:

1) To access the server from the internet, use the Internet IP address of wireless router.
To access the server from the local lan, use the local lan IP address of the laptop running puppy.

2) To use the firewall built into shareInternet:
Download the attached file and extract the single file "aDedicatedServer".
Edit the file and replace "10.10.10.10" in the line:

Code: Select all

SERVER_IP=10.10.10.10
with the actual IP address of your server.
Copy the file into the directory "/root/.shareInternet/iptablesExtraRules/"
Run shareInternet.

gyro

EDIT: uploaded new version of file, this should be correct one.
Attachments
aDedicatedServer.gz
extra iptables rules for your server - version 2
(234 Bytes) Downloaded 1214 times

kidsafighting
Posts: 6
Joined: Wed 11 Jun 2008, 17:01

Thanks for all your work

#80 Post by kidsafighting »

I just wanted to say thanks for developing this pet. I had a p4, 256meg ram. wifi laptop with a bad hard drive controller. I was not sure what to do with it.
An old 512meg flash drive, puppy 5.1 and this program brought it back to life as a wireless router that I use for a lan connection for desktops I work on.
Excellent work and many thanks.

Post Reply