LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 11-23-2022, 10:35 AM   #1
TheJooomes
Member
 
Registered: May 2019
Posts: 190

Rep: Reputation: Disabled
"Destination Net Unreachable" | trying to share internet to a desktop machine over direct ethernet connection


My laptop connects to the internet wirelessly through a mobile hotspot. I directly connected the laptop to my desktop PC over an ethernet cable. I'm trying to share my laptops internet connection with my desktop this way. I can ping each machine's IP from the other machine successfully, and can SSH both ways successfully. This issue is the desktop can't ping the internet; it says "Destination Net Unreachable". I've tried pinging google.com and voidlinux.org.

Both machines use NetworkManager on Void Linux. I set the laptop's IPv4 method to "Shared to other computers", and the desktop's method to "Link-Local". I also tried "Automatic" on the desktop and same result.

Please may I have some help getting this to work.
 
Old 11-23-2022, 12:38 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,707

Rep: Reputation: 5898Reputation: 5898Reputation: 5898Reputation: 5898Reputation: 5898Reputation: 5898Reputation: 5898Reputation: 5898Reputation: 5898Reputation: 5898Reputation: 5898
I have not played with Void but Network Manager uses dsnmasq as a DHCP server for its internet connection sharing.
Make sure whatever address you use for the ethernet adapter is not in the same subnet as the wifi connection.

All the settings for dnsmasq should be in /etc/NetworkManager/dnsmasq-shared.d/ but I do not know how it is configured in Void. I assume but verify that all the necessary firewall rules have been added for NAT masquerading and that ip_forwarding is enabled.
 
Old 11-24-2022, 01:04 AM   #3
pingu_penguin
Member
 
Registered: Aug 2004
Location: pune
Distribution: Slackware
Posts: 350

Rep: Reputation: 60
You need to set the laptop , with internet access, as a gateway.

enable ip forwarding (google is your friend) and set the laptop's ip address , as the gateway of the desktop computer.
i.e the laptop should be a gateway for your desktop.
That should do it IMO.
 
Old 11-24-2022, 01:09 AM   #4
pingu_penguin
Member
 
Registered: Aug 2004
Location: pune
Distribution: Slackware
Posts: 350

Rep: Reputation: 60
On a additional note, you need to set the dns on the desktop too.
 
Old 11-24-2022, 09:17 AM   #5
TheJooomes
Member
 
Registered: May 2019
Posts: 190

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pingu_penguin View Post
You need to set the laptop , with internet access, as a gateway.

enable ip forwarding (google is your friend) and set the laptop's ip address , as the gateway of the desktop computer.
i.e the laptop should be a gateway for your desktop.
That should do it IMO.
IP forwarding is enabled. The DNS, IPv4 address, netmask, and gateway (set to laptop's IPv4 address) have been set manually on the desktop. Still can't reach the internet with same error, still can ping the laptop just fine.
 
Old 11-24-2022, 09:39 AM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,707

Rep: Reputation: 5898Reputation: 5898Reputation: 5898Reputation: 5898Reputation: 5898Reputation: 5898Reputation: 5898Reputation: 5898Reputation: 5898Reputation: 5898Reputation: 5898
Have you checked the firewall rules?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
iptables - Reply Forwarding Error / Destination unreachable (Host unreachable) keflex87 Linux - Networking 1 05-12-2015 12:03 AM
Network is Unreachable/Unknown host/Destination Host Unreachable [Debian] denv Linux - Networking 4 03-27-2014 02:58 PM
[SOLVED] Snort Signature: ICMP Destination Unreachable Port Unreachable very noisy mhollis Linux - Security 4 08-15-2011 02:01 PM
wireless to ethernet bridge: destination host unreachable browny_amiga Linux - Wireless Networking 3 06-02-2009 11:20 AM
tftp - "Destination Unreachable" due to "Port Unreachable" renjithgopal Linux - Security 5 07-24-2003 10:36 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 01:22 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration