LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   connecting two machines (https://www.linuxquestions.org/questions/linux-networking-3/connecting-two-machines-372680/)

mushmaster 10-13-2005 12:29 PM

connecting two machines
 
i need to get some files from a laptop to my desktop and i'd like to connect them directly. i've got some ethernet cables, and a router, if that's needed for some reason. i really just want to send data directly from one machine to the other. i know very little about networking but this seems like it *should* be a simple task. i can't find directions on how to do it though. how do i do this?

linux.llama 10-13-2005 01:30 PM

Hey
You'll need a crossover cable. The router is unnecessary. What OSes on each machine?

Agrouf 10-13-2005 01:41 PM

Actually, the router can help it you don't have crossover cables.
You can use it as a switch.

If you have a crossover cable, plug it directly to both computers.
If you don't, plug 1 cable on each computer to the router.

Let say your NIC is eth0 on each computer
on first computer, do :
# ifconfig eth0 192.168.0.1 netmask ffffff00 up

on second computer, do
# ifconfig eth0 192.168.0.2 netmask ffffff00 up

test the network :
from computer 1, do ping 192.168.0.2, see if computer 2 responds.
from computer 2, do ping 192.168.0.1, see if computer 1 responds.

transfer the files :
Let say you want to transfer /home/dede/foo.txt from computer 1 to computer 2.
from computer 1, do :
$ ftp 192.168.0.2
> put foo.txt

mushmaster 10-13-2005 03:25 PM

" ifconfig eth0 192.168.0.1 netmask ffffff00 up"

when i do that i get "ffffff00: Host name lookup failure"

ioerror 10-13-2005 05:47 PM

Quote:

when i do that i get "ffffff00: Host name lookup failure"
Just tried that and I get the same result. Use dotted decimal "netmask 255.255.255.0".

Also, most routers will be setup themselves to be 192.168.0.1 so I'd suggest using 192.168.0.2 and 192.168.0.3.

Agrouf 10-14-2005 01:45 AM

Sorry I didn't check the syntax.
All apologies.

mushmaster 10-14-2005 09:23 AM

ok, i do all that, and i can ping each machine from the other, but when i try to ftp, it says, "connection refused."

makko 10-14-2005 09:48 AM

Enable an FTP server on the machine with the files you want to copy, then put those files in the root directory of the ftp server. If you've already done that then check your firewall.

ioerror 10-15-2005 10:41 AM

Quote:

ok, i do all that, and i can ping each machine from the other, but when i try to ftp, it says, "connection refused."
If you can ping them, then the network is working correctly. "connection refused" generally means that nothing is listening on the port you're trying to connect to. As makko says, it's just a question of enabling whatever services you need.

Ftp will do it, but depending on exactly what you want to do (general file sharing, backup etc), you might want to look at nfs, rsync and/or ssh/scp. Netcat (the comand is usually just called nc) will do in a pinch for an ad-hoc file transfer. If you want to mount each boxes filesystems and access them as if they were local, then nfs is generally the way to go.


All times are GMT -5. The time now is 09:08 PM.