summaryrefslogtreecommitdiff
path: root/src/conf_mode
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-01-02 12:20:34 +0100
committerChristian Poessinger <christian@poessinger.com>2021-01-02 12:20:34 +0100
commit79f44d3cf8dc366e652f9fa01b34eff5314830ec (patch)
tree52638d525892aa701020d196ff2889dd014946ca /src/conf_mode
parenta6993fc98fa86a5e4b27194ed151bf6dda8ed6b4 (diff)
downloadvyos-1x-79f44d3cf8dc366e652f9fa01b34eff5314830ec.tar.gz
vyos-1x-79f44d3cf8dc366e652f9fa01b34eff5314830ec.zip
vrf: T2321: assign loopback IP addresses to individual VRF interfaces
47: bar: <NOARP,MASTER,UP,LOWER_UP> mtu 65536 qdisc noqueue state UP group default qlen 1000 link/ether 76:7d:c0:53:6d:89 brd ff:ff:ff:ff:ff:ff inet 127.0.0.1/8 scope host bar valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-xsrc/conf_mode/vrf.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/conf_mode/vrf.py b/src/conf_mode/vrf.py
index 2f4da0240..c4ba859b7 100755
--- a/src/conf_mode/vrf.py
+++ b/src/conf_mode/vrf.py
@@ -223,6 +223,10 @@ def apply(vrf_config):
# afterwards are taken.
_cmd(f'ip -4 route add vrf {name} unreachable default metric 4278198272')
_cmd(f'ip -6 route add vrf {name} unreachable default metric 4278198272')
+ # We also should add proper loopback IP addresses to the newly
+ # created VRFs for services bound to the loopback address (SNMP, NTP)
+ _cmd(f'ip -4 addr add 127.0.0.1/8 dev {name}')
+ _cmd(f'ip -6 addr add ::1/128 dev {name}')
# set VRF description for e.g. SNMP monitoring
Interface(name).set_alias(vrf['description'])