[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: sharing a network connection from debian to non-debian



On 1/17/2021 8:25 AM, Andrei POPESCU wrote:
On Sb, 16 ian 21, 10:28:43, Dan Hitt wrote:

I made sure that the 'Ethernet' tab had the mac addr of the right device
--- it's a usb/ethernet cable, and has a long name, so it would be hard to
confuse it with enp2s0 (the connection to the 'internet-modem').

In the 'IPv4 Settings' tab, the method i have selected is 'Shared to other
computers'.  There's a text area below, marked 'Address (optional)'.

In that optional area i put the ip address of my debian machine, with '24'
for the netmask.  The ip address for my debian machine, that i want to use
for this LAN, is consistent with what 'ip addr show' displays.  It's kind
of unclear what to write for a gateway --- should i put in the address of
my debian box, or the address of the internet modem (router)?  Anyhow, i
tried them both, and neither one worked.


As the server has already internet and working fine, you don't have to
do anything on the server.

I also tried just deleting the 'Address (optional)' section, since it says
it is optional.  But this also had no effect.

I also added an extra ip address to the usb/ethernet link on my debian
machine, using
        sudo ip addr add 10.X.Y.Z/24  dev enx**********
and this becomes instantly visible to the other system.   So i think the
other system is properly accessing my debian system.

Looks like it, indeed.


Note that this change is not permanent, thus won't be save while rebooting.

So, thanks for any clarification anybody has to offer on the proper usage
of nm-connection-editor.

As far as I recall (it's been a while) it was as easy as setting the
Shared... in nm-connection-editor. Network Manager should then take care
to enable forwarding in the kernel and run a DHCP/DNS caching server
(probably dnsmasq) on that interface.

How are the other boxes configured? They should either be configured
with DHCP or with static addresses in the same 10.*.*.* network as the
Debian box (mind the netmask!) and Debian's 10.*.*.* IP address as
gateway and DNS server.

It might help to show exactly what the network settings are for the
"internal" connection on Debian and on the other boxes.


In general, if you want to assign one static address per client, the
client would have to use one IP address from the IP subnet used on the
server (10...) in your case).
The gateway and the DNS address would be pointing to the ip of the server.

So in your case something like:
- Server: IP: 10.0.0.1, mask: 255.255.255.0 (CIDR: /24)
- Client1: IP: 10.0.0.2, mask: 255.255.255.0, GW: 10.0.0.1, DNS: 10.0.0.1
- Client2: IP: 10.0.0.3, mask: 255.255.255.0, GW: 10.0.0.1, DNS: 10.0.0.1

Regarding buying a new router, picking one on which you can change the
stock firmware to OpenWrt or alike give you the flexibility of having a
more tweakable router.
One advantage of Dd-Wrt/Tomato or alike is that it is way easier to
reset to factory default incase you screw up! :)

--
John Doe


Reply to: