mirror of https://github.com/aredn/aredn.git
bugfix: Migrate vtund firewall rules to the new firewall system.
Resolves issue with firewall rules being purged on a port change. Requires changeset:dcc9d83e6e4bc3142f18fd077a3f5a955a66ce00/aredn_packages
This commit is contained in:
parent
902371a876
commit
b4d9a4fc7b
|
@ -152,32 +152,6 @@ sub check_freespace()
|
||||||
return $fs;
|
return $fs;
|
||||||
}
|
}
|
||||||
|
|
||||||
##########################
|
|
||||||
# Config firewall to allow port 5525 on WAN interface
|
|
||||||
##########################
|
|
||||||
sub open_5525_on_wan() {
|
|
||||||
#my $rc;
|
|
||||||
#$rc=&uci_add_sectiontype("firewall_tun","rule");
|
|
||||||
#$rc=&uci_set_indexed_option("firewall_tun","rule","0","src","wan");
|
|
||||||
#$rc=&uci_set_indexed_option("firewall_tun","rule","0","dest_port","5525");
|
|
||||||
#$rc=&uci_set_indexed_option("firewall_tun","rule","0","proto","tcp");
|
|
||||||
#$rc=&uci_set_indexed_option("firewall_tun","rule","0","target","ACCEPT");
|
|
||||||
#$rc=&uci_commit("firewall_tun");
|
|
||||||
#$rc=&uci_clone("firewall_tun");
|
|
||||||
|
|
||||||
my $filename = '/etc/config/firewall_tun';
|
|
||||||
open(my $fh, '>', $filename) or die "Could not open file '$filename' $!";
|
|
||||||
print $fh "\nconfig rule\n";
|
|
||||||
print $fh " option src 'wan'\n";
|
|
||||||
print $fh " option dest_port '5525'\n";
|
|
||||||
print $fh " option proto 'tcp'\n";
|
|
||||||
print $fh " option target 'ACCEPT'\n";
|
|
||||||
close $fh;
|
|
||||||
system "cp /etc/config/firewall_tun /etc/config.mesh";
|
|
||||||
system "cat /etc/config.mesh/firewall_tun >> /etc/config.mesh/firewall";
|
|
||||||
system "cat /etc/config.mesh/firewall_tun >> /etc/config/firewall";
|
|
||||||
}
|
|
||||||
|
|
||||||
sub vpn_setup_required()
|
sub vpn_setup_required()
|
||||||
{
|
{
|
||||||
my ($navpage) = @_;
|
my ($navpage) = @_;
|
||||||
|
@ -230,9 +204,6 @@ sub install_vtun
|
||||||
# add network interfaces
|
# add network interfaces
|
||||||
add_network_interfaces();
|
add_network_interfaces();
|
||||||
|
|
||||||
# allow port 5525 for server connections
|
|
||||||
open_5525_on_wan();
|
|
||||||
|
|
||||||
# create UCI config file
|
# create UCI config file
|
||||||
system("touch /etc/config/vtun");
|
system("touch /etc/config/vtun");
|
||||||
# create options section
|
# create options section
|
||||||
|
|
Loading…
Reference in New Issue