summaryrefslogtreecommitdiff
path: root/src/conf_mode/vrf.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-04-04 22:01:19 +0200
committerChristian Poessinger <christian@poessinger.com>2020-04-04 22:01:21 +0200
commit2c6737376571959d57095dda2d967bf67feeea8f (patch)
tree9fc867d7c74d9cf3b1e1bc24ca2326910a384a2b /src/conf_mode/vrf.py
parent0d5be614de4e5211f3e615fcce68d02071ef8688 (diff)
downloadvyos-1x-2c6737376571959d57095dda2d967bf67feeea8f.tar.gz
vyos-1x-2c6737376571959d57095dda2d967bf67feeea8f.zip
vrf: T2221: when deleting vrf also delete unreachable route
If the unreachable routes for IPv4 and IPv6 are not deleted, there will be an error when creating the same VRF again after removal. Error changing VRF: Command '['sudo', 'ip', '-4', 'route', 'del', 'vrf', 'Blue', 'unreachable', 'default', 'metric', '4278198272']' returned non-zero exit status 2.
Diffstat (limited to 'src/conf_mode/vrf.py')
-rwxr-xr-xsrc/conf_mode/vrf.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/conf_mode/vrf.py b/src/conf_mode/vrf.py
index 39f9ca978..53ee13bec 100755
--- a/src/conf_mode/vrf.py
+++ b/src/conf_mode/vrf.py
@@ -218,6 +218,8 @@ def apply(vrf_config):
for vrf in vrf_config['vrf_remove']:
name = vrf['name']
if os.path.isdir(f'/sys/class/net/{name}'):
+ _cmd(f'sudo ip -4 route del vrf {name} unreachable default metric 4278198272')
+ _cmd(f'sudo ip -6 route del vrf {name} unreachable default metric 4278198272')
_cmd(f'ip link delete dev {name}')
for vrf in vrf_config['vrf_add']: