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 Wed 30 Jul 2014, 21:45
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
Connecting two Puppy laptops by eth0 or wlan0 without router
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 2 [26 Posts]   Goto page: 1, 2 Next
Author Message
Karl Godt


Joined: 20 Jun 2010
Posts: 3956
Location: Kiel,Germany

PostPosted: Sun 25 May 2014, 18:41    Post subject:  Connecting two Puppy laptops by eth0 or wlan0 without router
Subject description: + SOLVED + Wifi needs same cell id iwconfig wlan0 ap FF:FF:01:01:F1:F1
 

After searching the net and compiling various packages

so I have dnsmasq, brctl, hostapd, iw, iptables and various other tools available ,

I would like the idea to connect two machines without router, since I don't have a router .


Anybody ever succeeded in this using the command line ?


All I find uses network-manager
or ifupdown /etc/network/interfaces
or systemd init start of ubuntu ,
or other unknown to PUPPY GUI tools .


Links or experiences muchly appreciated .

HW:
Machine 1 :
Code:
eth405    Link encap:Ethernet  HWaddr E0:CB:4E:1A:0E:FA 
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1 errors:0 dropped:0 overruns:0 carrier:4
          collisions:0 txqueuelen:1000
          RX bytes:1072160 (1.0 MiB)  TX bytes:78 (78.0 B)

wlan90    Link encap:Ethernet  HWaddr 00:25:D3:E5:0C:EE 
          inet addr:169.0.0.1  Bcast:169.0.255.255  Mask:255.255.0.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

with ath9k driver


Machine 2 :
eth0 similar
wlan0 similar with rt2800pci driver

Machine 1 runs a funny udev version that greps IFACE from persistent.rules files and adds one onto each triggering / boot and writes the next number into the .rules file Laughing

Last edited by Karl Godt on Sat 31 May 2014, 17:14; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website 
Flash
Official Dog Handler


Joined: 04 May 2005
Posts: 10948
Location: Arizona USA

PostPosted: Sun 25 May 2014, 20:47    Post subject:  

You use one of those funny orange Ethernet crossover cables, don't you?
Back to top
View user's profile Send private message 
Karl Godt


Joined: 20 Jun 2010
Posts: 3956
Location: Kiel,Germany

PostPosted: Mon 26 May 2014, 03:27    Post subject:  

I have a normal ethernet cable and wikipedia claims that recent RJ-45 ports would manage things correctly without need for crossover cable .

My HW is from around 2009/2010 but might still use old port interfaces ( to lower production costs ) .

Today is Monday, will look for a crossover cable .
Back to top
View user's profile Send private message Visit poster's website 
rcrsn51


Joined: 05 Sep 2006
Posts: 8931
Location: Stratford, Ontario

PostPosted: Mon 26 May 2014, 08:23    Post subject:  

You can also buy a crossover adapter that plugs into the end of a regular Ethernet cable. Then you can't get confused about which cable is which. Wink
Back to top
View user's profile Send private message 
Karl Godt


Joined: 20 Jun 2010
Posts: 3956
Location: Kiel,Germany

PostPosted: Mon 26 May 2014, 12:38    Post subject:  

Funny , that's what I did ( bought an in the middle converter block 2,90€ )
and bought additionally a second normal ethernet cable ( 1m 3,99€ )
for the other side of the converter .


But it turned out , that the ethernet cable I bought long time ago at an 1€ TEDI-Markt store is either damaged inside or the joints at the ends are not fitting well .
My ports don't need a crossover .

The new cable's joints also fit much more tightly .


So I was able to start dhcpd daemon at one machine and dhcpcd client on the other and it received immediately an IP address .

I started dhcpd as
Code:
dhcpd -d -cf /etc/dhcp/dhcpd.conf eth0

with a simple conf file I found on the net :
Code:
#http://www.linuxhelp.net/forums/Setup_Simple_Dhcp_Server_t4052.html
    ddns-update-style interim;
     ignore client-updates;

     subnet 192.168.0.0 netmask 255.255.255.0 {
       option routers                  192.168.0.1; #Default Gateway
       option subnet-mask              255.255.255.0;
       option domain-name              "home.local";
       option domain-name-servers      192.168.0.2;
       option netbios-name-servers     192.168.0.2; #WINS Server
    range dynamic-bootp 192.168.0.51 192.168.0.100;  #DHCP Range to assign
       default-lease-time 43200;
       max-lease-time 86400;
}

