mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-28 11:43:25 +02:00
aliases: Add support to assign aliases to multiple RED interfaces
This is a little patch which will extend the aliases page to offer an interface selection if there are more than one RED interfaces. This is a little hack to make configuration easier for users who have manually set up more than one RED interface (e.g. for load balancing or fail-over) and want to use the UI to configure firewall rules. As a little benefit on the side, I had to rewrite setaliases.c to use ip(8) instead of ifconfig(8). Signed-off-by: Michael Tremer <michael.tremer@ipfire.org> Acked-by: Peter Müller <peter.mueller@ipfire.org>
This commit is contained in:
committed by
Peter Müller
parent
f704d76e08
commit
6395bed8a4
@@ -332,6 +332,26 @@ sub setup_upstream_proxy() {
|
||||
}
|
||||
}
|
||||
|
||||
sub get_red_interfaces() {
|
||||
my $default = &General::get_red_interface();
|
||||
|
||||
my @intfs = (
|
||||
$default,
|
||||
);
|
||||
|
||||
opendir(INTERFACES, "/sys/class/net");
|
||||
|
||||
while (my $intf = readdir(INTERFACES)) {
|
||||
if ($intf =~ m/^red[0-9]+$/) {
|
||||
push(@intfs, $intf);
|
||||
}
|
||||
}
|
||||
|
||||
closedir(INTERFACES);
|
||||
|
||||
return &General::uniq(@intfs);
|
||||
}
|
||||
|
||||
sub list_wireless_interfaces() {
|
||||
my %interfaces = ();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user