summaryrefslogtreecommitdiff
path: root/src/conf_mode/vrf.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-03-04 19:12:18 +0100
committerChristian Poessinger <christian@poessinger.com>2020-03-04 21:43:59 +0100
commitc26fb9bc15bd625b11ae1674bddf8daf168b0f76 (patch)
treebac354e567adf991054a3216ba3f1223878ff779 /src/conf_mode/vrf.py
parentd93efd69083c153c1586dd08d65f1d10769820b7 (diff)
downloadvyos-1x-c26fb9bc15bd625b11ae1674bddf8daf168b0f76.tar.gz
vyos-1x-c26fb9bc15bd625b11ae1674bddf8daf168b0f76.zip
vrf: T31: no need to use sudo calls in vrf.py
All configuration mode scripts are already run with sudo.
Diffstat (limited to 'src/conf_mode/vrf.py')
-rwxr-xr-xsrc/conf_mode/vrf.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/conf_mode/vrf.py b/src/conf_mode/vrf.py
index 9896c7c85..4dddc7de9 100755
--- a/src/conf_mode/vrf.py
+++ b/src/conf_mode/vrf.py
@@ -152,18 +152,18 @@ def apply(command):
# RTNETLINK answers: Operation not supported
# so require to remove vrf and change all existing the interfaces
- if os.system(f'sudo ip link delete dev {name}'):
+ if os.system(f'ip link delete dev {name}'):
continue
action = 'add'
if action == 'add':
commands = [
- f'sudo ip link add {name} type vrf table {table}',
- f'sudo ip link set dev {name} up',
- f'sudo ip -4 rule add oif {name} lookup {table}',
- f'sudo ip -4 rule add iif {name} lookup {table}',
- f'sudo ip -6 rule add oif {name} lookup {table}',
- f'sudo ip -6 rule add iif {name} lookup {table}',
+ f'ip link add {name} type vrf table {table}',
+ f'ip link set dev {name} up',
+ f'ip -4 rule add oif {name} lookup {table}',
+ f'ip -4 rule add iif {name} lookup {table}',
+ f'ip -6 rule add oif {name} lookup {table}',
+ f'ip -6 rule add iif {name} lookup {table}',
]
for command in commands: