LoxiLB UI: select virtual ip from red0 interface

since we added loxilb ip management to add ip on
red0 interface, we can select the virtual ip from
red0 interface.

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
This commit is contained in:
Vincent Li
2024-06-19 18:20:57 +00:00
parent 780f556e9c
commit 61d054216d
2 changed files with 36 additions and 2 deletions

View File

@@ -1306,6 +1306,22 @@ sub grab_address_from_file($) {
return;
}
sub get_ipaddresses_from_interface($) {
my ($interface) = @_;
my @ip_addresses;
my $output = `ip addr show $interface 2>/dev/null`;
# Check if the command was successful
if ($? == 0) {
# Extract IP addresses using regex
while ($output =~ /inet (\d+\.\d+\.\d+\.\d+)/g) {
push @ip_addresses, $1;
}
}
return @ip_addresses;
}
# Function to get all configured and enabled nameservers.
sub get_nameservers () {
my %settings;