DIGIT-ARC read-only archive · snapshot: July 23, 2026

Connect 2 PCs, LAN cable ?

43 posts · originally from https://geek.digit.in/community/threads/connect-2-pcs-lan-cable.207865/

meetdilip
meetdilip Original post #1
Jan 29, 2020 at 9:48 AM
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
Jan 29, 2020 at 1:43 PM
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
meetdilip
Jan 29, 2020 at 2:38 PM
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.
B
Jan 29, 2020 at 2:59 PM
I think there used to be a software also especially for this purpose. Can't recall its name. Let the others to chip in.
meetdilip
Jan 29, 2020 at 3:07 PM
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.
B
Jan 29, 2020 at 3:09 PM
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.
meetdilip
Jan 29, 2020 at 3:14 PM
Here I have both machines on Ubuntu. Thanks.
Zangetsu
Jan 29, 2020 at 3:15 PM
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.
meetdilip
meetdilip #10
Jan 29, 2020 at 3:18 PM
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.
Zangetsu
Zangetsu #12
Jan 29, 2020 at 4:31 PM
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.
If the PC is detectable on shared network then it is working.
meetdilip
meetdilip #13
Jan 29, 2020 at 5:01 PM
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
patkim #14
Jan 29, 2020 at 8:16 PM
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.
Zangetsu
Zangetsu #15
Jan 30, 2020 at 1:01 PM
Yes, they are cross over LAN cables

meetdilip
meetdilip #16
Jan 30, 2020 at 2:34 PM
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.
meetdilip
meetdilip #18
Jan 30, 2020 at 8:13 PM
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
patkim #19
Feb 1, 2020 at 9:42 AM
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.
meetdilip
meetdilip #20
Feb 1, 2020 at 12:39 PM
Check what link speed is shown on both systems.

Network settings say that link speed is 1000 Mbps (on both )

No harm in trying with another CAT 5E or CAT 6 cable.

Is it available through Flipkart ? I would like to buy a 10m cable. Can you please link to a proper item ?
TigerKing
TigerKing #21
Feb 1, 2020 at 1:08 PM
First try LAN cable connecting to Laptop and Computer. And check in "Network", shared folders will be available.
You can share complete drive. I tried that and I was successful. Then simply copy paste.

And for Ubuntu I don't know.
You can try running bootable os on pendrive, Hiren's boot cd windows 10 version..
I don't know if it will decrease 1000mbps lan speed or not.
TigerKing
TigerKing #22
Feb 1, 2020 at 1:09 PM
Network settings say that link speed is 1000 Mbps (on both )



Is it available through Flipkart ? I would like to buy a 10m cable. Can you please link to a proper item ?
I would suggest to buy it from local, cables are costly online.
patkim
patkim #23
Feb 1, 2020 at 2:00 PM
Did you try copying a single large file? Are results still poor with a single large file?

Make sure that at both ends you are indeed getting 1000 Mbps Full Duplex. Ideally when network interface senses 1 Gbps it will auto switch to full duplex but just verify the same at both ends just to be sure.
Open a terminal
Code:
sudo –s
Type your admin password
Code:
ip link show
look for the name of Ethernet card. traditionally it should be eth1 but on my PC it’s enp27s0

ethtool <ethername name> e.g.
Code:
ethtool eth1

see sample output screenshot from my system. See the section on actual speed and duplex status.

speed.png

Problem could be anywhere. There might be some hidden setting to be enabled in Linux, bad LAN cable, NIC-OS/driver issues, speed negotiation issues etc.

Try the same cable on Windows PCs if you can. If you have no access to Windows PCs then use something like Live Windows PE disks like Hiren Boot DVD on both systems to boot into Live Windows and try the same exercise, if Windows cannot detect Linux partitions, may be you need to create FAT32 or NTFS partitions on free space on respective PCs and load it with some files to test transfer over Windows.

