mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-04-20 00:16:38 +02:00
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:
8b7bca9597
This patch has been submitted upstream to ifupdown-ng as PR #207.
30 lines
1.1 KiB
Diff
30 lines
1.1 KiB
Diff
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
|
|
}
|
|
|