internet connection sharing between 2 puppylinux computers

Problems and successes with specific brands/models of networking hardware.
Post Reply
Message
Author
CGP
Posts: 100
Joined: Sat 26 Jul 2008, 05:17

internet connection sharing between 2 puppylinux computers

#1 Post by CGP »

Could anyone answer the following question that should have an obvious answer, but does not?

I am using Puppylinux 3.01.

Here is what I want to do:

Internet <===>Puppy Desktop<==crossover ethernet cable==> Puppy Laptop

In other words, I want to share one internet connection between 2 computers (both running Puppylinux) via ethernet ports.

How do I connect the laptop to the desktop? That is, how do I set up the IP addresses for the laptop-to-desktop connection in the Internet Connection Wizard on the Desktop? Same question for the Laptop? Static IP addresses? What IP addresses should I choose?

Thanks.

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#2 Post by mikeb »

Ok I'm assuming you don't have a router as you would not be asking this....

I used static addresses as this avoids setting up dchp.
192.168.1.xxx is a common choice... so in your case say 192.168.1.2 and 192.168.1.3.
As you are using static the laptop will need a nameserver...you should be able to use the address from the sharing machine from /etc/resolv.conf.

the commands to enable internet sharing are

iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE

echo 1 > /proc/sys/net/ipv4/ip_forward

ppp0 may need to be changed depending on your internet connection...ifconfig should help decide what is used or even just from the setup wizard.

If the above works ok then you can add those 2 lines to /etc/rc.d/rc.local

hope that make sense

mike

Master_wrong
Posts: 452
Joined: Thu 20 Mar 2008, 01:48

#3 Post by Master_wrong »

perhaps you can try this...
http://www.linuxforums.org/forum/mandr ... ring.html

it says :

Well, leaving that aside, here is my little "Internet connection sharing tutorial for mandriva":

1. K Menu -> System -> Configuration -> Configure your computer
2. Enter ROOT password
3. Network & Internet -> Set up a network interface


Here you set each of your 2 network adapters as follows:

Adapter connected to main internet cable - settings given to you by your ISP ( IP, Netmask, Gateway, DNS )

