diff options
Diffstat (limited to 'src/conf_mode/vrf.py')
-rwxr-xr-x | src/conf_mode/vrf.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/conf_mode/vrf.py b/src/conf_mode/vrf.py index 91d8f8432..8036703f1 100755 --- a/src/conf_mode/vrf.py +++ b/src/conf_mode/vrf.py @@ -181,12 +181,11 @@ def apply(vrf_config): table = vrf['table'] if not os.path.isdir(f'/sys/class/net/{name}'): + # For each VRF apart from your default context create a VRF + # interface with a separate routing table _cmd(f'ip link add {name} type vrf table {table}') + # Start VRf _cmd(f'ip link set dev {name} up') - _cmd(f'ip -4 rule add oif {name} lookup {table}') - _cmd(f'ip -4 rule add iif {name} lookup {table}') - _cmd(f'ip -6 rule add oif {name} lookup {table}') - _cmd(f'ip -6 rule add iif {name} lookup {table}') # set VRF description for e.g. SNMP monitoring with open(f'/sys/class/net/{name}/ifalias', 'w') as f: |