Работает ли UTM5 на Windows Server 2008
Я так понимаю это можно проверить в логах? Если да, то в логах только одно и тоже сообщение, ничего не меняется:Magnum72 писал(а):Ты проверял что фаир действительно вызывает скрипт?
?Debug : Oct 23 17:28:24 StreamFirewall: Got ping from core. Sending reply...
?Debug : Oct 23 17:28:54 StreamFirewall: Got ping from core. Sending reply...
?Debug : Oct 23 17:29:24 StreamFirewall: Got ping from core. Sending reply...
А по поводу скрипта, хотел спросить про скрипт указанный в цитате ниже. Для windows он не подойдет?
Скрипт приблизительно понятен, кроме того откуда он берет логин/пароль для подключения по телнету к сетевому оборудованию? Заранее благодарен.кому интересно - промежуточное решение
1) воздаем руками на всех свичах:
Код:
create access_profile ip source_ip_mask 255.255.255.255 profile_id 10
create access_profile ip destination_ip_mask 255.255.255.255 profile_id 20
create access_profile ip source_ip_mask 0.0.0.0 profile_id 30
Сам скрипт (пущаем по крону раз в н минут):
Код:
#!/usr/bin/perl -w
use Net::Telnet;
#use strict;
use DBI;
#Podkluchaemsia k base dannix
my $dsn = 'DBI:mysql:UTM5:127.0.0.1';
my $db_user_name = 'root';
my $db_password = 'hui';
my $bill = '172.16.0.1'; # allowed only tish host when user is blocked
my ($id, $password);
my $dbh = DBI->connect($dsn, $db_user_name, $db_password);
#
# --nmancer:
#
# select all abonents
#
my $sth = $dbh->prepare(qq{
SELECT
INET_NTOA(ip & 4294967295) as i,
inet_ntoa(4294967295 & r.router_bin_ip) AS rip,
u.port_number,
r.login,
r.password ,
# acc.is_blocked
acc.int_status
FROM
ip_groups,
users as u,
routers_info as r,
account_tariff_link as atlink,
iptraffic_service_links,
service_links,
accounts as acc
WHERE
ip_groups.is_deleted=0
and u.is_deleted=0
and atlink.is_deleted=0
and r.id = u.remote_switch_id
and atlink.account_id = acc.id
and u.basic_account = acc.id
and iptraffic_service_links.ip_group_id=ip_groups.ip_group_id
and service_links.id=iptraffic_service_links.id
and acc.id=service_links.account_id
ORDER BY
router_bin_ip
});
$sth->execute();
while (my ($ip, $router_bin_ip, $port_number, $login, $password, $int_status) = $sth->fetchrow_array())
{
my $exec =
$t = new Net::Telnet (Timeout => 5,
Prompt => '/#/',
Host => $router_bin_ip );
$t->login($login, $password);
if ($int_status==1) {
print "Set network status ON for IP: $ip | Router: $router_bin_ip port: $port_number\n";
@lines = $t->cmd("config access_profile profile_id 10 add access_id $port_number ip source_ip $ip port $port_number permit");
}
else
{
print "Set network status OFF for IP: $ip | Router: $router_bin_ip port: $port_number\n";
@lines = $t->cmd("config access_profile profile_id 10 delete access_id $port_number");
}
@lines = $t->cmd("config access_profile profile_id 20 add access_id $port_number ip destination_ip $bill port $port_number permit");
@lines = $t->cmd("config access_profile profile_id 30 add access_id $port_number ip source_ip 0.0.0.0 port $port_number deny");
}
# print "Saving configuration, please wait...\n";
# @lines = $t->cmd("save");
@lines = $t->cmd("logout");
print "Configuration sucssessfull added and logout.\n";
$sth->finish();
#Otkluchaemsia ot basi dannih
$dbh->disconnect();
Идея простая до безобразия - в разблокированном состоянии - разрешаем все, в заблокированном - только траффик на биллинг для мониторинга баланса. В данном примере один нехороший момент - в заблокированном состоянии пользователь может прописать себе любой ip.
Да, разрешен только 1 mac на интерфейсе. (1 порт=1 пользователь=1 мак)
Код:
config port_security ports 1-24 admin_state enable max_learning_addr 1 lock_address_mode DeleteOnReset