blob: e663cdf4ce8f8d785d25961fc3d5d2549db87f1c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
From: Dermot Bradley <dermot_bradley@yahoo.com>
Date: Wed, 4 Jan 2023 00:23 +0000
Subject: [PATCH] for static executor add "onlink" option to default route
Add the "onlink" next-hop option to the default route. This is required
for situations like some VPS/Cloud Providers where they provide a /32 IPv4
address or a /128 IPv6 address and obviously the router to use as the gateway
for the default route is not in the same subnet.
The ifupdown package has been adding the "onlink" option for the past 7
years when Debian added it:
https://salsa.debian.org/debian/ifupdown/-/commit/8b7bca9597d2f75670b182f0fc149cdbaec3544c
This patch has been submitted upstream to ifupdown-ng as PR #207.
---
diff -aur a/executor-scripts/linux/static b/executor-scripts/linux/static
--- a/executor-scripts/linux/static
+++ b/executor-scripts/linux/static
@@ -33,7 +33,7 @@
configure_gateways() {
for gw in ${IF_GATEWAYS}; do
addrfam=$(addr_family ${gw})
- ${MOCK} ip "${addrfam}" route add default via "${gw}" ${VRF_TABLE} ${METRIC} dev "${IFACE}"
+ ${MOCK} ip "${addrfam}" route add default via "${gw}" ${VRF_TABLE} ${METRIC} dev "${IFACE}" onlink
done
}
|