LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   "Destination Net Unreachable" | trying to share internet to a desktop machine over direct ethernet connection (https://www.linuxquestions.org/questions/linux-networking-3/destination-net-unreachable-%7C-trying-to-share-internet-to-a-desktop-machine-over-direct-ethernet-connection-4175719063/)

TheJooomes 11-23-2022 10:35 AM

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

michaelk 11-23-2022 12:38 PM

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.

pingu_penguin 11-24-2022 01:04 AM

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.

pingu_penguin 11-24-2022 01:09 AM

On a additional note, you need to set the dns on the desktop too.

TheJooomes 11-24-2022 09:17 AM

Quote:

Originally Posted by pingu_penguin (Post 6394040)
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.

michaelk 11-24-2022 09:39 AM

Have you checked the firewall rules?


All times are GMT -5. The time now is 05:26 AM.