#[SOLVED] Setting up a "permanent" LAN between Linux and Windows machines?

18 messages · Page 1 of 1 (latest)

vocal walrus
#

I have two desktop computers, one with LMDE6, the other with Win10. I get internet by USB-tethering my phone.

I can currently get a LAN set up by connecting the two computers, tethering the phone to my Windows one, and enabling internet sharing on the latter connection.
The problem with this is that I have to set this up whenever the computers are shut down (i.e. has to go from "sharing disabled" -> "computers connected" -> "sharing enabled"), and only works with the internet shared from Windows to Linux.
Other setups I've tried (connecting the computers without sharing, or sharing internet from Linux to Windows, all without configuring much further than setting up static IPv4 addresses) result in Linux constantly reporting a connection failure ("connecting" -> "connected" -> "unplugged", repeat ad infinitum).

I would prefer having the internet shared from my Linux machine to my Windows one, all without having to reconfigure the network every time I boot. Any clue on how to accomplish this?

wide tangle
#

You can, by simply setting static IP where the gateway of one is the IP of the other

#

But you still have to share your internet to it via a bridge

vocal walrus
wide tangle
#

Basically

#

It creates a bridge interface between your Internet source and LAN

vocal walrus
#

Ok, now it connects the two computers successfully, but the Windows one doesn't get internet.

#

Didn't set up a DNS while setting the static IP, might that be the cause?

#

@wide tangle Tried using the Linux PC's address, the DNS address reported on the tethered USB connection, and 1.1.1.1 - still no internet on Windows PC.

elfin blade
#

Did you get it working @vocal walrus ? I am attempting to set up a bridge too but as of yet been unsuccessful.

vocal walrus
vocal walrus
#

Update: Setting the IP/mask/gateway/DNS manually on Linux while sharing from Windows still leads to no internet on the former unless you turn sharing on the latter off and on again.

vocal walrus
#

Update: Followed https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/security_guide/sec-configuring_nat_using_nftables#sec-Configuring_masquerading_using_nftables (using the device name listed in network connections instead of the example's "ens3"), Windows now appears to report internet connectivity, but DNS doesn't seem to work (i.e. can ping IP addresses such as 1.1.1.1, but can't load web pages).

#

Have attempted to set DNS manually (using the aforementioned 1.1.1.1 DNS as well as trying the gateway IP, i.e. the one that points to my Linux machine, had no effect).

vocal walrus
#

Update: Tried disabling firewall, and the Windows machine suddenly had DNS access. Adding a rule to firewall to allow all port 53 (DNS) traffic did not help.

vocal walrus
#

Update: The issue was resolved with help from https://pario.no/2009/05/24/ufw-and-ip-masquerading/, specifically the following:

First, packet forwarding needs to be enabled in ufw. Two configuration files will need to be adjusted, in /etc/default/ufw change the

DEFAULT_FORWARD_POLICY

to “ACCEPT”:

DEFAULT_FORWARD_POLICY="ACCEPT"

Then edit /etc/ufw/sysctl.conf and uncomment:

net.ipv4.ip_forward=1

#

(also needed to restart the firewall for the changes to apply)

#

@wide tangle Thanks for the initial assistance.
@elfin blade Hopefully (at least some of) this has been helpfull to you as well.