You are not logged in.

#1 2019-01-03 12:03:59

nikhil-prabhu
Member
Registered: 2019-01-03
Posts: 5

Share laptop WiFi through Ethernet

Hello there. I currently don't have an internet connection set up at home, so I use my mobile data instead. I connect my laptop (running Arch Linux with KDE Plasma) to my phone's hotspot. I recently got an old PC from my uncle, and set up Linux Mint 19 on it. The problem is, the PC doesn't have a wireless network card, and can only use wired internet. I was using USB tethering to share my phone's internet, but it's kinda inconvenient. I want to know how to share my laptop's internet through an ethernet cable to my PC. I've already tried a few things, and none of these have worked :

1) I connected my laptop to my PC with an ethernet cable, and set up a shared Ethernet connection from the network settings in KDE's panel. It shows on my laptop that it's connecting to the shared ethernet connection. While it shows this on my laptop, my PC says that it's connected, and I can use the internet normally. But after a few seconds, the shared ethernet stops connecting on my laptop, and says "Never used.". Once this happens, I can't access the internet on my PC anymore, and have to click connect again.

2) I had an old D-Link wireless N300 router lying around in my house. I connected an ethernet cable from my laptop to the internet port of the router, and another ethernet cable from the LAN port of the router to my PC. I set up a new ethernet connection on my laptop, and set a static IP for it. It shows that it's connected, and my PC also says that a wired connection is now active. But I can't access anything on the internet on my PC. However, I can SSH into my laptop from my PC (doesn't work the other way around). Also, when this ethernet connection is active, the WiFi on my laptop automatically stops working after about 10 minutes. I have to disconnect both the WiFi and Ethernet connections, and then reconnect the WiFi to make it work again.

Any help is appreciated. Let me know if any more details are required.

Offline

#2 2019-01-03 12:19:12

bugsmanagement
Member
Registered: 2017-04-21
Posts: 175

Re: Share laptop WiFi through Ethernet

Hello there

I am a bit confused, you want to share internet connection from your laptop?

Regards

Offline

#3 2019-01-03 12:29:16

nikhil-prabhu
Member
Registered: 2019-01-03
Posts: 5

Re: Share laptop WiFi through Ethernet

Yes. Basically, I want my laptop to forward my phone's mobile data to my PC through ethernet. What I'm trying to achieve is:

Mobile data -------> (through hotspot) -------> laptop -------> (through ethernet) -------> PC

Offline

#4 2019-01-03 12:36:36

bugsmanagement
Member
Registered: 2017-04-21
Posts: 175

Re: Share laptop WiFi through Ethernet

It's definitely possible, AFAIK, you going need a twisted pair Ethernet cable but as far as I know, most cables already set that way?  Static IP for the PC? If so, that would be easiest part, you just need setup forwarding on the laptop https://wiki.archlinux.org/index.php/Internet_sharing,

Offline

#5 2019-01-03 12:42:45

nikhil-prabhu
Member
Registered: 2019-01-03
Posts: 5

Re: Share laptop WiFi through Ethernet

Actually, the PC has a dynamic IP. I set a static IP for my laptop. And I forgot to mention in my post, but I've already tried the packet forwarding thing from the link that you've mentioned. I've even made the change persistent. But it still doesn't work. sad

Also, how do I check whether my Ethernet cable is a twisted pair?

Last edited by nikhil-prabhu (2019-01-03 12:43:18)

Offline

#6 2019-01-03 12:45:56

bugsmanagement
Member
Registered: 2017-04-21
Posts: 175

Re: Share laptop WiFi through Ethernet

You going definitely have to explain what you tried and how it failed (welcome to ArchLinux). You not going get the assistance you expect? That means list the steps accurately

Last edited by bugsmanagement (2019-01-03 12:46:22)

Offline

#7 2019-01-03 13:04:13

nikhil-prabhu
Member
Registered: 2019-01-03
Posts: 5

Re: Share laptop WiFi through Ethernet

Well, I tried out every single step in the link that you've mentioned. I tried it out again now too. But it doesn't work at all. In fact, my WiFi stops working when I follow those steps. I have to disconnect and reconnect to get it working again.

Offline

#8 2019-01-03 13:06:46

bugsmanagement
Member
Registered: 2017-04-21
Posts: 175

Re: Share laptop WiFi through Ethernet

It would be harder to help if you don't explain.

Offline

#9 2019-01-03 13:23:05

nikhil-prabhu
Member
Registered: 2019-01-03
Posts: 5

Re: Share laptop WiFi through Ethernet

Okay, so I followed every single step from this link : https://wiki.archlinux.org/index.php/Internet_sharing, but it doesn't work. To be more specific, this is what I did:

1) Connected my PC and laptop together using an Ethernet cable.
2) Set a static IP address for my ethernet device on my laptop.
3) Enabled packet forwarding on my laptop, and made it persistent by editing /etc/sysctl.d/30-ipforward.conf
4) Enabled NAT with iptables
5) Set up dhcpcd on my Linux Mint PC and allowed incoming connections to UDP port 67 and UDP/TCP port 53

Despite doing all this, my PC is still not able to access the internet.

Last edited by nikhil-prabhu (2019-01-03 13:23:30)

Offline

#10 2019-01-03 13:36:24

bugsmanagement
Member
Registered: 2017-04-21
Posts: 175

Re: Share laptop WiFi through Ethernet

Ahh, not those steps, what command you ran ?


nikhil-prabhu wrote:

4) Enabled NAT with iptables

This is ambiguous, is probably where it fails

Offline

Board footer

Powered by FluxBB