summaryrefslogtreecommitdiff
path: root/src/etc/dhcp/dhclient-enter-hooks.d
diff options
context:
space:
mode:
authorDmitri Toubelis <dtoubelis@users.noreply.github.com>2022-05-05 01:41:45 -0400
committerGitHub <noreply@github.com>2022-05-05 01:41:45 -0400
commit0c00e7bf8b6e68814607fde4ff0cd70ce9f4b486 (patch)
tree4b32a8dfd1ed2521edd841a32a87ce5b2cd06745 /src/etc/dhcp/dhclient-enter-hooks.d
parent2c29a3b3b46c7570f4a509f413b208348c0ce647 (diff)
downloadvyos-1x-0c00e7bf8b6e68814607fde4ff0cd70ce9f4b486.tar.gz
vyos-1x-0c00e7bf8b6e68814607fde4ff0cd70ce9f4b486.zip
T4405: Fix administrative distance of DHCP routes
- Default dhclient script only uses value of `$IF_MERIC` envvar for default route recived via `router` option. - This variable has no effect on rotes received via `rfc3442-classless-static-routes` option - Considering that Vyos overrrides `ip` command originating from `dhclient` this can be easily fixed in `iptovtysh()` function by using the `$IF_METRIC` envvar directly in the dhclient hook.
Diffstat (limited to 'src/etc/dhcp/dhclient-enter-hooks.d')
-rw-r--r--src/etc/dhcp/dhclient-enter-hooks.d/03-vyos-ipwrapper2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/etc/dhcp/dhclient-enter-hooks.d/03-vyos-ipwrapper b/src/etc/dhcp/dhclient-enter-hooks.d/03-vyos-ipwrapper
index fc035766b..2bd2d1d22 100644
--- a/src/etc/dhcp/dhclient-enter-hooks.d/03-vyos-ipwrapper
+++ b/src/etc/dhcp/dhclient-enter-hooks.d/03-vyos-ipwrapper
@@ -23,7 +23,7 @@ function iptovtysh () {
local VTYSH_GATEWAY=""
local VTYSH_DEV=""
local VTYSH_TAG="210"
- local VTYSH_DISTANCE=""
+ local VTYSH_DISTANCE=$IF_METRIC
# convert default route to 0.0.0.0/0
if [ "$4" == "default" ] ; then
VTYSH_NETADDR="0.0.0.0/0"