As far as what cable to buy is concerned. I have no experience in that as I create my own LAN cables using loose CAT6, RJ 45 plugs and my own crimping tool. However generally in my experience Amazon Basics products are good. You can opt for one such CAT 5E or CAT 6 cable. CAT 6 is superior but expensive. It also has a plastic spine inside to prevent cross-talk. However CAT 5E should do and supports 1 Gbps.
meetdilip
meetdilip #25
Feb 1, 2020 at 3:26 PM
How about this one ? Support only up to 500 Mbps though

EHATT RJ45 CAT6 10 Meters Ethernet Network Patch cord LAN Cable 10 m Network Cable - EHATT : Flipkart.com
meetdilip
meetdilip #26
Feb 1, 2020 at 3:40 PM
This one is CAT6 , 15m and 1000 Mbps

*www.amazon.in/dp/B01N0IQ4GQ/ref=twister_B0846QY127?_encoding=UTF8&psc=1#productDetails

Or should I buy CAT5E, 10 m and 1000 Mbps ? Please suggest

*www.amazon.in/Terabyte-CAT5E-RJ45-...r&qid=1580551232&sprefix=lan+c,aps,664&sr=8-3
TigerKing
TigerKing #27
Feb 1, 2020 at 5:25 PM
Looked like it was costly offline. Thanks.
Your Location??
I purchased 10 meter cat6 cable for ₹100 in 2017.
I purchased from lamington road, Mumbai.
And you are saying it's costly offline..
You should look for cat 7 also.
meetdilip
meetdilip #28
Feb 1, 2020 at 6:12 PM
They were asking ₹ 700 for 10m last year. Now after 6 months, they might settle for 1k.

You should look for cat 7 also.

Would be nice if you can provide a Flipkart or Amazon link.
topgear
topgear #29
Feb 8, 2020 at 9:39 AM
They were asking ₹ 700 for 10m last year. Now after 6 months, they might settle for 1k.

Would be nice if you can provide a Flipkart or Amazon link.

It's Rs. 179 only for 10M :

*www.amazon.in/dp/B00GZLB57U/
meetdilip
meetdilip #30
Feb 8, 2020 at 10:28 AM
That is CAT5. I bought CAT6. Obviously they were taking advantage of ignorance.

Thanks for the link, do you have one for CAT6 ?
topgear
topgear #31
Feb 8, 2020 at 10:43 AM
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.

You can not use 191.168.1.400 Choose any one from the following :

from 10.0.0.0 to 10.255.255.255 — with subnet mask of 255.0.0.0
from 192.168.0.0 to 192.168.255.255 - with subnet mask of 255.255.0.0
topgear
topgear #32
Feb 8, 2020 at 10:47 AM
That is CAT5. I bought CAT6. Obviously they were taking advantage of ignorance.

Thanks for the link, do you have one for CAT6 ?

CAt6 cables are costly and price varies depending on the brands. Rs. 700 for 10M cat 6 is costly but not too much.

Bluerigger I can vouch for :
Robot Check
At similar price Cat 7 is also available :
*www.amazon.in/AmazonBasics-Network-Ethernet-Patch-Cable/dp/B013PUMZMM/

