mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-28 11:43:25 +02:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user