summaryrefslogtreecommitdiff
path: root/python/vyos/validate.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/vyos/validate.py')
-rw-r--r--python/vyos/validate.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/python/vyos/validate.py b/python/vyos/validate.py
index 3f3166022..1ce5a8467 100644
--- a/python/vyos/validate.py
+++ b/python/vyos/validate.py
@@ -112,6 +112,12 @@ def is_addr_assigned(addr):
return False
+def is_loopback_addr(addr):
+ """
+ Check if supplied IPv4/IPv6 address is a loopback address
+ """
+ return ipaddress.ip_address(addr).is_loopback
+
def is_subnet_connected(subnet, primary=False):
"""
Verify is the given IPv4/IPv6 subnet is connected to any interface on this