From nobody Wed Aug 28 08:21:12 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 4Wty6k61msz5PZxk for ; Wed, 28 Aug 2024 08:21:18 +0000 (UTC) (envelope-from yann.masson@thehomecave.fr) Received: from smtp-42a9.mail.infomaniak.ch (smtp-42a9.mail.infomaniak.ch [84.16.66.169]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "relay.mail.infomaniak.ch", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wty6h363Qz4kqS for ; Wed, 28 Aug 2024 08:21:16 +0000 (UTC) (envelope-from yann.masson@thehomecave.fr) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=thehomecave.fr header.s=20230803 header.b=U8DcHKEi; dmarc=none; spf=pass (mx1.freebsd.org: domain of yann.masson@thehomecave.fr designates 84.16.66.169 as permitted sender) smtp.mailfrom=yann.masson@thehomecave.fr Received: from smtp-3-0001.mail.infomaniak.ch (smtp-3-0001.mail.infomaniak.ch [10.4.36.108]) by smtp-4-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4Wty6d51sdzGrb for ; Wed, 28 Aug 2024 10:21:13 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thehomecave.fr; s=20230803; t=1724833273; bh=Yksu7+bOpEO6OFa1miR4yv4/QF7zQ4wXWCvaNoccik0=; h=Date:To:From:Subject:From; b=U8DcHKEiqMp8MYtLR2m25tOKdhtdXGxBPD0ivgCv/IEy4C/VxkGPDRZwRu+pJmk9b qbVGIJFdl+q0t4RYB2QIlPYqmy4AtRPerJa32Ke5HQrfsQk/XrudyS0ej68tuDRgEg +xPFDtz5bwBH25j4ho4boPig8p3XNM5cyTM1Lwvl8SIWYZHScReq3n9BYupmZbdCZA 8hH5iKbxCGg6nAY2kU3uwLspxdpyC5Mqnn9PyjDWEHF3Y4EG1tQYdcZJSay5U12lI7 QcLU0WTxvkZLnRzG4WEb8J+8ObX9HihTC9ZHme97EYXY3h/gpQ6yzaFExWSzz04oW8 4i3c+XmCQQiDw== Received: from unknown by smtp-3-0001.mail.infomaniak.ch (Postfix) with ESMTPA id 4Wty6d2HmDzLp9 for ; Wed, 28 Aug 2024 10:21:13 +0200 (CEST) Content-Type: multipart/alternative; boundary="------------CXebCWEHadZeMXLtr0MEWi1X" Message-ID: Date: Wed, 28 Aug 2024 10:21:12 +0200 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 User-Agent: Mozilla Thunderbird Content-Language: en-US To: freebsd-net@freebsd.org From: "yann.masson@thehomecave.fr" Subject: wait link up before route configuration X-Infomaniak-Routing: alpha X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.67 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_DN_EQ_ADDR(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.98)[-0.981]; R_DKIM_ALLOW(-0.20)[thehomecave.fr:s=20230803]; R_SPF_ALLOW(-0.20)[+ip4:84.16.66.168/29]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; RCVD_IN_DNSWL_LOW(-0.10)[84.16.66.169:from]; RWL_MAILSPIKE_GOOD(-0.10)[84.16.66.169:from]; XM_UA_NO_VERSION(0.01)[]; RCPT_COUNT_ONE(0.00)[1]; ASN(0.00)[asn:29222, ipnet:84.16.64.0/19, country:CH]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; TO_DN_NONE(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; DMARC_NA(0.00)[thehomecave.fr]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MLMMJ_DEST(0.00)[freebsd-net@freebsd.org]; PREVIOUSLY_DELIVERED(0.00)[freebsd-net@freebsd.org]; RCVD_TLS_LAST(0.00)[]; DKIM_TRACE(0.00)[thehomecave.fr:+] X-Rspamd-Queue-Id: 4Wty6h363Qz4kqS This is a multi-part message in MIME format. --------------CXebCWEHadZeMXLtr0MEWi1X Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi 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 are UP in milliseconds but 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="lagg0" ifconfig_mce0="up" ifconfig_mce1="up" ifconfig_lagg0="laggproto lacp laggport mce0 laggport mce1 198.51.100.1 netmask 255.255.255.255 mtu 1500" # /etc/rc.conf.d/routing route_defaultgw="-host 203.0.113.1 -link -interface lagg0" defaultrouter="203.0.113.1" static_routes="defaultgw" 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 --------------CXebCWEHadZeMXLtr0MEWi1X Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit

Hi 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 are UP in milliseconds but 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="lagg0" ifconfig_mce0="up" ifconfig_mce1="up" ifconfig_lagg0="laggproto lacp laggport mce0 laggport mce1 198.51.100.1 netmask 255.255.255.255 mtu 1500" # /etc/rc.conf.d/routing route_defaultgw="-host 203.0.113.1 -link -interface lagg0" defaultrouter="203.0.113.1" static_routes="defaultgw" 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

--------------CXebCWEHadZeMXLtr0MEWi1X--