Adapter connected to the second PC through a crossover cable:
IP - 192.168.0.1
Netmask - 255.255.255.0
Gateway - 0.0.0.0 (it is very important that you DO NOT leave this field blank; even if Windows assigns 0.0.0.0 automatically for blank entry, I see that Mandriva assigns a wrong address that does't work)

Next, go to "Share internet connection with other local machines" and select the card connected to internet. Then NEXT, a few services have to be installed, you will be asked for installation CDs (not sure which of these services are vital for connection sharing so I installed them all).

Restart linux server

Then set the network adapter on your second PC as follows:

IP - 192.168.0.2
Netmask - 255.255.255.0
gateway - 192.168.0.1
DNS-s given by your ISP
.............
Cluster-Pup v.2-Puppy Beowulf Cluster
[url]http://www.murga-linux.com/puppy/viewtopic.php?p=499199#499199[/url]

CGP
Posts: 100
Joined: Sat 26 Jul 2008, 05:17

#4 Post by CGP »

Mike,

Thanks for the help, but it still doesn't work.

Yes, I found that the Desktop DNS parameters in Internet Connection Wizard were already Primary: 209.18.47.61 and Secondary: 209.18.47.62. And the same numbers were in /etc/resolve.conf on the Desktop. Do I type those IP addresses into the Laptop's Internet Connection Wizard under Static IP in the boxes for DNS parameters?

Do I type in the 'iptables' and 'echo 1 ...' commands on the Desktop or the Laptop? I tried typing them on the Desktop. The commands seemed to work (I got back to the prompt). But the Desktop and Laptop still don't communicate.

I typed the ifconfig command on the Desktop and got 'Eth1' and 'lo' as the names? of the 2 ethernet ports? I am trying to connect to the laptop via the ethernet port called 'eth0' in the Desktop's Internet Connection Wizard. So do I need to change ppp0? to what?

CGP
Posts: 100
Joined: Sat 26 Jul 2008, 05:17

#5 Post by CGP »

Master_Wrong,

Thanks for the help.

I went the URL you provided. The discussion is so hard to decypher that I will try to do so after considering your other solutions first.

Puppylinux does not have any of those 3 menu items you list. So, I translate those 3 steps to mean 'Internet Connection Wizard' on puppylinux. That wizard has the name 'Connect' on the puppylinux desktop.

I typed in the IP addresses that you suggested into the puppylinux Internet Connection Wizard on the Desktop for the ethernet port connected to the laptop. I got the error message "Your Gateway 0.0.0.0 is not on the network. (You may have entered your address, gateway or netmask incorrectly.)"

And puppylinux does not have a "share internet connection with other local machines" choice in the start Menu.

So, I don't know what to do next except to go back to that URL.

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#6 Post by mikeb »

Yes, I found that the Desktop DNS parameters in Internet Connection Wizard were already Primary: 209.18.47.61 and Secondary: 209.18.47.62. And the same numbers were in /etc/resolve.conf on the Desktop. Do I type those IP addresses into the Laptop's Internet Connection Wizard under Static IP in the boxes for DNS parameters?
yes..one or both of them...connecting via the lan card in the wizard on the laptop.
The internet should be transparently passed through hence the need to give a nameserver.
Do I type in the 'iptables' and 'echo 1 ...' commands on the Desktop or the Laptop? I tried typing them on the Desktop. The commands seemed to work (I got back to the prompt). But the Desktop and Laptop still don't communicate.
in a terminal...sounds like you did that anyway...there should be no response except the prompt.
I typed the ifconfig command on the Desktop and got 'Eth1' and 'lo' as the names? of the 2 ethernet ports? I am trying to connect to the laptop via the ethernet port called 'eth0' in the Desktop's Internet Connection Wizard. So do I need to change ppp0? to what?
this is something I'm unclear on...how is your internet connection made? Does whatever you used mention ppp0 or eth1 or something else?..from what you say it could be eth1 instead of ppp0 for the command...

Also can you ping (desktop address) from the laptop. I assume you have made a static connection for the desktop lan card to laptop.

mike

edit one other thought..if you have a dsl modem with ethernet connection then the desktop will be given an ip (inet: from running ifconfig)...this has to not be the same as the network setup between machines..ie if 192.168.1.n then your link needs to use 192.168.2.n.
Another point for static the netmask is normally 255.255.255.0.

CGP
Posts: 100
Joined: Sat 26 Jul 2008, 05:17

#7 Post by CGP »

Hi everyone.

I got frustrated and gave up trying for a while, but finally got it to work after a lot of trial and error.

Here is how you do it:

For purposes of notation:

Internet<===>E'netPort1----Desktop----E'netPort2<==crossover ethernet cable===>Laptop

1) On the Desktop computer, open the Internet Connection Wizard (='Connect' on the puppylinux 'desktop').
2) Choose 'Connect to Internet by Network Interface'
3) Choose E'netPort1.
4) Choose Static IP
5) Note the DNS primary and secondary IP addresses
6) Close 'Connect'
7) Open 'Connect'
8) Choose E'netPort2.
9) Choose Static IP
10) Choose an IP address for the first box labeled IP Address. I suggest 192.168.0.1
11a) Choose netmask = 255.255.255.0
11b) make the gateway box blank, not 0.0.0.0 or anything else
11c) make sure the primary and secondary DNS IP addresses are the ones you noted above. they will probably be that by default.
11d) close 'Connect'.

On the laptop computer, open 'Connect' as above.
12) Choose an IP address for the first box labeled IP Address. I suggest 192.168.0.2
13) Choose netmask = 255.255.255.0
14) Choose for the Gateway IP address the address of the Desktop. if you followed my suggestion, it will be 192.168.0.1
15) Make sure the primary and secondary DNS IP addresses are the ones you noted above. they will probably be that by default.
16) Close 'Connect'.

That is all for the setup of the connection over the crossover ethernet cable.

Now you need to adjust the firewall on the Desktop.
1) In 'Setup' (on the puppylinux 'desktop'), choose 'Setup a firewall'.
2) Choose 'custom installation'
3) Choose the services that you want to be used by the laptop. I don't recall exactly, but I think I chose ftp, http, auth, and a few others.
4) Click ok
5) For each service that is presented to you (they are the ones you chose, I think), specify that IP address 192.168.0.2 can access it, assuming you took my suggestion above
6) Then setup will ask if you have a private network. say yes and input the name of E'NetPort2 (in my case it was 'eth0')
7) I think that it asks if there is any other network. say no.
8) Complete the firewall setup.

That should do it!!

In your browser on the laptop, you should not specify any proxy. Instead specify 'direct internet connection'.

Master_wrong
Posts: 452
Joined: Thu 20 Mar 2008, 01:48

#8 Post by Master_wrong »

