William A. Kennington III | bca1071 | 2024-08-07 00:49:29 -0700 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # Copyright 2024 Google LLC |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | |
| 16 | # shellcheck source=meta-google/recipes-google/networking/gbmc-bridge/gbmc-br-lib.sh |
| 17 | source /usr/share/gbmc-br-lib.sh || exit |
| 18 | |
William A. Kennington III | 8f12660 | 2024-09-04 15:14:14 -0700 | [diff] [blame] | 19 | update_rtr() { |
| 20 | true |
| 21 | } |
| 22 | |
William A. Kennington III | bca1071 | 2024-08-07 00:49:29 -0700 | [diff] [blame] | 23 | update_fqdn() { |
William A. Kennington III | 8f12660 | 2024-09-04 15:14:14 -0700 | [diff] [blame] | 24 | (( IP_OFFSET == 0 )) && return |
| 25 | default_update_fqdn "$@" |
William A. Kennington III | bca1071 | 2024-08-07 00:49:29 -0700 | [diff] [blame] | 26 | } |
| 27 | |
| 28 | update_pfx() { |
William A. Kennington III | 8f12660 | 2024-09-04 15:14:14 -0700 | [diff] [blame] | 29 | local pfx="$1" |
| 30 | (( IP_OFFSET == 0 )) && return |
| 31 | gbmc_br_set_ip "$pfx" || true |
| 32 | echo "IP $pfx set on $RA_IF" >&2 |
William A. Kennington III | bca1071 | 2024-08-07 00:49:29 -0700 | [diff] [blame] | 33 | } |
| 34 | |
| 35 | RA_IF=gbmcbr |
| 36 | IP_OFFSET=@IP_OFFSET@ |
William A. Kennington III | 8f12660 | 2024-09-04 15:14:14 -0700 | [diff] [blame] | 37 | # Use the lowest priority, except for kernel RA discovered routes. |
| 38 | # We want closer NICs to provide a default route if existing. |
| 39 | ROUTE_METRIC=1000 |
William A. Kennington III | bca1071 | 2024-08-07 00:49:29 -0700 | [diff] [blame] | 40 | |
William A. Kennington III | 8f12660 | 2024-09-04 15:14:14 -0700 | [diff] [blame] | 41 | # shellcheck source=meta-google/recipes-google/networking/gbmc-net-common/gbmc-ra.sh |
| 42 | source /usr/share/gbmc-ra.sh || exit |