shareInternet-2.2.6.pet - Puppy as router - bugfix

Configuration wizards, scanners, remote desktop, etc.
Message
Author
gyro
Posts: 1798
Joined: Tue 28 Oct 2008, 21:35
Location: Brisbane, Australia

Re: I can connect the devices, but not the Internet

#121 Post by gyro »

MyPuppysaysWauWau wrote:iptables v1.4.12: can't initialize iptables table `nat': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
You probably need to "insmod" one or more of the nat modules in "kernel/net/ipv4/netfilter"

Edit:
Might be better to use "modprobe" instead of "insmod".

Edit2:
Try "modprobe -v iptable_nat"

gyro

User avatar
MyPuppysaysWauWau
Posts: 162
Joined: Thu 20 Feb 2014, 10:12
Location: Austria/Vienna

Re: I can connect the devices, but not the Internet

#122 Post by MyPuppysaysWauWau »

gyro wrote: Try "modprobe -v iptable_nat"

gyro
Thx :)

But I got the message: "FATAL: Module iptable_nat not found"
[size=100][color=darkblue][b]Don't[/b] start because it's [i]easy.[/i] [b]Start[/b] because it's [i]worth trying[/i]. [b]Don't [/b]stop because it's [i]hard[/i]. [b]Stop[/b] because you tried your [i]Best[/i].[/color][/size]

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

Re: I can connect the devices, but not the Internet

#123 Post by gyro »

MyPuppysaysWauWau wrote:But I got the message: "FATAL: Module iptable_nat not found"
Yep, the kernel modules in precise 5.7.1 are rather different than those in tahrpup 6.0.2.
But it's worse, i couldn't find any nat module at all. Then I found a possible explanation, the configuration file for the kernel compile conatins the following line:

Code: Select all

# CONFIG_NF_NAT_IPV4 is not set
This means that nat support is not compiled into the kernel.
So looks like no go without a kernel compile.

gyro

User avatar
MyPuppysaysWauWau
Posts: 162
Joined: Thu 20 Feb 2014, 10:12
Location: Austria/Vienna

#124 Post by MyPuppysaysWauWau »

Gyro, I don't need Wifi often... only for upgrading my Tablet, or for a new app. Shall I make a dual boot with tahrpup? What do you think?

If yes, which "extras" do I need for a wifi routing e.g. ap-hotspot?
[size=100][color=darkblue][b]Don't[/b] start because it's [i]easy.[/i] [b]Start[/b] because it's [i]worth trying[/i]. [b]Don't [/b]stop because it's [i]hard[/i]. [b]Stop[/b] because you tried your [i]Best[/i].[/color][/size]

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

download Slacko 5.6-4G

#125 Post by gyro »

8Geee wrote:Is there a link/pet/DL for that particular version? TIA
Try http://distro.ibiblio.org/puppylinux/puppy-5.6/ or http://ftp.nluug.nl/ftp/pub/os/Linux/di ... puppy-5.6/

gyro

watchdog
Posts: 2021
Joined: Fri 28 Sep 2012, 18:04
Location: Italy

#126 Post by watchdog »

@8Geee

The following thread may help:

http://www.murga-linux.com/puppy/viewto ... e3f3789a83

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

#127 Post by gyro »

MyPuppysaysWauWau wrote:Gyro, I don't need Wifi often... only for upgrading my Tablet, or for a new app. Shall I make a dual boot with tahrpup? What do you think?

If yes, which "extras" do I need for a wifi routing e.g. ap-hotspot?
I have no idea if Shareinternet will work in Tahrpup 6.0.2, and I don't have a hardware setup to test it.
But even if it did work it only does the router bit, it won't create a wi-fi access point. You would have to use it in conjunction with something like hostapd, http://www.murga-linux.com/puppy/viewtopic.php?t=87584. And again, I have not tried to do this.

It might be an idea to try ap-hotspot with a frugal install of Tahrpup 6.0.2 without Shareinternet. ap-hotspot + hostapd is supposed to do the whole thing.

gyro

Bindee

#128 Post by Bindee »

* removed *
Last edited by Bindee on Thu 14 May 2015, 22:34, edited 1 time in total.

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

#129 Post by gyro »

