meta-google: gbmc-nic-config: Add recipe
This makes it possible for a machine to specify `GBMC_EXT_NICS` in the
machine configuration, signifying that it should treat an interface as
an external interface to the machine. It will then perform DHCP and
acquire gateway information and route all subordinate traffic out this
interface.
Change-Id: I75b0747b4e35bf6717c9a33a1f96a11beb425bb9
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/meta-google/recipes-google/networking/gbmc-nic-config/gbmc-nic-ra.sh b/meta-google/recipes-google/networking/gbmc-nic-config/gbmc-nic-ra.sh
new file mode 100755
index 0000000..98239c3
--- /dev/null
+++ b/meta-google/recipes-google/networking/gbmc-nic-config/gbmc-nic-ra.sh
@@ -0,0 +1,35 @@
+#!/bin/bash
+# Copyright 2024 Google LLC
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+update_rtr() {
+ default_update_rtr "$@"
+}
+
+update_fqdn() {
+ true
+}
+
+update_pfx() {
+ true
+}
+
+RA_IF=$1
+IP_OFFSET=0
+# This is guaranteed to be closer to the ToR than NCSI, for reliability
+# and bandwidth we want to prefer this path.
+ROUTE_METRIC=800
+
+# shellcheck source=meta-google/recipes-google/networking/gbmc-net-common/gbmc-ra.sh
+source /usr/share/gbmc-ra.sh || exit