From 24a236385ea3ddea1eac867906ae74bbc05dfb07 Mon Sep 17 00:00:00 2001 From: Florin Grad Date: Thu, 20 Feb 2003 17:50:23 +0000 Subject: update 2 rules for the pptp dsl internet connection --- perl-install/network/shorewall.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'perl-install') diff --git a/perl-install/network/shorewall.pm b/perl-install/network/shorewall.pm index 6f01bca0a..ebed44ffe 100644 --- a/perl-install/network/shorewall.pm +++ b/perl-install/network/shorewall.pm @@ -2,7 +2,7 @@ package network::shorewall; # $Id$ -use strict; + use detect_devices; use network::netconnect; use run_program; @@ -86,6 +86,7 @@ sub read { sub write { my ($conf) = @_; + my $connect_file = "/etc/sysconfig/network-scripts/net_cnx_up"; my %ports_by_proto; foreach (split ' ', $conf->{ports}) { @@ -111,11 +112,13 @@ sub write { [ 'all', 'all', 'REJECT', 'info' ], ); set_config_file('rules', + if_(cat_("$prefix$connect_file") =~ /pptp/, [ 'ACCEPT', 'fw', 'loc:10.0.0.138', 'tcp', '1723' ]), + if_(cat_("$prefix$connect_file") =~ /pptp/, [ 'ACCEPT', 'fw', 'loc:10.0.0.138', 'gre' ]), (map { map_each { [ 'ACCEPT', $_, 'fw', $::a, join(',', @$::b), '-' ] } %ports_by_proto } ('net', if_($conf->{masquerade}, 'masq'), if_($conf->{loc_interface}, 'loc'))), if_($conf->{masquerade}, map { [ 'ACCEPT', 'masq', 'fw', $_, join(',', @drakgw_ports), '-' ] } 'tcp', 'udp'), - if_($conf->{masquerade}, map { [ 'ACCEPT', 'fw', 'masq', $_, join(',', @internal_ports), '-' ] } 'tcp', 'udp'), + if_($conf->{masquerade}, map { [ 'ACCEPT', 'fw', 'masq', $_, join(',', @internal_ports), '-' ] } 'tcp', 'udp'), ); set_config_file('masq', $conf->{masquerade} ? [ $conf->{net_interface}, $conf->{masquerade}{subnet} ] : (), -- cgit v1.2.1