###############################################################################
# #
# IPFire.org - A linux based firewall #
-# Copyright (C) 2007 Michael Tremer & Christian Schmidt #
+# Copyright (C) 2007-2011 IPFire Team <info@ipfire.org> #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
my %netsettings=();
&General::readhash("${General::swroot}/ethernet/settings", \%netsettings);
-open (ACTIVE, 'iptstate -1rbt |') or die 'Unable to open ip_conntrack';
+open (ACTIVE, '/usr/local/bin/getiptstate |') or die 'Unable to open ip_conntrack';
my @active = <ACTIVE>;
close (ACTIVE);
-my @vpn = ` route -n | grep ipsec | awk '{ print \$1" "\$3}'`;
+if (open(IP, "${General::swroot}/red/local-ipaddress")) {
+ my $redip = <IP>;
+ close(IP);
+ chomp $redip;
+ push(@network, $redip);
+ push(@masklen, '255.255.255.255' );
+ push(@colour, ${Header::colourfw} );
+}
+
+my @vpn = `/usr/local/bin/ipsecctrl I 2>/dev/null|grep erouted|cut -d"]" -f3|cut -d"=" -f4|cut -d";" -f1| sed "s|/| |g"`;
foreach my $route (@vpn) {
chomp($route);
my @temp = split(/[\t ]+/, $route);
+ if ( $temp[0] eq '$redip' ){next;}
push(@network, $temp[0]);
push(@masklen, $temp[1]);
push(@colour, ${Header::colourvpn} );
push(@colour, ${Header::colourvpn} );
}
}
-if (open(IP, "${General::swroot}/red/local-ipaddress")) {
- my $redip = <IP>;
- close(IP);
- chomp $redip;
- push(@network, $redip);
- push(@masklen, '255.255.255.255' );
- push(@colour, ${Header::colourfw} );
-}
-
#Establish simple filtering&sorting boxes on top of table