LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (http://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Connecting 2 linux computer back to back with cross cable. (http://www.linuxquestions.org/questions/linux-networking-3/connecting-2-linux-computer-back-to-back-with-cross-cable-703790/)

michalng 02-11-2009 02:26 AM

Connecting 2 linux computer back to back with cross cable.
 
I have a laptop (192.168.1.101) and a desktop (192.168.1.102) both connected wirelessly to my router.

Wanted to transfer large (~20Gb) of information from laptop to desktop using a cross-cable connecting to their eth0.

Understand that I can setup samba or ssh and transfer through wireless, but was hoping to get it done through a physical connection (faster ?)

Any advise how I can do it? :D

hallamigo 02-11-2009 02:43 AM

I've got two computers that I have connected via NFS (basically mapping a drive of one to the other) - faster than SSH or Samba, so I'm told. Here are my notes on how I set it up on Debian. ("server" is one computer that is sharing its directory, "client" is the other)
Code:

# From the server (192.168.0.74):
sudo apt-get install nfs-kernel-server nfs-common portmap
sudo vi /etc/exports
# add the following, swap out your dir2share and client's IP
/home/dir2share 192.168.0.75(rw)
# close, then run:
sudo exportfs -a

# From the client (192.168.0.75), swap out your directories and IPs here too:
sudo apt-get install nfs-common portmap
mkdir -p /home/clientuser/servermapped
sudo mount 192.168.0.74:/home/dir2share /home/clientuser/servermapped

Hope that makes some sense.

datopdog 02-11-2009 02:44 AM

just connect the two machines setup ip addresses using ifconfig and use rsync to copy the files across, you will need ssh enabled on the destination for rsync to work.

Alternatively you can use netcat to copy the file across.

michalng 02-11-2009 02:55 AM

Quote:

Originally Posted by datopdog (Post 3439241)
just connect the two machines setup ip addresses using ifconfig ......

datopdog
Can i make use of the existing ip address assigned by the wireless router, connect these 2 computers with a cross cable and get them detected by one another?


hallamigo,
thanks for the tip, will try out as a last resort.
wanted to get this done with minimum addons :D

datopdog 02-11-2009 02:57 AM

You can put the two on a dummy network as to not confuse the kernels routing mechanisms.

hallamigo 02-11-2009 03:06 AM

Haha, yeah, I should have specified the long term vs. short term solution. I use the NFS setup so my wife and I can have everything on one computer and just map the other computer over.

michalng 02-11-2009 03:46 AM

Quote:

Originally Posted by datopdog (Post 3439253)
You can put the two on a dummy network as to not confuse the kernels routing mechanisms.

Appreciate if you can explain a little in detail, you are looking at a computer newbie here :D

camh 02-11-2009 05:11 AM

I think he means to have them on a completely separate network from your wireless LAN.

Either way, link up your 2 NICs with your crossover and give each computer an ip that is different from your other network(s) eg.
Code:

ifconfig eth0 172.16.1.x netmask 255.255.0.0
where 'x' is a unique number for each machine. Test the connection by pinging the other machine. If it works, you're good. You can then use whatever method you want to transfer the files. I prefer FTP, since security is not an issue in this case (if you are paranoid, disconnect from the wireless network first) and it is usually the quickest to set up.

eg. (assuming ubuntu/debian)

Code:

user@laptop$ sudo apt-get install proftpd
From there you can FTP to the laptop from the desktop machine, using your user credentials and retrieve the files.

After you're done, simply remove proftpd from the laptop.
Code:

user@laptop$ sudo apt-get remove proftpd && sudo apt-get autoremove

michalng 02-11-2009 08:00 AM

camh,

followed your advise and everything works out. thanks.


All times are GMT -5. The time now is 05:29 PM.