and the debug output in the terminal while dhcpcd from the other machine was running is quite satisfying .


But now I need further steps to reach actually the other machine from the another
to wget files or ssh into .

sshd -d
with conf file entries as
ListenAddress 192.168.0.51
ListenAddress 192.168.0.0

seems not to work - I can ssh 192.168.*.* into the current machine but not into the other for example .

"No route to host" or "Network unreachable" is what I'm getting .
Back to top
View user's profile Send private message Visit poster's website 
jamesbond

Joined: 26 Feb 2007
Posts: 2053
Location: The Blue Marble

PostPosted: Mon 26 May 2014, 13:54    Post subject:  

Karl, if both machines have wireless, they can be configured to talk directly, no router needed. But since you already bought that cable, may as well use it (it's faster over the cable).

Secondly, you don't need dhcp daemon at all. "ifconfig eth0 up" both machines, then "ifconfig eth0 192.168.100.1" for the first one and "ifconfig eth0 192.168.100.2" on the second machine. But since you already get it dhcp going as well, then may as well use it.

Now for actually transferring the files, you can do this:
Code:

cd /path/where/you/want/to/receive
nc -lp 1234 | tar -x

And on the sending side, you do this:
Code:

cd /path/to/send
tar -c file1 file2 path/file3 path2/file* etc-you-get-the-idea | nc receiving-machine's ip 1234


If you want to be more fancy, run ftpd (I have pure-ftpd here in Fatdog, I reckon Puppy uses the same). I think pure-ftpd should be pre-configured on Puppy (you can check that on the menu) but in case it is not, run it like this: "pure-ftpd -EbBADH" on one of the machine and you can use gftp on the other machine to access the files. User/password is root with the usual puppy password.

If you need to control your other machine from your first machine (so you don't have to go back and forth between them), start x11vnc on that machine and access it from vncviewer from your machine (I recall that both of these utilities are standard and is pre-configured within puppy - don't need to bother with other things).

Good luck.

_________________
Fatdog64, Slacko and Puppeee user. Puppy user since 2.13
Back to top
View user's profile Send private message 
Karl Godt


Joined: 20 Jun 2010
Posts: 3956
Location: Kiel,Germany

PostPosted: Mon 26 May 2014, 14:59    Post subject:  

Hi James !

I am am using busybox
Code:
udpsvd -vE 192.168.0.0 69 tftpd

on one machine and
Code:
tftp -g -r /usr/abc.txt 192.168.0.0 69

tftp: using blksize 512
using server '192.168.0.0:69', remote_file '/usr/abc.txt', local_file 'abc.txt'
sending 29 bytes
00 01 2f 75 73 72 2f 61 62 63 2e 74 78 74 00 6f 63 74 65 74 00 74 73 69 7a 65 00 30 00
tftp: sendto: Permission denied


and such ... Crying or Very sad

So the dhcp server running machine has 192.168.0.0 IP
and the dhcp client received IP from the dhcp server is 192.168.0.51 :
Code:
dhcpcd -d -L eth408

Info, eth408: dhcpcd 3.1.8 starting
Info, eth408: hardware address = e0:cb:4e:1a:0e:fa
Info, eth408: DUID = 00:01:00:01:1b:0b:3a:b2:00:25:d3:e5:0c:ee
Info, eth408: broadcasting for a lease
Debug, eth408: sending DHCP_DISCOVER with xid 0xd7f399f
Debug, eth408: waiting on select for 20 seconds

Debug, eth408: got a packet with xid 0xd7f399f
Info, eth408: offered 192.168.0.51 from 192.168.0.0
Debug, eth408: sending DHCP_REQUEST with xid 0xd7f399f
Debug, eth408: waiting on select for 20 seconds
Debug, eth408: got a packet with xid 0xd7f399f
Info, eth408: checking 192.168.0.51 is available on attached networks
Debug, eth408: sending ARP probe #1
Debug, eth408: sending ARP probe #2
Debug, eth408: sending ARP probe #3
Debug, eth408: sending ARP claim #1
Debug, eth408: sending ARP claim #2
Info, eth408: leased 192.168.0.51 for 43200 seconds
Debug, eth408: renew in 21600 seconds
Debug, eth408: rebind in 37800 seconds
Info, eth408: adding IP address 192.168.0.51/24
Info, eth408: adding default route via 192.168.0.1 metric 0
Debug, eth408: writing /etc/resolv.conf
Debug, eth408: writing /var/lib/dhcpcd/dhcpcd-eth408.info
Debug, eth408: exec "/etc/dhcpcd.sh" "/var/lib/dhcpcd/dhcpcd-eth408.info" "new"
Debug, eth408: forking to background


NO ping or anything other program to connect further .

Will have to look into /etc/resolv.conf .

Of course being online now had to change /etc/resolv.conf Question
pppd is a *#*!*@* -- sometimes rewrites /etc/resolv.conf and many times not ..
Back to top
View user's profile Send private message Visit poster's website 
gcmartin

Joined: 14 Oct 2005
Posts: 4127
Location: Earth

PostPosted: Mon 26 May 2014, 17:21    Post subject:  

Hello @Karl Godt. Sorry I'm late to this game, but, I'm in travel status.

There is an obvious question which doesn't seemed to answered here. Do you have a ethernet hub/switch? 5port/8port/16port/???

There is no need for a cross-over when there is one of these. Further as you have already shared, there is no need for a cross-over in most/many modern PC motherboards as they have the technology built-in to detect the presence of device on the other end and if it, too , is modern they will work together without the need for crossover.

If you do not have a router, you can use dnsmasq to be a LAN based DHDP service so that any/all PCs on your LAN can get its IP personality from your PC with dnsmasq.

Otherwise, if you want to manage IP personalities, manually for each and every PC, you can set static IPs for all devices into the same subnet and it will work too.

dnsmasq is by far the easiest and I believe @JamesBond has a write-up somewhere on this package, IIRC.

Here to help

_________________
Get ACTIVE Create Circles; Do those good things which benefit people's needs!
We are all related ... Its time to show that we know this!
3 Different Puppy Search Engine or use DogPile
Back to top
View user's profile Send private message 
Ted Dog


Joined: 13 Sep 2005
Posts: 2298
Location: Heart of Texas

PostPosted: Mon 26 May 2014, 17:28    Post subject:  

I would be interested in a peer setup for Fatdog for 3 wifi machines. tried the gui but not able... to setup using peer menu.
Back to top
View user's profile Send private message 
Karl Godt


Joined: 20 Jun 2010
Posts: 3956
Location: Kiel,Germany

PostPosted: Mon 26 May 2014, 18:45    Post subject:  

Quote:
Do you have a ethernet hub/switch? 5port/8port/16port/???

No.

Have tried to bring /etc/rc.d/rc.firewall stop AND cleanup down but no luck until now .


What I still have know about is what Gateway, Mask, Subnet and others mean ...


Also tried commands like

ip route add *

with no success though it shows in route command output .
Back to top
View user's profile Send private message Visit poster's website 
don570


Joined: 10 Mar 2010
Posts: 3220
Location: Ontario

PostPosted: Mon 26 May 2014, 19:06    Post subject:  

Why don't you use samba tng server . If you don't like a GUI , Samaba has
various built-in commands to be used by the terminal program.

For instance I've transferred individual files over an ethernet cable
with a simple command.

BTW only very old machines need a crossover ethernet cable since
ethernet interface was improved to sense the direction of flow and
the switching is done automatically in modern machines.

___________________________________________
Back to top
View user's profile Send private message 
gcmartin

Joined: 14 Oct 2005
Posts: 4127
Location: Earth

PostPosted: Mon 26 May 2014, 19:50    Post subject:  

Karl Godt wrote:
So the dhcp server running machine has 192.168.0.0 IP
You should probably assign your DHCP server another IP address other than 192.168.0.0. This is one of 2 IP address on the subnet you should NEVER manually assign as the ethernet standard has other uses for both 192.168.0.0 and 192.168.0.255. Choose any other IP address for your server and restart your server.

Good choice on your use of a DHCP server. This will give no change in your future should you acquire a ethernet switch/hub. I have seen 5 port switches as low as $5(ca). Cables can be made or acquired from local friends/shops/TV repair shops or anyone who has the crimping tool to make or fix cables..

Questions
  • which PUP distros are you using for this setup?
  • How is your DHCP server getting to the Internet, today?
  • Will you be using a PCI or USB for WiFi connection to your DHCP server?
Let us know so that we can help you arrive at a good setup for your DHCP to satisfy broadcast from your client PCs in your home LAN.

Here to help

_________________
Get ACTIVE Create Circles; Do those good things which benefit people's needs!
We are all related ... Its time to show that we know this!
3 Different Puppy Search Engine or use DogPile

Last edited by gcmartin on Mon 26 May 2014, 21:45; edited 3 times in total
Back to top
View user's profile Send private message 
mcewanw

Joined: 16 Aug 2007
Posts: 2252
Location: New Zealand

PostPosted: Mon 26 May 2014, 19:55    Post subject:  

I've done this often in the past on a couple of old machines using, as others have suggested above, an ethernet crossover cable (since old machines they did need cross over cable). I have never bothered with dhcp in such a simple conifiguration, but instead, as gcmartin suggests, used static ip addresses for the eth card on each end.

As far as I remember Puppy internet connection wizards come with the option to add static ip addresses. If not going out on the Internet you can use a private address like 192.168.0.1 and 192.168.0.2 with netmasks 255.255.255.0

Alternatively, instead of using dhcp to automatically assign ip addresses to your eth cards, you can manually at a console just set up the ip addresses with command:

ifconfig eth0 192.168.0.1 netmask 255.255.255.0 up

(assuming eth0 is your ethernet card)
(If you ever wish to you can bring down the interface with: ifconfig eth0 down)

and similarly on the other machine. If all is well you should be able to ping 192.168.0.2 from the 192.168.0.1 machine. You don't need to enter any gateway address since the machines are directly connected here, so traffic between them doesn't need to be sent to a router (i.e. gateway) first. Some details here:

http://linux-ip.net/html/basic-changing.html

Note that if you have a second ethernet card inside one of the machines, you can also get onto the internet from either machines by configuring NAT and ip-forwarding on the machine with two internet cards (i.e. using it as a router, meaning gateway, onto the Internet), but that would require a few more steps including adding that 'router' address as a gateway onto the Internet by means of the 'route add' command. I gave commands for that here:

http://www.murga-linux.com/puppy/viewtopic.php?p=135460#135460
It's a while since I used the route add command but I think it would be:

Code:
route add default gw 192.168.0.1 netmask 255.255.255.0


where machine 192.168.0.1 is acting as the default gateway (router) for machine 192.168.0.2 onto the Internet. You would only need to this command to be run on the 192.168.0.2 machine, in this case, to tell it where to send Internet destined traffic.

Having said all the above, no reason why you dhcp couldn't be set up instead of relying on static addresses, I'd think.

William

Last edited by mcewanw on Mon 26 May 2014, 20:16; edited 2 times in total
Back to top
View user's profile Send private message Visit poster's website 
gcmartin

Joined: 14 Oct 2005
Posts: 4127
Location: Earth

PostPosted: Mon 26 May 2014, 20:11    Post subject:  

@Karl Godt

@McEwanw is leaning, as I am, to help you do essentially the same thing. You started this thread titled "... without router". So we are offering some suggestions of taking one PC to be setup in the home as a LAN router for other ethernet devices in your home. Routers are essential as they facilitate LAN devices to access the Internet. 2 decades ago we were doing this using dial-up on a single PC.

Help us a little with the answers and we can give you several options for this and expanding it use in your home (one of which he has already given .. there are few others, too).

Here to help
PC2PConnect_PC1plus4.jpg
 Description   Setup a PC to allow other PCs to get to the INternet
 Filesize   24.53 KB
 Viewed   165 Time(s)

PC2PConnect_PC1plus4.jpg


_________________
Get ACTIVE Create Circles; Do those good things which benefit people's needs!
We are all related ... Its time to show that we know this!
3 Different Puppy Search Engine or use DogPile

Last edited by gcmartin on Tue 27 May 2014, 19:37; edited 1 time in total
Back to top
View user's profile Send private message 
technosaurus


Joined: 18 May 2008
Posts: 4285

PostPosted: Mon 26 May 2014, 23:52    Post subject:  

http://forum.xda-developers.com/showthread.php?t=2009381
has a nice tutorial for setting up an access point.
from there you could use jamesbond's netcat system (or busybox nc)

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 2 [26 Posts]   Goto page: 1, 2 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
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.1176s ][ Queries: 12 (0.0046s) ][ GZIP on ]