• Re: How to disable the dhcp of my machine?

    From Greg Wooledge@21:1/5 to William Torrez Corea on Sun Oct 13 03:10:02 2024
    On Sat, Oct 12, 2024 at 19:00:08 -0600, William Torrez Corea wrote:
    I want to assign a static ip but the dhcp then takes the order and changes the configuration.

    OK. Let's say you're using /etc/network/interfaces and you have the
    default configuration that the installer usually creates:


    # The primary network interface
    allow-hotplug eno1
    iface eno1 inet dhcp


    If you've booted the machine with this configuration, there is a DHCP
    client daemon running, associated with this interface.

    If you simply change this file and then do the ifdown/ifup dance,
    that will not kill the DHCP client daemon. The daemon will continue
    running. After some number of hours, it'll nuke your static IP.

    I'm guessing that's what you did, and what you experienced.

    There are a couple ways to work around this. One way would be:

    a) Edit /etc/network/interfaces.
    b) Reboot.

    That's a simple one, but it's overkill. Another way would be:

    a) Edit /etc/network/interfaces.
    b) Find the running DHCP client daemon and kill it.
    c) Do the ifdown/ifup dance.

    That might the one that most people end up doing.

    A third way would be:

    a) Bring the interface down with ifdown.
    b) Edit /etc/network/interfaces.
    c) Bring the interface up with ifup.

    That's the "cleanest" way. When you bring the interface down while the
    config file still says "dhcp", ifdown will know that there's a running
    DHCP daemon it needs to kill, and it will kill it for you.

    If you edit the file first, ifdown has no idea that there's a running
    DHCP client daemon, so it doesn't kill it for you.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Roger Price@21:1/5 to William Torrez Corea on Sun Oct 13 09:00:01 2024
    On Sat, 12 Oct 2024, William Torrez Corea wrote:

    I want to assign a static ip but the dhcp then takes the order and changes the configuration.

    Perhaps I misunderstand your question, but isn't this a function of the router?,
    not the dhcp client in your machine. Routers often have administrative interfaces where a fixed assignment of MAC against IP can be specified.

    Roger

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From tomas@tuxteam.de@21:1/5 to Roger Price on Sun Oct 13 11:20:01 2024
    On Sun, Oct 13, 2024 at 08:50:58AM +0200, Roger Price wrote:
    On Sat, 12 Oct 2024, William Torrez Corea wrote:

    I want to assign a static ip but the dhcp then takes the order and changes the configuration.

    Perhaps I misunderstand your question, but isn't this a function of the router?, not the dhcp client in your machine. Routers often have administrative interfaces where a fixed assignment of MAC against IP can be specified.

    You /can/ tell the DHCP server (possibly running on "the router") to always assign the same IP to a given client (whatever a "gien client" is in this context -- identified by the MAC or other means).

    But the OP wants, as far as I understand, a *static* IP. Then, no DHCP is involved at all (and no router or any other external piece).

    Cheers
    --
    t

    -----BEGIN PGP SIGNATURE-----

    iF0EABECAB0WIQRp53liolZD6iXhAoIFyCz1etHaRgUCZwuQLAAKCRAFyCz1etHa RvkEAJ9s/HAJXp8SwqjsC9kB6K+6iiEkGwCcDKrUNe2sEbjPR2B/VdJ3DSRjvEk=
    =ewIf
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)