From nobody Mon Jun 9 15:00:40 2025 X-Original-To: net@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGFVT2S8cz5yFcb for ; Mon, 09 Jun 2025 15:01:05 +0000 (UTC) (envelope-from pprocacci@gmail.com) Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGFVS3DrFz3XwK; Mon, 09 Jun 2025 15:01:04 +0000 (UTC) (envelope-from pprocacci@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ed1-x52f.google.com with SMTP id 4fb4d7f45d1cf-60789b450ceso4893960a12.2; Mon, 09 Jun 2025 08:01:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1749481257; x=1750086057; darn=freebsd.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=o0DtxHZT+n1WDOQYhAL2R5bpfIwKrOG7Xxor4XUdXeM=; b=LwUuSLhEofsTkMLiQ2OfsuZOzTa7FahcJgutbRsFFFLn8glNSosERv2VcLOKbU2DZY +Z+Vz/EpeuMNCiLUV8Fmp/lLi/GpPnWLuSIx+Oi269St/DSv6NANeHI8YIAMmVL5veYw hzJC2Oj4uovaeJ4fP3Ra6BfM4GPByytZE03qAq2A7ralIGkgE9TaG/MHkF8f20ahNLfx zWhCx1yAzAji0keTCkCyqUXEkDScQ6bVtyngABre1StkyTyNaiQ2xQhK3sod+vUn1VBJ 1aW62TzsU06dO6qqyalTs6ZnRguWwLx6ECXnD6ItFNkgKn35knjbXxqNRiSyL3rSb2Dj YRqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749481257; x=1750086057; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=o0DtxHZT+n1WDOQYhAL2R5bpfIwKrOG7Xxor4XUdXeM=; b=bS6ymFVN99bgNIEqePeWQHKgncu+l7WK160qwmlIw+JvxrMEinZJA7/A1BPY9DErsi Bl5v204F0NEjEaeSZBpRKcVqPkCbsneXUsSjkFB+yBPibr4dJmgI01E/S1SmoWjhpYui aJZ/K0oyb7gCXWCnKV2zjmqkoI8ciSKWr2Rqep0glDKRGWbvxYMuL6PqmzR1OPTV9p4/ JxaY1PT9Hbtg323qbl+/5zHk/bOwcQlHL5nUxaXjzxPL1j+ldu/bpbtDM3wXdhUFtVPb 0/FS7bafyroFuz/h5fNY8omgBf/m0Y0Rd0Tv2gaLh4bL2xIhNiVGOLqiBDS6x9qewnWf DGVQ== X-Gm-Message-State: AOJu0YzcDK3Gtrv6Yf7nESHqO2Ww8XzEp4jBIhqP0gWRCQeClM9PL2Bz bPIZu/Mq5WeQ77czm5RE8cFn/UVwDrl2TkNFrBRP1nweZAlTitO5eCl9lG7FpOq36Gu04rfuXzZ HAe7vDIvnd3HlhKHT9NG7SqtUVF6tdj2Hxj8= X-Gm-Gg: ASbGncvmWz6yPuz87MKz+T8jBmsTRz/3oTcqy+a5I8qiMYv9wEjIdtVc6wczhZ+O4jH swpg6X/czvPo7gVOjyROPWxwS3erMutkTSsfT4/aMhEXnzTyk02ycRuL+syy21w8roJDDuoHedr bQncBAEZ+Q1XFpjf6LvhuwR0rAsaTtDQ== X-Google-Smtp-Source: AGHT+IHcrD3aTsZTpeKXQ4MBd2E5riH5PSoTlv45IkaVlfydHRQcg2+MhDPFa8wCYOimUJJ2QRKqM2tZ+/4zM1lFAnQ= X-Received: by 2002:a17:907:96a2:b0:ade:7bd:e0ec with SMTP id a640c23a62f3a-ade1a9eefc4mr1121800366b.56.1749481251644; Mon, 09 Jun 2025 08:00:51 -0700 (PDT) List-Id: Networking and TCP/IP with FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-net List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-net@FreeBSD.org MIME-Version: 1.0 References: <895899af-e416-476f-8655-529b28726a01@freebsd.org> In-Reply-To: <895899af-e416-476f-8655-529b28726a01@freebsd.org> From: Paul Procacci Date: Mon, 9 Jun 2025 11:00:40 -0400 X-Gm-Features: AX0GCFsrSwHgo_-5j3d3LxnQVEM5ovKBiJvkDLk9iZ4IouWajKGH6pIIjJFST68 Message-ID: Subject: Re: dhclient vs aliases To: Andriy Gapon Cc: net@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4bGFVS3DrFz3XwK X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] On Mon, Jun 9, 2025 at 10:40=E2=80=AFAM Andriy Gapon wrot= e: > > On 09/06/2025 17:26, Paul Procacci wrote: > > Re: https://forums.freebsd.org/threads/dhclient-trashing-alias-ip-addre= ss-upon-reconnect.58729/ > > > > You can use a dhclient.conf(5) entry like this to guarantee that the > > alias is re-applied every time the interface gets a new address from > > DHCP (or the old lease is re-applied): > > > > Code: > > > > alias { > > interface "em0"; > > fixed-address 10.0.0.3; > > option subnet-mask 255.255.255.0; > > } > > Thank you! > This should work, but it kind of kills a "single source of truth" for jai= l > configurations. > > So, it seems that there is a quirk regarding jail+aliases and DHCP. > > > On Mon, Jun 9, 2025 at 10:20=E2=80=AFAM Andriy Gapon = wrote: > >> > >> > >> Apologies if this is a FAQ and maybe it has always been like that but = I've just > >> noticed this. > >> > >> A switch needed to be rebooted, so on a FreeBSD host a link went down = and then > >> up on an interface connected to the switch. > >> Apparently triggered by those events, dhclient decided to renew the in= terface's > >> IP address. Afterwards, all alias IP addresses on that interface were = cleared. > >> Just in case, the new IP address was exactly the same as the old IP ad= dress > >> (it's "hardwired" in the DHCP server configuration). > >> > >> This was unhelpful because the host runs a number of jails with a simp= le IP > >> configuration via aliases. > -- > Andriy Gapon I haven't personally tested this, but does something akin to the following = work? ifconfig_em0_alias0=3D"DHCP" ifconfig_em0_alias1=3D"DHCP" Assuming you're using dhcp addressing for single source of truths then give this a whirl perhaps. ~Paul --=20 __________________ :(){ :|:& };: