diff options
author | Christian Poessinger <christian@poessinger.com> | 2021-03-09 08:59:13 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-09 08:59:13 +0100 |
commit | dfdbcb4e52ab67892c7dc50d6e82b1b7aef8eeb2 (patch) | |
tree | af975d3502a620252dbf66b09821f6c98ff909f8 | |
parent | 370d2d817f87418be15952af15e686badef4f687 (diff) | |
parent | ce0600e97baec18c1781605f3a80c26d4ed01e2b (diff) | |
download | vyos-1x-dfdbcb4e52ab67892c7dc50d6e82b1b7aef8eeb2.tar.gz vyos-1x-dfdbcb4e52ab67892c7dc50d6e82b1b7aef8eeb2.zip |
Merge pull request #763 from bstepler/T3392
dhcp: T3392: fix VRF detection
-rw-r--r-- | src/etc/dhcp/dhclient-enter-hooks.d/03-vyos-ipwrapper | 4 |
1 files changed, 2 insertions, 2 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 8d996209f..fc035766b 100644 --- a/src/etc/dhcp/dhclient-enter-hooks.d/03-vyos-ipwrapper +++ b/src/etc/dhcp/dhclient-enter-hooks.d/03-vyos-ipwrapper @@ -52,8 +52,8 @@ function iptovtysh () { fi # Add route to VRF routing table - local VTYSH_VRF_NAME=$(basename /sys/class/net/$VTYSH_DEV/upper_* | sed -e 's/upper_//') - if [ -n $VTYSH_VRF_NAME ]; then + local VTYSH_VRF_NAME=$(/usr/sbin/ip link show dev $VTYSH_DEV | sed -nre '1s/.* master ([^ ]*) .*/\1/p') + if /usr/sbin/ip -d link show dev $VTYSH_DEV | grep -q "vrf_slave"; then VTYSH_VRF="vrf $VTYSH_VRF_NAME" fi VTYSH_CMD="ip route $VTYSH_NETADDR $VTYSH_GATEWAY $VTYSH_DEV tag $VTYSH_TAG $VTYSH_DISTANCE $VTYSH_VRF" |