# Connect 2 PCs, LAN cable ?



## meetdilip (Jan 29, 2020)

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)

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)

SaiyanGoku said:


> you need to assign them different IP



Thanks. Just like we assign the static IP for broadband ? 



SaiyanGoku said:


> but within same subnet.



Can you give an example ? I use Railwire.



SaiyanGoku said:


> Then just browse to the path where the files are stored.



Through Nautilus ?


----------



## meetdilip (Jan 29, 2020)

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.


----------



## billubakra (Jan 29, 2020)

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)

billubakra said:


> 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 (Jan 29, 2020)

meetdilip said:


> 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)

Here I have both machines on Ubuntu. Thanks.


----------



## Zangetsu (Jan 29, 2020)

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 (Jan 29, 2020)

Zangetsu said:


> 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.


----------



## SaiyanGoku (Jan 29, 2020)

@whitestar_999 

Sent from my ONEPLUS A3003 using Tapatalk


----------



## Zangetsu (Jan 29, 2020)

meetdilip said:


> 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 (Jan 29, 2020)

Zangetsu said:


> 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 (Jan 29, 2020)

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 (Jan 30, 2020)

Yes, they are cross over LAN cables


----------



## meetdilip (Jan 30, 2020)

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 (Jan 30, 2020)

meetdilip said:


> When does it become LAN ?
> 
> 1. When 2 PCs connected through LAN cable and has OS



Enough


----------



## meetdilip (Jan 30, 2020)

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 (Feb 1, 2020)

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 (Feb 1, 2020)

patkim said:


> Check what link speed is shown on both systems.



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



patkim said:


> 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 (Feb 1, 2020)

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 (Feb 1, 2020)

meetdilip said:


> 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 (Feb 1, 2020)

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

```
sudo –s
```
Type your admin password

```
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. 
	
	



```
ethtool eth1
```

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




 
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 (Feb 1, 2020)

TigerKing said:


> And for Ubuntu I don't know.



It is working, on Ubuntu as well. 



TigerKing said:


> I would suggest to buy it from local, cables are costly online.



Looked like it was costly offline. Thanks.



patkim said:


> Did you try copying a single large file? Are results still poor with a single large file?.



No, I haven't. I am not sure what I tried. Thanks for your suggestions on cable.


----------



## meetdilip (Feb 1, 2020)

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 (Feb 1, 2020)

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 (Feb 1, 2020)

meetdilip said:


> 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 (Feb 1, 2020)

They were asking ₹ 700 for 10m last year. Now after 6 months, they might settle for 1k. 



TigerKing said:


> You should look for cat 7 also.



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


----------



## topgear (Feb 8, 2020)

meetdilip said:


> 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 (Feb 8, 2020)

That is CAT5. I bought CAT6. Obviously they were taking advantage of ignorance.

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


----------



## topgear (Feb 8, 2020)

meetdilip said:


> 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 (Feb 8, 2020)

meetdilip said:


> 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 (Feb 8, 2020)

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 (Feb 8, 2020)

meetdilip said:


> 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
> ...



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 (Feb 14, 2020)

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 (Feb 22, 2020)

meetdilip said:


> 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
> 
> 
> 
> ...



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 ).


----------



## meetdilip (Feb 22, 2020)

topgear said:


> Are you using Raspberry ?



No



topgear said:


> Did you enabled SSH ?



 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.


----------



## topgear (Feb 22, 2020)

meetdilip said:


> No
> 
> 
> 
> ...



what version of linux ( or any other OS ) you are using ?


----------



## meetdilip (Feb 22, 2020)

18.04. It suits me the best.


----------



## topgear (Feb 22, 2020)

meetdilip said:


> 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 (Feb 22, 2020)

meetdilip said:


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



I got it fixed.


----------



## TigerKing (Mar 4, 2020)




----------



## meetdilip (Mar 4, 2020)

Nice video.


----------

