diff options
author | erkin <e.altunbas@vyos.io> | 2021-06-20 19:45:45 +0300 |
---|---|---|
committer | erkin <e.altunbas@vyos.io> | 2021-06-20 19:45:45 +0300 |
commit | 58300075021e65fcf3e61c9ab4dee2c33454e10f (patch) | |
tree | 3acf086c509e7eabfb062b2d1cba6dea53ae3f7d /python/vyos/template.py | |
parent | be167b110dabb1f7f6db7351d828bba1e54e358a (diff) | |
download | vyos-1x-58300075021e65fcf3e61c9ab4dee2c33454e10f.tar.gz vyos-1x-58300075021e65fcf3e61c9ab4dee2c33454e10f.zip |
T3268: remote: Determine source address from given network interface
Diffstat (limited to 'python/vyos/template.py')
-rw-r--r-- | python/vyos/template.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/python/vyos/template.py b/python/vyos/template.py index e1986b1e4..5c12e9914 100644 --- a/python/vyos/template.py +++ b/python/vyos/template.py @@ -375,3 +375,15 @@ def get_ipv4(interface): """ Get interface IPv4 addresses""" from vyos.ifconfig import Interface return Interface(interface).get_addr_v4() + +@register_filter('get_ipv6') +def get_ipv6(interface): + """ Get interface IPv6 addresses""" + from vyos.ifconfig import Interface + return Interface(interface).get_addr_v6() + +@register_filter('get_ip') +def get_ip(interface): + """ Get interface IP addresses""" + from vyos.ifconfig import Interface + return Interface(interface).get_addr() |