I got frustrated and gave up trying for a while, but finally got it to work after a lot of trial and error.
I'm glad you were able to do it finally :)

sorry to give some sample from mandriva indeed you cannot apply all from it into puppy, but at least you get some clue from it...
Cluster-Pup v.2-Puppy Beowulf Cluster
[url]http://www.murga-linux.com/puppy/viewtopic.php?p=499199#499199[/url]

CGP
Posts: 100
Joined: Sat 26 Jul 2008, 05:17

#9 Post by CGP »

Mike and Master_Wrong, thanks for the help. Master_Wrong, I choose 192.168.0.1 and 2 because of your help. Some other IP addresses I chose did not work without an error message.

Also, I found that when setting up the firewall on the Desktop, you don't need to specify any services for the Laptop to access other then 'ssh', which is the default. If you then just specify that you have a private network on E'NetPort2, it will work. That way anyone who happens to have IP Address 192.168.0.2 on the internet will not have access to those other services on your computer.

User avatar
Anniekin
Posts: 246
Joined: Wed 25 Feb 2009, 00:15

#10 Post by Anniekin »

Subscribed.

blindsound
Posts: 4
Joined: Tue 17 Jul 2012, 02:11

from puppy to linksys

#11 Post by blindsound »

Hi there, i have being reading a lot in forums and searching even more in manuals but i can't get puppy to share internet through ethernet.

I'm using puppy to connect with a 3g modem and I want to share that connection with a wifi linksys connected usign ethernet.

I try to do the same with a mac computer and did work great, so my problem is particularly with puppy and sharing (i try using firewall install and also "shareInternet" but no luck!).

Please help!
I being dealing with this for the last couple of weeks and I really want puppy to be the "OS server" for my network.

User avatar
WB7ODYFred
Posts: 169
Joined: Sun 14 Dec 2008, 02:15
Location: Oregon & Washington

Using PuppyLinux Lucid 5.2.8

#12 Post by WB7ODYFred »

I use to have this working easily with Firestarter and Linux Mint. But the present 5.2.8 Lucid Firestarter 2.0 rc9 is different with no SIMPLE GUI.
So seems to have to manual edit file /etc/rc.d/rc.firewall

Internet Connection Sharing on Puppy Linux using Firestarter Firewall.
from https://help.ubuntu.com/community/Inter ... onSharing/
from http://jorgenmodin.net/index_html/archi ... linux/view
from http://www.fs-security.com/docs/connection-sharing.php

Run FireStarter to have it build the default files
Menu --> Network --> FireStarter

Edit file /etc/rc.d/rc.firewall
add line INTERNAL_INTERFACES="eth0" to indicate the Internet Connection Sharing Port

Use this as a guide to the individual commands
http://www.cyberciti.biz/faq/linux-conf ... -tutorial/
http://www.linuxforums.org/forum/ubuntu ... lient.html

I am working out how to do this internet connection sharing, so check back and add your thoughts as to what worked for you. Fred :shock:

cd /etc
sysctl -w net.ipv4.ip_forward=1
echo "net.ipv4.ip_forward = 1" >>/etc/sysctl.conf
iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE

echo "1" >>/proc/sys/net/ipv4/ip_forward

/etc/init.d/dnsmasq restart
dpkg-reconfigure ipmasq

You'll be bombared with a blue screen.
If you know what to do, then configure things to your liking.
Otherwise, you could do the following...

1. yes
2. ok
3. keep current setup

# replace wlan0 with the device that receives the Internet, such as wlan0.

iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
ifconfig eth0 up
dhcpcd eth0
# change gw address to match your situation
route add default gw 192.168.0.29 etho
4. Time to test it
ping -c 2 he.net or ping -c 2 192.168.0.1


#Post now before I complete test working, to leave record to comeback too.

User avatar
WB7ODYFred
Posts: 169
Joined: Sun 14 Dec 2008, 02:15
Location: Oregon & Washington

Update install shareInterenet2.2.4 it has a dnsmasq included

#13 Post by WB7ODYFred »

Update JULY 30, 2012 this method quoted below DOES NOT WORK.
DO NOT USE. REFERENCE ONLY ShareInternet2.2.4 contains a dnsmasq version.
install dnsmasq 2.51 from Puppy Package manager. Which needs DBUS and LIBDBUS1.2.16 packages also, plus upstart and upstart-job then try again.
to use dnsmasq
http://en.wikipedia.org/wiki/Dnsmasq
https://help.ubuntu.com/community/Dnsmasq
http://www.thekelleys.org.uk/dnsmasq/doc.html

