diff options
-rw-r--r-- | lib/network/tools.pm | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/network/tools.pm b/lib/network/tools.pm index c8e0cf6..92e4765 100644 --- a/lib/network/tools.pm +++ b/lib/network/tools.pm @@ -272,6 +272,12 @@ sub get_interface_ip_address { $net->{ifcfg}{$interface}{IPADDR}; } +sub get_interface_ip6_address { + my ($net, $interface) = @_; + `/sbin/ip addr show dev $interface` =~ /^\s*inet6\s+(.*)\sscope\sglobal(.*)$/m && $1 || + $net->{ifcfg}{$interface}{IPADDR}; +} + sub get_interface_ptp_address { my ($interface) = @_; my ($flags, $_link, $addrs) = `/sbin/ip addr show dev $interface`; |