Bindee wrote:These run a version of Debian so i don't know if you could run Puppy Router on it ?
Why would you bother?
You buy a little router box, it works, just use it.

When I wrote this script, I used it on an eeePC to provide Internet to 2 laptops when traveling.
These days, when traveling, I use a cell based "Pocket WiFi" to provide my own wifi hotspot wherever I have a cell signal.
And for all my other routing needs, I just buy an appropriate little box.

gyro

Bindee

#130 Post by Bindee »

My Bad , I wrongly assumed yours would be a better OS and use less resources.

s243a
Posts: 2580
Joined: Tue 02 Sep 2014, 04:48
Contact:

#131 Post by s243a »

I brought both eth0 wlan0 up and assigned an ip address to eth0 via
ifconfig eth0 192.168.2.2

Running:

Code: Select all

sh -x shareInterent
in directory

Code: Select all

/root/my-applications/shareInternet
produces

Code: Select all

+ BINDIR=/usr/local/shareInternet
+ '[' '' == txt ']'
+ '[' -f /root/.shareInternet/flagFiles/batch_start_running.txt ']'
+ '[' '' ']'
+ '[' -f /root/.shareInternet/flagFiles/sharingup.txt ']'
+ /usr/local/shareInternet/shareInternet start
[ -f /etc/dnsmasq.conf ] && dnsmasq -a "192.168.2.2" -F "192.168.2.100,192.168.2.200,60000" -l "/tmp/dnsmasq.leases.192.168.2"
modprobe: FATAL: Module ipt_MASQUERADE not found.
iptables: No chain/target/match by that name.
+ exit 0
I'm running tahrpup 6.02 and it doesn't apear to have the module ipt_MASQUERADE. How can I get this module for tahrpup 6.02?

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

Use "SNAT" instead of "MASQUERADE"

#132 Post by gyro »

@s243a,

An alternative approach is to stop "shareInternet" using "MASQUERADE" and use "SNAT" instead.

To do this, edit lines 58 and 59 of "/usr/local/shareInternet/firewall.sh". Change this:

Code: Select all

    iptables -t nat -A POSTROUTING -s ${INIP%.*}.0/24 -o ${OUTSIDE_DEVICE} -j MASQUERADE
#    iptables -t nat -A POSTROUTING -s ${INIP%.*}.0/24 -o ${OUTSIDE_DEVICE} -j SNAT --to-source ${OUTSIDE_IP}
to this:

Code: Select all

#    iptables -t nat -A POSTROUTING -s ${INIP%.*}.0/24 -o ${OUTSIDE_DEVICE} -j MASQUERADE
    iptables -t nat -A POSTROUTING -s ${INIP%.*}.0/24 -o ${OUTSIDE_DEVICE} -j SNAT --to-source ${OUTSIDE_IP}
i.e. comment out the "MASQUERADE" line and uncomment the "SNAT" line.

Note: I am unable to test this at this time. So if someone can test this and report back, I will issue a new version containing this patch.

gyro

s243a
Posts: 2580
Joined: Tue 02 Sep 2014, 04:48
Contact:

#133 Post by s243a »

I saved my instructions for a manual start here (also noted above on this thread). I have now commented out the lines given in the instructions on the original thread-noted for startup-on-boot. I presume that somewhere I will have to add to the configuration files commands to bring up eth0 and also to assign an ip address to eth0. I will look through the code to see if I can find an answer but perhaps someone will help me first :)

s243a
Posts: 2580
Joined: Tue 02 Sep 2014, 04:48
Contact:

#134 Post by s243a »

So, as I suspected, making the changes mentioned at:
http://www.users.on.net/~wrags/ShareInternet-2.1.html

to start at boot didn't work because I didn't specify anywhere to bring up eth0 and assign an ip address to eth0. I'll try adding this to one of the mentioned files and see what happens.

Anyway, the following lines seem problematic:

Code: Select all

if [ -f /root/.shareInternet/flagFiles/batch_start_running.txt ]; then
	error "ShareInternet was started at boot - still coming up."
	exit 1
fi
This prevents me from stoping ShareInternet if it fails to load properly on startup. I commented out these lines and tried

Code: Select all

sh -x AppRun stop.
and then when I tried to restart it with

