diff options
author | Christian Poessinger <christian@poessinger.com> | 2021-06-20 21:51:25 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-20 21:51:25 +0200 |
commit | 0de84e53c36604af2bac3b5d8eb00480f9623aa0 (patch) | |
tree | da302b2b47c3149561b2c8dc24aa602262c59a7c /python/vyos/template.py | |
parent | 9b71d555575c0fa217a137cffaaafce5eb35d18e (diff) | |
parent | 58300075021e65fcf3e61c9ab4dee2c33454e10f (diff) | |
download | vyos-1x-0de84e53c36604af2bac3b5d8eb00480f9623aa0.tar.gz vyos-1x-0de84e53c36604af2bac3b5d8eb00480f9623aa0.zip |
Merge pull request #893 from erkin/T3628
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() |