Connect 2 PCs, LAN cable ?

meetdilip

Computer Addict
Say I have 2 PCs, a Laptop and a Desktop. Can I use a normal LAN cable to connect between them and transfer files to a shared folder on the Desktop ? They are 5-6 meters apart.

I mean no router or switch in between, only an RJ45 cable connecting them. Both PCs run 18.04 Ubuntu and have Samba ( Desktop ). Thanks.
 

SaiyanGoku

kamehameha!!
Yes, you need to assign them different IP addresses but within same subnet. Then just browse to the path where the files are stored.

Sent from my ONEPLUS A3003 using Tapatalk
 
OP
meetdilip

meetdilip

Computer Addict
Can I use

192.168.1.400 and 192.168.1.401 as IPs and use 0.0.0.0 as subnet with these 2 machines ? If we do that, do they connect without a router in the middle just by IP and graphically ? Thanks.
 
OP
meetdilip

meetdilip

Computer Addict
there used to be a software also especially for this purpose

For Ubuntu ?

What I am looking for is a simple LAN network. If possible without a switch or a router. Operating Systems has advanced so much that it might be possible. When we connect a single LAN cable between 2 Linux machines, it is LAN. Then we need proper routing. Currently, I am able to do this over WiFi network. But WiFi is 10 times slower than USB transfer. I don't want to think how much slower than RJ45.
 

billubakra

Conversation Architect
For Ubuntu ?

What I am looking for is a simple LAN network. If possible without a switch or a router. Operating Systems has advanced so much that it might be possible. When we connect a single LAN cable between 2 Linux machines, it is LAN. Then we need proper routing. Currently, I am able to do this over WiFi network. But WiFi is 10 times slower than USB transfer. I don't want to think how much slower than RJ45.

Windows. There's an inbuilt windows app also to connect to systems together, whether it works without a router or with that specific needs to be ascertained.
 

Zangetsu

I am the master of my Fate.
AFAIK you can't use the same RJ45 cable to connect to PC together...the one end of the RJ45 needs to be modified a bit (the internal wiring of the head).
Please check more on this, I was told about this setting by the IT guy in my previous company.
 
OP
meetdilip

meetdilip

Computer Addict
AFAIK you can't use the same RJ45 cable to connect to PC together...the one end of the RJ45 needs to be modified a bit (the internal wiring of the head).

I tried using a cable I have. It fits well. It was the cable which used to connect my ONT and router. So it is a working cable.

PS : I hope I understood your answer correctly.
 
OP
meetdilip

meetdilip

Computer Addict
If the PC is detectable on shared network then it is working.

That is exactly my question. When does it become LAN ?

1. When 2 PCs connected through LAN cable and has OS

2. 1 + more

Currently, Desktop has subnet as 0.0.0.0 and a static IP. When I tried to ping this IP from Laptop Terminal, it failed. Will adding a static IP to laptop as well fix this issue ? And use the same subnet ?

Or, I must add a router or switch in between ?
 

patkim

Cyborg Agent
Gone are the days when 2 PCs needed Crossover Cables to be directly connected to each other. Today practically Straight LAN cable should work. However I am a bit conservative when it comes to Linux. More about types of LAN connections here.

In your Linux OS network properties set IPv4 and set DHCP and I believe it should automatically take and resolve to 2 private IPs. I hope no other settings is needed. If required temporarily disable IPv6.

I do it many times between my 2 Windows PCs directly with standard Straight LAN cable as both have 1 Gbps Ethernet but my router only has 100 Mbps ports. So I can transfer files much faster. Only difference is I do it with 2 Windows PCs.
 
OP
meetdilip

meetdilip

Computer Addict
I used the LAN cable which I connect to the router.

1 -------- 2

Same Netmask added for both PC in IPV4 properties= 255.255.255.0

Static IP for both Laptop and Desktop in IPV4 properties = 192.168.1.aaa and 192.168.1.bbb

That's all. Connect PCs with your LAN cable and Ubuntu will detect it as 2 PCs in a network. You can view the shared folders in both PCs from one another. If you prefer the command line, you can try your tricks through Terminal.

If I understand correctly, this should work even if you are using Ubuntu server edition. I haven't tried though.
 
OP
meetdilip

meetdilip

Computer Addict
Forgot to update something. The link speed was shown as 1000 Mbps. But I got only between 1.5 and 2 Mbps. LAN cable was the only connection. Does anyone know why the transfer speed was so low ? It was almost the same as WiFi transfer speed.
 

patkim

Cyborg Agent
Just a few comments...What kind of file sizes were you transferring? If you transfer many small files together then speed will slow down. If so, try transferring a single file > 500 MB and retest the speeds. Just as an additional note, use disks app on Linux to benchmark the drive. Check what sequential disk I/O speeds you are getting on both systems. Check what link speed is shown on both systems. Also it may be possible that due to other reasons like older cable or poor contacts the speed might have been negotiated to Half Duplex instead of Full. No harm in trying with another CAT 5E or CAT 6 cable.
 
Top Bottom