0

This is my interfaces file:

    # This file describes the network interfaces available on your system
    # and how to activate them. For more information, see interfaces(5).

    source /etc/network/interfaces.d/*

    # The loopback network interface
    auto lo
    iface lo inet loopback

    # The primary network interface

    auto ens3
    iface ens3 inet static
        address 192.168.3.202/24
        gateway 192.168.3.1
        dns-nameservers 192.168.3.200

Whenever I restart networking of do ifdown ens3 and ifup ens3, it still asks for a dhcp ip, and it gets a dhcp ip in addition to the static ip that is configured above. I'd rather it didnt and took the static ip only.

I don't have network manager installed.

Sirius
  • 101
  • 1

3 Answers3

0

Most likely dhcp queries aree caused by other configuration files.
Which dchp clients are installed?

man interfaces

The dhcp Method
This method may be used to obtain an address via DHCP with any of the tools: dhclient, pump, udhcpc, dhcpcd. (They have been listed in their order of precedence.) If you have a complicated DHCP setup you should note that some of these clients use their own configuration files and do not obtain their configuration information via ifup.

AnFi
  • 5,883
  • 1
  • 12
  • 26
  • I did: locate dhcp And based on that output picked a file, and: $ dpkg -S /etc/dhcp/dhclient.conf isc-dhcp-client: /etc/dhcp/dhclient.conf So I definitely have **isc-dhcp-client** installed. Based on some of the other matches above I'm pretty sure this is the only dhcp client installed. I tried uncommenting everything in dhclient.conf, but this did not change what I see – Sirius Dec 04 '20 at 13:58
0

I had to do the following two things

    systemctl stop systemd-networkd
    systemctl disable systemd-networkd
    systemctl stop systemd-networkd.socket
    systemctl disable systemd-networkd.socket
Sirius
  • 101
  • 1
  • Note that you have disabled the new network configuration method, and you are continuing to use the antiquated method. At most one of these methods should be enabledf. – Michael Hampton Dec 04 '20 at 15:41
  • I don't see that I need anything on offer than what I already get with the interfaces file. What's anitquated about it, apart from being mature? – Sirius Dec 07 '20 at 14:39
0

Another way is to delete /etc/network/interfaces and /etc/network/interfaces.d/ , reboot and check what nmcli has to say about your interfaces. The tool called nmcli should be a part of a package called network-manager . Maybe make sure you have nmcli in the system, before you zap those legacy config files (or just move them into a backup location instead of deletion).

frr
  • 261
  • 3
  • 6