Code: Select all

sh -x AppRun
I still got the error:
"ShareInterent was started at boot - still coming up."

This is because

Code: Select all

sh -x AppRun stop
does not delete the flag file /root/.shareInternet/flagFiles/batch_start_running.txt

The simple fix is to comment out the above mentioned lines. This allowed me to restart ShareInternet. If we were being more complex we could make the script not execute the error when someone gives the input "stop". Also with this more complex fix the flag file should be deleted if it exists when a stop command is given.

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

#135 Post by gyro »

@s243a,

If the flag file is still there, then either there's a 'hung' shareInternet process hanging around, or it crashed.
If you want to carry on any way, why not just delete "/root/.shareInternet/flagFiles/batch_start_running.txt"?

gyro

s243a
Posts: 2580
Joined: Tue 02 Sep 2014, 04:48
Contact:

#136 Post by s243a »

I successfully used this pet to share the internet through a router. I haven't tried connecting multiple computers on it.

I created the following startup script:

Code: Select all

#/usr/bin/sh#www.pearltrees.com/s243a/shareinternet-puppylinux-pet/id15126192
#requires  ipt_MASQUERADE_tahrpup-k3.14.20.pet
#See: murga-linux.com/puppy/viewtopic.php?t=96178&start=1140

ifconfig eth0 up  #Bring the interface up
ifconfig eth0 192.168.2.1 #assign an ip adress to the interface
cd ~/my-applications/shareInternetsh AppRun #Start the Internet Sharing
Running this script returns:

Code: Select all

root# sh Star*
[ -f /etc/dnsmasq.conf ] && dnsmasq -a "192.168.2.1" -F "192.168.2.100,192.168.2.200,60000" -l "/tmp/dnsmasq.leases.192.168.2"
**not sure what this stuff means


On my d-link router I set the internet connection as DHCP which produced:

Code: Select all

IP Address: 	192.168.2.152
Subnet Mask: 	255.255.255.0
Default Gateway: 	192.168.2.1
Primary DNS Server: 	192.168.2.1
Using tahrpup 6.0.5 on the PC which is reciving the shared connection configured the internet as follows:

under
menu/setup/internet connection wizard
selected "Wired or wireless LAN"

And then
Selected the bottom choice (i.e. "Network Wizard")

and than selected "Static IP"

I put in

Code: Select all

IP address = 192.168.2.1
Net Mask = 255.255.255.0
Primary Name Server = 192.168.0.1 (see etc/resolv.conf)
and I think for the gateway I put:

Code: Select all

Default Gateway = 0.0.0.0
which seemed to tell the Network Wizard to find the default gateway for me, which returned

Code: Select all

Default Gateway = 192.168.0.1
I think the gateway is the private ip address of the internet service provider gateway (i.e. that thing they give you to connect to the internet). Perhaps the operating system (or maybe the router) finds this address when it is building the routing table.

User avatar
Moose On The Loose
Posts: 965
Joined: Thu 24 Feb 2011, 14:54

#137 Post by Moose On The Loose »

gyro wrote:
01micko wrote:If I open ~/File-Sharing/Setup-Sharing and choose to find shared folders it only searches on the "192.168.1.x" network.
I've just had a quick look at the script run by ~/File-Sharing/Setup-Sharing. It always looks in the local network defined by the first IP address it finds in the output from "ifconfig". Would need to change the software to do something different.
But even more significantly it is not using Windows folder sharing. It's looking for FTP servers, something completely different. If it's Windows folder sharing you want, then you will need to use "samba" on Puppy.

I've used "samba" on a Fedora 9 machine, but never Puppy.

If you're trying to do Windows folder sharing through a router (puppy7), then I'm not sure there is any chance.

gyro
I use Samba on 528 it works but Windows-7 and up don't. They refuse to even think about an earlier Windows version being on the system and also won't interact with puppy. There is a setting in the registry to fix this.

I also run a web server on a puppy. If you include a local DNS you can have the machines referred to by name. If not, a trick I use is to have the Samba share a file with a link in it using the IP address. This way, a Windows user can find the system with the "network neighborhood" method and then click on a XXX.html file to get the link to the machine via the browser.

This is working around the limitations of Windows and Humans.

Post Reply