Point is price varies from brand to brand.
meetdilip
meetdilip #33
Feb 8, 2020 at 10:52 AM
How does CAT7 help ? When I checked the cost is around 2.4K. My link speed is 1000 Mbps which 5E meets at ₹ 250. Just wondering how CAT6 or CAT7 will help. Thanks.
TigerKing
TigerKing #34
Feb 8, 2020 at 7:18 PM
How does CAT7 help ? When I checked the cost is around 2.4K. My link speed is 1000 Mbps which 5E meets at ₹ 250. Just wondering how CAT6 or CAT7 will help. Thanks.
1. Can I use a cat 7 cable for this router?
2. *www.quora.com/How-do-I-know-if-my-...atible-with-Cat5-Cat6-or-Cat7-Ethernet-cables
3. Cat5, Cat6, Cat7: Ethernet cables explained - Dignited
Cat5, Cat6, Cat7: Which one to buy?
Other than Cat5, Cat6, Cat7 and their Augmented variants experience sequential price increases. The cables are thicker and are a headache to bend over corners. They are also overkill as current hardware doesn’t support transmission speeds exceeding 1 Gbps. Of the lot, the most cost-effective and most widely used for residential and commercial Ethernet cable is without a doubt the Cat5e. Cat5e is also the most flexible for laying around turns and corners. At transmission speeds of 1 Gbps, Cat5e makes more sense to have. The reason for this is that most routers, motherboards and Ethernet modems support up to 1 Gbps.
5. What are the differences between Cat5, Cat6, and Cat7 Ethernet cables? | PC Gamer
Also, with virtually all consumer gear, such as routers, motherboards and Ethernet cards, max out at 1000 megabits or 1 Gbps. So for the time being, and likely years to come, the typical user will not be able to take advantage of the 10 Gbps and faster speeds of the Cat6a and higher cables.
6. Demystifying Ethernet Types —Difference between Cat5e, Cat 6, and Cat7
7. Cat5 vs Cat6 vs Cat7, Everything About Ethernet Cables | Gaming CPUs
Results:
So after I tested it these were my results:
CABLE TYPE AVERAGE DOWNLOAD RATE
Cat5e 940 Mbps
Cat6 932 Mbps
Cat7 935 Mbps

check LAN speed of motherboard, router, modem and then make purchase.

Like this mobo supports 10gbits
TRX40 AORUS XTREME (rev. 1.0) | Motherboard - GIGABYTE India
LAN = Intel® 10GbE LAN chip (10 Gbit/5 Gbit/2.5 Gbit/1 Gbit/100 Mbit), supporting 2 RJ-45 ports
meetdilip
meetdilip #35
Feb 14, 2020 at 9:58 PM
Thanks to all your suggestions. I now have a CAT5e cable long enough to connect between the 2 PCs. When I ping the headless, it goes fine. But when I SSH, it shows

~$ ssh mls@192.168.1.211
ssh: connect to host 192.168.1.211 port 22: Connection refused

I am not sure what I wrong. On the headless, I can see the ethernet port LED light. When I use GUI, everything is fine as well.

Tried through Nautilus. There is no sign of folder I shared in headless. Any ideas to fix will be great.

PS : When I tried with a different CAT6 cable a week back, everything was fine.
topgear
topgear #36
Feb 22, 2020 at 8:04 AM
Thanks to all your suggestions. I now have a CAT5e cable long enough to connect between the 2 PCs. When I ping the headless, it goes fine. But when I SSH, it shows



I am not sure what I wrong. On the headless, I can see the ethernet port LED light. When I use GUI, everything is fine as well.

Tried through Nautilus. There is no sign of folder I shared in headless. Any ideas to fix will be great.

PS : When I tried with a different CAT6 cable a week back, everything was fine.

Are you using Raspberry ?
Did you enabled SSH ?

If you are booting from MicroSD card just create a new file and name it "SSH" with out the quotes and any extension on the root of the microsd card.

You can also enable it from GUI though from raspberry settings ( Start > Preferences > Raspberry Pi Config > Interface tab ).
topgear
topgear #38
Feb 22, 2020 at 8:43 AM
No



Yes

--
I got the setup bad. Somehow the static IP got removed from the client PC. I restored it and now it is fine. Thanks.

what version of linux ( or any other OS ) you are using ?
meetdilip
meetdilip #39
Feb 22, 2020 at 8:46 AM
18.04. It suits me the best.
topgear
topgear #40
Feb 22, 2020 at 9:00 AM
18.04. It suits me the best.

Ohk .. got it. You are using Ubuntu

Did you go through these links :

Enable SSH on Ubuntu 18.04 Bionic Beaver Linux - LinuxConfig.org
*linuxize.com/post/how-to-enable-ssh-on-ubuntu-18-04/
meetdilip
meetdilip #43
Mar 4, 2020 at 7:39 AM
Nice video.