# dnsmasq --test
dnsmasq: syntax check OK.

July 21 2012,still testing, don't know what is wrong, yet!
July 30, 2012 UPDATE use ShareInternet2.2.4.pet Apps/script file/directory
http://www.murga-linux.com/puppy/viewtopic.php?t=37520
See page6 at the bottom, where I posted good instructions and a picture
from Rox-Filer of the internetSharing directory.
http://www.murga-linux.com/puppy/viewto ... 0&start=82
Just left click on the executable directory named internetSharing and the magic shell scripts will run and POST a GREEN DOT on the Icon. Your Puppy Linux is now a router from a WIFI card wlan0 port out to your ethernet port eth0. A second click will turn off the internet sharing. Use the Test_internet_Sharing.sh script to print out the Iptables and verify that wlan0 port is being forwarded to the eth0 port.
There is a document about IPTables from Chapter 14, that was really good explanation. Now where is that link?? Linux Home Networking, Yeah!
http://www.linuxhomenetworking.com/wiki ... g_iptables
http://www.thegeekstuff.com/2011/01/ipt ... damentals/
https://help.ubuntu.com/community/IptablesHowTo

You DO NOT have to run/turn on/start the FIREWALL for IntenetSharing to
work correctly. Don't run the FIREWALL after starting InternetSharing.

some Linux commands to use for testing
ifconfig eth0 10.0.0.4 netmask 255.255.255.0 up
ping -c 3 he.net
ping -c 3 10.0.0.50
route -n


Fred
ps. Firestarter worked like a golden charm in Mint LInux 8. So burn a CDROM for Mint Linux 11 that is equivalent to Lucid Lynx Ubuntu 10,
and play with that as a Live CD and see if you can EASILY make the Firestarter work to share your Linux Connection with other machines.
Last edited by WB7ODYFred on Mon 30 Jul 2012, 08:44, edited 1 time in total.

blindsound
Posts: 4
Joined: Tue 17 Jul 2012, 02:11

Good info!

#14 Post by blindsound »

I'll get back to you with more details as sooner as I recover the computer holding Puppy (electronic issues).
Thanks a lot for your reply!

User avatar
WB7ODYFred
Posts: 169
Joined: Sun 14 Dec 2008, 02:15
Location: Oregon & Washington

Small script file for listing the iptables and the interface

#15 Post by WB7ODYFred »

For purposes of notation:

Internet<===>WiFi ath5k----Desktop----E'netPort1<==crossover ethernet cable===>Server(2nd desktop)

Internet<===>WiFi 192.168.1.9----Desktop----E'net 10.0.0.4<==crossover ethernet cable===> 10.0.0.40 Server(2nd desktop)

Here is a shell script file "test_share_internet.sh" to print out the stuff that matters. Use from a ROX-Terminal window on the command line.

Use Geany editor to copy from here and past into a new windows. Save the contents into a file named, " test_share_internet.sh "
chmod +x test_share_internet.sh

The run the shell command
./test_share_internet.sh

# set the ethernet port with a static address before running shareInternet app.
ifconfig eth0 10.0.0.4 netmask 255.255.255.0 up

Turn off the internet firewall if your having problems.
After running shareInternet program, do not change the firewall configuration.

Code: Select all

#! 
#bash script file   test_share_internet.sh  date: July 25 2012
#Make sure the iptables service is started, then run the script

# *Beware /sbin/iptables -F will flush your existing rules if you have any so make sure you run
#/sbin/iptables -L -v -n -line-numbers and see. If you have any rules add them to the script.

# *If you are using a different src and dst IP you will want to enable ip forwarding:
#echo 1 > /proc/sys/net/ipv4/ip_forward
echo "List IPTables to see the port forwarding"
/sbin/iptables -L -v --numeric --line-numbers 
echo "  print the ifconfig "
ifconfig 
echo "  print wireless iwconfig  "
iwconfig
echo " "
echo "See the routes.  Is gateway up? "
route -n
echo " "
echo " is ip_forward = 1? "; cat /proc/sys/net/ipv4/ip_forward
Attachments
test_share_internet.tar.gz
test_share_internet.sh bash shell script
test_share_intrnt_output text file of the output from the script file
shareInternet_image.png Picture File after ShareInternet app ran
shareInternet_image_off.png Picture File before ShareInternet app is run
(34.41 KiB) Downloaded 1398 times

Post Reply