From nobody Wed Aug 28 15:40:38 2024 X-Original-To: freebsd-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 4Wv7sv65Fmz52TXL for ; Wed, 28 Aug 2024 15:40:51 +0000 (UTC) (envelope-from fjwcash@gmail.com) Received: from mail-yb1-xb33.google.com (mail-yb1-xb33.google.com [IPv6:2607:f8b0:4864:20::b33]) (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 4Wv7st5fpQz4Vfp for ; Wed, 28 Aug 2024 15:40:50 +0000 (UTC) (envelope-from fjwcash@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-yb1-xb33.google.com with SMTP id 3f1490d57ef6-e02c4983bfaso7353191276.2 for ; Wed, 28 Aug 2024 08:40:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724859650; x=1725464450; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=cX+68ZFV7yrRDEPh5FMGemWqKdOoMov9i5M/klioCMQ=; b=U2boO1a5oAvHBUCEKJfz1Qo9lTzFVH6bwnziCXYoZjHsYSFe5FqME1H2pbjHsDZNyI BbLW5vuZTERPsdtIsWuVuGVbpavqhzncUUZlJaYL8cSwc4mR1LMODIOHgl5WJT/y+roZ QCx6wjc+VtRJNBfrKRn+5GALIQZIdczpQ3K8NPCIx4P4xXdG2vE2taFzRP4TV9iLK01Z JtQ1HkjdRq1TmYwu0WL3UD2Kthpw5rfqXI1Ht7TQllpHgW8DMs9MVQ0Y+SPDejK7p3lZ KlyElsYNd3ZnPUnamvG5NK9omYtxTIw7an6BzX8CDVSOxTXQsxPmFcZJFgQappiSx5tF UxEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724859650; x=1725464450; h=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=cX+68ZFV7yrRDEPh5FMGemWqKdOoMov9i5M/klioCMQ=; b=Y44fheUHaT0X+ekanNN8oZ4kKmpOHjjZRXrnH8fMSLkTTmMIBxpT/tuPiSnUN51u50 O5dAiksrjlTMlTyMg4CkxmX9LaERRYMF0uxVm9idOzOAe9oRBYBLE1+RVncJqg8cGVFi mMPY7+XQvm9yffZyem5xncNZsJOACHpZHIYfc7LGFeyFTqSdiijXAhJaIu65PASYB8HO Nz3ZGh4n/utV2isMZS3pqlBHXtkI8BcH6AIcxwkSr51Kn1EfKawmti/7V24Qa7ZJbUPO b9onWuX4fw4ETDqmH7kldRSrtsvlWaVRiP+znAw2nqVI93ntKd8NtrtfzI1f14rxRxjz OtpQ== X-Gm-Message-State: AOJu0YzUFMI5qgojPlGnFwrmGEtWrtEkoP+EZXAe56v9Vb0jWfmKhT2k Tm24/mqs8CK8OQn7+dOuNuJmhb9QB+ezvfY/nAahnH0Gel2Lmmz5E9g3bErITNwV+AwBo931Y4E vf0JRm1q5o5mqVuHpGjOyAO+rnAeYqQ== X-Google-Smtp-Source: AGHT+IHozlCgL+/Lb0T1LIve3k+opmGf9jK5EXoxdztl1zke1+6wwHZOePPW03qdI549TCRUMgc/FgLQ0EVjqT3HWi8= X-Received: by 2002:a05:6902:1703:b0:e11:7b16:9484 with SMTP id 3f1490d57ef6-e17a83bd00bmr20264543276.2.1724859649667; Wed, 28 Aug 2024 08:40:49 -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: In-Reply-To: From: Freddie Cash Date: Wed, 28 Aug 2024 08:40:38 -0700 Message-ID: Subject: Re: wait link up before route configuration To: "yann.masson@thehomecave.fr" Cc: freebsd-net@freebsd.org Content-Type: multipart/alternative; boundary="000000000000b4bb1a0620c02e48" 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:2607:f8b0::/32, country:US] X-Rspamd-Queue-Id: 4Wv7st5fpQz4Vfp --000000000000b4bb1a0620c02e48 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Aug 28, 2024 at 1:21=E2=80=AFAM yann.masson@thehomecave.fr < yann.masson@thehomecave.fr> wrote: > After configuring interfaces and routes, and triggering a 'service netif > restart && service routing restart' is there a way to wait for the 'carri= er > up' of the interface before route reconfiguration? My use case is a serve= r > with 2 Mellanox and a Lagg. The 2 mce interfaces are UP in milliseconds b= ut > the lagg interface takes a few seconds to be UP, and the routing service > says 'Network unreachable'. The subnet is a /32 and the gateway need a > static route like: # /etc/rc.conf.d/netif cloned_interfaces=3D"lagg0" > ifconfig_mce0=3D"up" ifconfig_mce1=3D"up" ifconfig_lagg0=3D"laggproto lac= p > laggport mce0 laggport mce1 198.51.100.1 netmask 255.255.255.255 mtu 1500= " > # /etc/rc.conf.d/routing route_defaultgw=3D"-host 203.0.113.1 -link > -interface lagg0" defaultrouter=3D"203.0.113.1" static_routes=3D"defaultg= w" If > I run 'service netif restart && sleep 5 && service routing restart', > everything is ok. I didn't find any options for that, and was thinking > about a patch in the routing script. Thanks > Read through the comments in /etc/rc.d/netwait as that should do what you're looking for (wait until the interface is active or wait until you get a ping response from an IP before continuing with network configuration). --=20 Freddie Cash fjwcash@gmail.com --000000000000b4bb1a0620c02e48 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Wed, Aug 28, 2024 at 1:21=E2=80=AFAM <= a href=3D"mailto:yann.masson@thehomecave.fr">yann.masson@thehomecave.fr= <yann.masson@thehomecave.= fr> wrote:
=20 =20 =20

After configuring interfaces and routes, and triggering a 'service = netif restart && service routing restart' is there a way to wait for the 'carrier up' of the interface before= route reconfiguration? My use case is a server with 2 Mellanox and a Lagg. The 2 mce interfaces ar= e UP in milliseconds but the lagg interface takes a few seconds to be UP, and the routing service sa= ys 'Network unreachable'. The subnet is a /32 and the gateway need a static route like: # /etc/rc.conf.d/netif cloned_interfaces=3D"lagg0" ifconfig_mce0=3D"up" ifconfig_mce1=3D"up" ifconfig_lagg0=3D"laggproto lacp laggport mce0 laggport mce1 198.51.10= 0.1 netmask 255.255.255.255 mtu 1500" # /etc/rc.conf.d/routing route_defaultgw=3D"-host 203.0.113.1 -link -interface lagg0" defaultrouter=3D"203.0.113.1" static_routes=3D"defaultgw" If I run 'service netif restart && sleep 5 && service r= outing restart', everything is ok. I didn't find any options for that, and was thinking about a patch in t= he routing script. Thanks

Read through the comments in /etc/rc.d/netwait as that s= hould do what you're looking for (wait until the interface is active or= wait until you get a ping response from an IP before continuing with netwo= rk configuration).

--
Fre= ddie Cash
fjwcash= @gmail.com
--000000000000b4bb1a0620c02e48--