Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sat 19 Apr 2014, 02:45
All times are UTC - 4
 Forum index » Advanced Topics » Hardware » Networking
internet connection sharing between 2 puppylinux computers
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [15 Posts]  
Author Message
CGP

Joined: 26 Jul 2008
Posts: 21

PostPosted: Sun 20 Sep 2009, 12:52    Post subject:  internet connection sharing between 2 puppylinux computers  

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.
Back to top
View user's profile Send private message 
mikeb


Joined: 23 Nov 2006
Posts: 7179

PostPosted: Sun 20 Sep 2009, 13:12    Post subject:  

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
Back to top
View user's profile Send private message 
Master_wrong

Joined: 19 Mar 2008
Posts: 456

PostPosted: Sun 20 Sep 2009, 13:19    Post subject:  

perhaps you can try this...
[url]
http://www.linuxforums.org/forum/mandriva-linux-help/72663-crossover-type-internet-connection-sharing.html
[/url]

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
http://www.murga-linux.com/puppy/viewtopic.php?p=499199#499199
Back to top
View user's profile Send private message 
CGP

Joined: 26 Jul 2008
Posts: 21

PostPosted: Sun 20 Sep 2009, 14:32    Post subject:  

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?
Back to top
View user's profile Send private message 
CGP

Joined: 26 Jul 2008
Posts: 21

PostPosted: Sun 20 Sep 2009, 15:03    Post subject:  

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.
Back to top
View user's profile Send private message 
mikeb


Joined: 23 Nov 2006
Posts: 7179

PostPosted: Sun 20 Sep 2009, 15:13    Post subject:  

Quote:
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.
Quote:

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.
Quote:
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.
Back to top
View user's profile Send private message 
CGP

Joined: 26 Jul 2008
Posts: 21

PostPosted: Sun 20 Sep 2009, 22:45    Post subject:  

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'
Cool 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.
Cool 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'.
Back to top
View user's profile Send private message 
Master_wrong

Joined: 19 Mar 2008
Posts: 456

PostPosted: Sun 20 Sep 2009, 23:18    Post subject:  

Quote:
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 Smile

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
http://www.murga-linux.com/puppy/viewtopic.php?p=499199#499199
Back to top
View user's profile Send private message 
CGP

Joined: 26 Jul 2008
Posts: 21

PostPosted: Sun 20 Sep 2009, 23:29    Post subject:  

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.
Back to top
View user's profile Send private message 
Anniekin


Joined: 24 Feb 2009
Posts: 186

PostPosted: Mon 05 Oct 2009, 09:47    Post subject:  

Subscribed.
Back to top
View user's profile Send private message 
blindsound

Joined: 16 Jul 2012
Posts: 4

PostPosted: Mon 16 Jul 2012, 22:30    Post subject: from puppy to linksys  

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.
Back to top
View user's profile Send private message 
WB7ODYFred


Joined: 13 Dec 2008
Posts: 103
Location: Oregon & Washington

PostPosted: Fri 20 Jul 2012, 07:02    Post subject: Using PuppyLinux Lucid 5.2.8
Subject description: Connecting to Wifi (or wire ethernet) to Internet and sharing 2nd Enet Card
 

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/Internet/ConnectionSharing/
from http://jorgenmodin.net/index_html/archive/2008/11/13/how-to-do-internet-connection-sharing-on-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-configure-a-static-ip-address-tutorial/
http://www.linuxforums.org/forum/ubuntu-linux/125639-howto-internet-connection-sharing-ubuntu-server-puppy-linux-client.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 Shocked

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.
Back to top
View user's profile Send private message 
WB7ODYFred


Joined: 13 Dec 2008
Posts: 103
Location: Oregon & Washington

PostPosted: Fri 20 Jul 2012, 08:12    Post subject: Update install shareInterenet2.2.4 it has a dnsmasq included
Subject description: Download sI2.2.4.pet version, then browse with ROX-Filer and Right click Install.
 

Update JULY 30, 2012 this method quoted below DOES NOT WORK.

Quote:

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/viewtopic.php?t=37520&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/index.php/Quick_HOWTO_:_Ch14_:_Linux_Firewalls_Using_iptables
http://www.thegeekstuff.com/2011/01/iptables-fundamentals/
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, 04:44; edited 1 time in total
Back to top
View user's profile Send private message 
blindsound

Joined: 16 Jul 2012
Posts: 4

PostPosted: Tue 24 Jul 2012, 18:06    Post subject: Good info!  

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!
Back to top
View user's profile Send private message 
WB7ODYFred


Joined: 13 Dec 2008
Posts: 103
Location: Oregon & Washington

PostPosted: Wed 25 Jul 2012, 14:32    Post subject: Small script file for listing the iptables and the interface  

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:

#!
#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
test_share_internet.tar.gz
Description  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
gz

 Download 
Filename  test_share_internet.tar.gz 
Filesize  34.41 KB 
Downloaded  714 Time(s) 
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [15 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Hardware » Networking
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1076s ][ Queries: 13 (0.0058s) ][ GZIP on ]