home | list info | list archive | date index | thread index

Re: [OCLUG-Tech] static ip setup for Linux Mint 18 and similar

  • Subject: Re: [OCLUG-Tech] static ip setup for Linux Mint 18 and similar
  • From: Alex Pilon <alp [ at ] alexpilon [ dot ] ca>
  • Date: Tue, 13 Dec 2016 15:33:57 -0500
On Tue, Dec 13, 2016 at 02:55:00PM -0500, J C Nash wrote:
> It has been useful to sshfs to this desktop to transfer files over LAN, so I
> have used a static IP.

I do not see at all how these two statements have anything to do each
other. LAN does not imply static IP. Could you elaborate?

Is it just that you used a static IP because you didn't know about
discovery protocols like mDNS+DNS-SD or can't set them up? Any big Linux
distro will have Avahi configured and running, so you should just be
able to use the fake .local TLD. E.g., if my hostname is tplinux, I can
SSHFS to tplinux.local.

Is there some other reason?

General note to all readers, don't use static IPs unless you know you
have a particular need for them.

> The approach was to edit /etc/network/interfaces.

Do you know that that is at all used by the network configuration
management system on your distro. What is the network configuration
management? Is it that legacy system every other distro uses? Is it
NetworkManager? Is it systemd-networkd? Is there even one?

I don't do distro-specific solutions, so you'll have to figure this one
out on your own or with the help of others.

> This does work with Bunsen, but not with LM18. Indeed, it seems to mess up networking.

If you want to understand what the heck is going on, ignore all the
distro-specific morass/molasses (either one is a fine description), and
just look at what the kernel thinks the network parameters are, and
understand the network parameters are… unless you're trying to debug how
those parameters are being set.

What is the real problem? The former (e.g., that your machines really
thus can't talk to each other), or the latter (e.g., that you're trying
to figure out why your parameters are set incorrectly).

> Running ifconfig

ifconfig will soon disappear from all sane systems. It has a host of
problems, not just internal technical, but also usability and
correctness. Use iproute2. See

    http://unix.stackexchange.com/questions/93412/difference-between-ifconfig-and-ip-commands/93461#93461

So, `ip -4 address show scope global` (verbose, remove all the noise), or
just `ip a` (if you don't mind *some* noise in the output). `ip -4 r
show scope global` to see the non-link IPv4 routes.

> (with original DHCP)

Beg your pardon. I don't understand the statement. What is “original”
DHCP? What does that mean?

> shows the interface has name enp3s0,

Distros switched to interface names that reflect the bus topology a few
years ago, so that interface names would be predictable on boot, or at
least predictable on more obvious attributes that aren't as
system-specific.

> Anyone else had experience with this. I can manage with the DHCP
> setup, but it would be nice to know what's going on.

KISS. Drop all the legacy. If only on desktop and only at home, just
install dhcpcd, enable it, start it, and enjoy the simplicity. That or
go mess with the systemd-networkd config (simple, but marginally more
error-prone). Never use static IP again.

Regards,

Alex Pilon