Сначала опишу, вопросы в конце...
UTM5 16 (присматриваюсь, к 17 пока нет доступа)
Linux 2.6.10
Запускал в такой последовательности:
# /etc/rc.d/rc.utm5_core start
Starting utm5_core
?Debug : Jan 11 17:23:21 Rehash: Rehash manager started
Notice: Jan 11 17:23:21 ModMap: Sub-Module 'rehash' inserted...
root@/etc/rc.d# ps ax|grep utm5
12332 pts/1 S 0:00 /bin/sh /netup/utm5/bin/safe_utm5_core start
12334 pts/1 Sl 0:00 /netup/utm5/bin/utm5_core
12343 pts/1 R+ 0:00 grep utm5
root@/etc/rc.d# /etc/rc.d/rc.utm5_rfw start
rc.utm5_rfw
root@/etc/rc.d# /etc/rc.d/rc.utm5_rfw start
root@/etc/rc.d# ps ax|grep utm5
12332 pts/1 S 0:00 /bin/sh /netup/utm5/bin/safe_utm5_core start
12334 pts/1 Sl 0:00 /netup/utm5/bin/utm5_core
12346 pts/1 S 0:00 /bin/sh /netup/utm5/bin/safe_utm5_rfw start
12347 pts/1 Sl 0:00 /netup/utm5/bin/utm5_rfw -f
root@/etc/rc.d# /etc/rc.d/rc.ndsad start
Starting ndsad
root@/etc/rc.d# ps ax|grep utm5
12332 pts/1 S 0:00 /bin/sh /netup/utm5/bin/safe_utm5_core start
12334 pts/1 Sl 0:00 /netup/utm5/bin/utm5_core
12346 pts/1 S 0:00 /bin/sh /netup/utm5/bin/safe_utm5_rfw start
12347 pts/1 Sl 0:00 /netup/utm5/bin/utm5_rfw -f
12359 pts/1 S 0:00 /netup/utm5/bin/ndsad -d -w
12360 pts/1 S 0:00 /netup/utm5/bin/ndsad -d -w
12361 pts/1 S 0:00 /netup/utm5/bin/ndsad -d -w
12362 pts/1 S 0:00 /netup/utm5/bin/ndsad -d -w
12363 pts/1 S 0:00 /netup/utm5/bin/ndsad -d -w
12364 pts/1 S 0:00 /netup/utm5/bin/ndsad -d -w
12365 pts/1 S 0:00 /netup/utm5/bin/ndsad -d -w
12367 pts/1 R+ 0:00 grep utm5
root@/etc/rc.d#
Все вроде как запустилось...
Конфиги:
utm5.cfg:
-----------------------
database_type=mysql
database=UTM5
database_host=localhost
database_login=root
database_password=*****
database_sock_path=/var/run/mysql/mysql.sock
urfa_bind_host=0.0.0.0
urfa_lib_file=/netup/utm5/lib/utm5_core/liburfa-utils.so
urfa_lib_file=/netup/utm5/lib/utm5_core/liburfa-std.so
urfa_lib_file=/netup/utm5/lib/utm5_core/liburfa-card.so
urfa_lib_file=/netup/utm5/lib/utm5_core/liburfa-graph.so
urfa_lib_file=/netup/utm5/lib/utm5_radius/liburfa-radius.so
urfa_lib_file=/netup/utm5/lib/utm5_hotspot/liburfa-hotspot.so
nfbuffer_host=0.0.0.0
nfbuffer_port=9996
## ==========
## LOGGING
...
## ========
-----------------------
rfw5.cfg :
-----------------------
sudo_path=/usr/bin/sudo
#!#firewall_path=/usr/sbin/iptables
#!#firewall_flush_cmd=/usr/sbin/iptables -F
dont_fork=yes
rfw_name=127.0.0.1
core_host=127.0.0.1
core_port=11758
rfw_login=init
rfw_password=****
## ==========
## LOGGING
...
## ========
-----------------------
# cat /etc/sudoers
...
# UTM5 Firewall
utm5 ALL= NOPASSWD: /usr/sbin/iptables
------------------------
UTM_Admin.jar :
В настройках FW
/usr/sbin/iptables -A FORWARD -s UIP/UBITS -j ACCEPT
/usr/sbin/iptables -D FORWARD -s UIP/UBITS -j ACCEPT
проверяем:
# ls -l /usr/sbin/iptables
-rwxr-xr-x 1 root bin 47756 2005-08-01 00:24 /usr/sbin/iptables
на месте!!!
main.log постоянно сыплется:
...
Info : Jan 11 18:21:42 RPCConn[SSL]<init@127.0.0.1>: Access granted to [SSL]<i
Info : Jan 11 18:21:48 UTMCtx: Encrypt: No ctx found
Warn : Jan 11 18:21:48 UTMCtx: Unencrypted message passed!
...
Включаю интернет для пользователя (192.168.78.2) в админском окне, поле зазеленело - ок, но интернета нет!
Смотрим:
root@/netup/utm5/log# iptables -nL
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy DROP)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
root@/netup/utm5/log#
Еще информация, но зесь все ок:
# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
x.x.x.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.168.78.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 x.x.x.1 0.0.0.0 UG 1 0 0 eth0
#
Лезем в логи rfw.log постоянно:
?Debug : Jan 11 18:23:46 RFW URFA[plugin]: Got ping from core. Sending reply...
- НИШТЯК!!!
А вот в rfw5.log :
sudo: : command not found
sudo: : command not found
Хотя ...
# ls -l /usr/bin/sudo
-rws--x--x 1 root bin 92928 2005-06-22 11:50 /usr/bin/sudo
И кроме этого:
# cat /etc/soduers
...
# UTM5 Firewall
utm5 ALL= NOPASSWD: /sbin/iptables
------------------------
#
Далее, выключаем систему:
# ./rc.utm5_core stop
Stopping utm5_core
root@/etc/rc.d# ps ax|grep utm5
12346 ? S 0:00 /bin/sh /netup/utm5/bin/safe_utm5_rfw start
12347 ? Sl 0:00 /netup/utm5/bin/utm5_rfw -f
12359 ? S 0:00 /netup/utm5/bin/ndsad -d -w
12360 ? S 0:00 /netup/utm5/bin/ndsad -d -w
12361 ? S 0:00 /netup/utm5/bin/ndsad -d -w
12362 ? S 0:00 /netup/utm5/bin/ndsad -d -w
12363 ? S 0:00 /netup/utm5/bin/ndsad -d -w
12364 ? S 0:00 /netup/utm5/bin/ndsad -d -w
12365 ? S 0:00 /netup/utm5/bin/ndsad -d -w
12490 pts/3 Sl+ 0:05 /usr/local/jre1.5.0/bin/java -jar /netup/utm5/admin/UTM_Admin.jar
root@/etc/rc.d# # ./rc.utm5_rfw stop
Stopping utm5_rfw
root@/etc/rc.d# ps ax|grep utm5
12346 ? S 0:00 /bin/sh /netup/utm5/bin/safe_utm5_rfw start
12347 ? Sl 0:00 /netup/utm5/bin/utm5_rfw -f
12359 ? S 0:00 /netup/utm5/bin/ndsad -d -w
12360 ? S 0:00 /netup/utm5/bin/ndsad -d -w
12361 ? S 0:00 /netup/utm5/bin/ndsad -d -w
12362 ? S 0:00 /netup/utm5/bin/ndsad -d -w
12363 ? S 0:00 /netup/utm5/bin/ndsad -d -w
12364 ? S 0:00 /netup/utm5/bin/ndsad -d -w
12365 ? S 0:00 /netup/utm5/bin/ndsad -d -w
12490 pts/3 Sl+ 0:05 /usr/local/jre1.5.0/bin/java -jar /netup/utm5/admin/UTM_Admin.jar
root@/etc/rc.d#
Ладно далее
root@/etc/rc.d# ./rc.ndsad stop
Stopping ndsad
root@/etc/rc.d# ps ax|grep utm5
12346 ? S 0:00 /bin/sh /netup/utm5/bin/safe_utm5_rfw start
12347 ? Sl 0:00 /netup/utm5/bin/utm5_rfw -f
12490 pts/3 Sl+ 0:05 /usr/local/jre1.5.0/bin/java -jar /netup/utm5/admin/UTM_Admin.jar
root@/etc/rc.d# ./rc.utm5_rfw stop
Stopping utm5_rfw
root@/etc/rc.d# ps ax|grep utm5
12490 pts/3 Sl+ 0:05 /usr/local/jre1.5.0/bin/java -jar /netup/utm5/admin/UTM_Admin.jar
12679 pts/4 R+ 0:00 grep utm5
root@/etc/rc.d#
Хм ... на сей раз все закрылось, но не всегда так!
!!! В О П Р О С Ы !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1. В какой последовательности, включать и выключать core, rfw5, ndsad ???
2. На форуме много об этом говорилось, кажись все прочитал и всеже! Почему не добавляется правило файрвола кода пользователю включается инет???
Проверял руками добавляя правила:
ACCEPT all -- 192.168.78.2 0.0.0.0/0
ACCEPT all -- 0.0.0.0/0 192.168.78.2
- Работает.
Что не досмотрел???
Не находит команду sudo??? Почему?
пути к ней прописанны правильно, что отраженно выше. И потом сейчас все из под рута запускается.
Порядок запуска/остановки сервисов. НЕ созд. правила iptable
Вот если выключаю в такой последовательности
core ndsad rfw
остается:
# ps ax|grep utm
13445 pts/4 S 0:00 /bin/sh /netup/utm5/bin/safe_utm5_rfw start
13446 pts/4 Sl 0:00 /netup/utm5/bin/utm5_rfw -f
13458 pts/4 S 0:00 /netup/utm5/bin/ndsad -d -w
13459 pts/4 S 0:00 /netup/utm5/bin/ndsad -d -w
13460 pts/4 S 0:00 /netup/utm5/bin/ndsad -d -w
core ndsad rfw
остается:
# ps ax|grep utm
13445 pts/4 S 0:00 /bin/sh /netup/utm5/bin/safe_utm5_rfw start
13446 pts/4 Sl 0:00 /netup/utm5/bin/utm5_rfw -f
13458 pts/4 S 0:00 /netup/utm5/bin/ndsad -d -w
13459 pts/4 S 0:00 /netup/utm5/bin/ndsad -d -w
13460 pts/4 S 0:00 /netup/utm5/bin/ndsad -d -w
1. Сначала стартует ядро, затем неважно в какой последовательности. ndsad вообще можно отдельно стартовать раньше всех.
2. Укажите в rfw5.cfg:
sudo_path=
firewall_path=/sbin/iptables
в интерфейсе при этом указывайте правила без пути к бинарнику.
Данный вопрос рассмотрен в ФАК:
http://old.netup.ru/fom-serve/cache/61.html
2. Укажите в rfw5.cfg:
sudo_path=
firewall_path=/sbin/iptables
в интерфейсе при этом указывайте правила без пути к бинарнику.
Данный вопрос рассмотрен в ФАК:
http://old.netup.ru/fom-serve/cache/61.html
Спасибо за ссылку, действительно много интерсного но конкретно этот рецепт не помог! Вернее:
Если:
sudo_path=
firewall_path=
Во вкладке Настройки/Firewall
прописанно:
/usr/sbin/iptables -A FORWARD -s UIP/UBITS -j ACCEPT
...
?Debug : Jan 12 11:31:35 FWCntl: Waiting second child process ... second child p
id <15310>
?Debug : Jan 12 11:31:35 FWCntl: Second child process <15310> exited with status
<512>
?Debug : Jan 12 11:31:35 FWCntl: Executing FW rule: -A FORWARD -s 192.168.78.2/
32 -j ACCEPT is done.
?Debug : Jan 12 11:31:35 RFW URFA[plugin]: Got 'exec' command...
?Debug : Jan 12 11:31:35 FWCntl: Executing command </usr/sbin/iptables>
?Debug : Jan 12 11:31:35 FWCntl: Waiting second child process ... second child p
id <15312>
?Debug : Jan 12 11:31:35 FWCntl: Second child process <15312> exited with status
<0>
?Debug : Jan 12 11:31:35 RFW URFA[plugin]: Got ping from core. Sending reply...
Лог говорит что правило добавленно, но в действительности их нет!!!
# iptables -nL
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy DROP)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
#
Если сделать как вы описали:
sudo_path=
firewall_path=/usr/sbin/iptables #у меня именно такой путь
в интерфейсе соответсвенно:
-A FORWARD -s UIP/UBITS -j ACCEPT
то это мало чем отличается:
rfw5.log:
?Debug : Jan 12 16:05:26 FWCntl: Waiting second child process ... second child p
id <16788>
?Debug : Jan 12 16:05:26 FWCntl: Second child process <16788> exited with status
<0>
?Debug : Jan 12 16:05:26 FWCntl: Executing FW rule: -A FORWARD -s 192.168.78.2/
32 -j ACCEPT is done.
?Debug : Jan 12 16:05:32 RFW URFA[plugin]: Got ping from core. Sending reply...
Правила не поднялись!
# iptables -nL
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy DROP)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
#
Что может быть? Покак всё делаю из под root!
Если:
sudo_path=
firewall_path=
Во вкладке Настройки/Firewall
прописанно:
/usr/sbin/iptables -A FORWARD -s UIP/UBITS -j ACCEPT
...
?Debug : Jan 12 11:31:35 FWCntl: Waiting second child process ... second child p
id <15310>
?Debug : Jan 12 11:31:35 FWCntl: Second child process <15310> exited with status
<512>
?Debug : Jan 12 11:31:35 FWCntl: Executing FW rule: -A FORWARD -s 192.168.78.2/
32 -j ACCEPT is done.
?Debug : Jan 12 11:31:35 RFW URFA[plugin]: Got 'exec' command...
?Debug : Jan 12 11:31:35 FWCntl: Executing command </usr/sbin/iptables>
?Debug : Jan 12 11:31:35 FWCntl: Waiting second child process ... second child p
id <15312>
?Debug : Jan 12 11:31:35 FWCntl: Second child process <15312> exited with status
<0>
?Debug : Jan 12 11:31:35 RFW URFA[plugin]: Got ping from core. Sending reply...
Лог говорит что правило добавленно, но в действительности их нет!!!
# iptables -nL
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy DROP)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
#
Если сделать как вы описали:
sudo_path=
firewall_path=/usr/sbin/iptables #у меня именно такой путь
в интерфейсе соответсвенно:
-A FORWARD -s UIP/UBITS -j ACCEPT
то это мало чем отличается:
rfw5.log:
?Debug : Jan 12 16:05:26 FWCntl: Waiting second child process ... second child p
id <16788>
?Debug : Jan 12 16:05:26 FWCntl: Second child process <16788> exited with status
<0>
?Debug : Jan 12 16:05:26 FWCntl: Executing FW rule: -A FORWARD -s 192.168.78.2/
32 -j ACCEPT is done.
?Debug : Jan 12 16:05:32 RFW URFA[plugin]: Got ping from core. Sending reply...
Правила не поднялись!
# iptables -nL
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy DROP)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
#
Что может быть? Покак всё делаю из под root!
?Debug : Jan 12 17:04:25 RFW URFA[plugin]: Got 'exec' command...
?Debug : Jan 12 17:04:25 FWCntl: Executing command </usr/sbin/iptables>
?Debug : Jan 12 17:04:25 FWCntl: Waiting second child process ... second child p
id <17270>
?Debug : Jan 12 17:04:25 FWCntl: Second child process <17270> exited with status
<0>
?Debug : Jan 12 17:04:25 FWCntl: Executing FW rule: -A FORWARD -s 192.168.78.2/
32 -j ACCEPT is done.
Короче в логах явно видно, что:
Executing command </usr/sbin/iptables>
и
Executing FW rule: -А FORWARD -s 192.168.78.2/
32 -j ACCEPT is done.
Но! :
# iptables -nL
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy DROP)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Те правила не добавляются!!! Почему???
Как rfw исполняет команду:
/usr/sbin/iptables -А FORWARD -s 192.168.78.2/
32 -j ACCEPT
??? он ее не исполняет, а только пишет в логах что исполнил!
?Debug : Jan 12 17:04:25 FWCntl: Executing command </usr/sbin/iptables>
?Debug : Jan 12 17:04:25 FWCntl: Waiting second child process ... second child p
id <17270>
?Debug : Jan 12 17:04:25 FWCntl: Second child process <17270> exited with status
<0>
?Debug : Jan 12 17:04:25 FWCntl: Executing FW rule: -A FORWARD -s 192.168.78.2/
32 -j ACCEPT is done.
Короче в логах явно видно, что:
Executing command </usr/sbin/iptables>
и
Executing FW rule: -А FORWARD -s 192.168.78.2/
32 -j ACCEPT is done.
Но! :
# iptables -nL
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy DROP)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Те правила не добавляются!!! Почему???
Как rfw исполняет команду:
/usr/sbin/iptables -А FORWARD -s 192.168.78.2/
32 -j ACCEPT
??? он ее не исполняет, а только пишет в логах что исполнил!
да добавляет, я уже писал что ручками все ок!
root@/etc/rc.d# /usr/sbin/iptables -A FORWARD -s 192.168.78.2/32 -j ACCEPT
root@/etc/rc.d# iptables -nL
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy DROP)
target prot opt source destination
ACCEPT all -- 192.168.78.2 0.0.0.0/0
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
root@/etc/rc.d# /usr/sbin/iptables -A FORWARD -s 192.168.78.2/32 -j ACCEPT
root@/etc/rc.d# iptables -nL
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy DROP)
target prot opt source destination
ACCEPT all -- 192.168.78.2 0.0.0.0/0
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
проверьте, что у вас путь к исполняемому файлу (iptables) прописан в конфиге в firewall_path=, а правила без указания пути к программе указаны в админке. В правилах первым символом не должно быть пробела. Проверьте - правила должны добавляться. Если не добавляются, то созадйте простой срикпт вида:
#!/bin/sh
echo 123 >> /tmp/exec.log
проверьте, выполняется ли этот файл (после запуска должен расти файл /tmp/exec.log) ?
#!/bin/sh
echo 123 >> /tmp/exec.log
проверьте, выполняется ли этот файл (после запуска должен расти файл /tmp/exec.log) ?
проделал с иполняемым скриптом, как и предпологалось:
?Debug : Jan 12 18:48:46 FWCntl: Waiting second child process ... second child p
id <18074>
?Debug : Jan 12 18:48:46 FWCntl: Second child process <18074> exited with status
<0>
?Debug : Jan 12 18:48:46 FWCntl: Executing FW rule: /netup/utm5/aaa.sh is done.
?Debug : Jan 12 18:48:47 RFW URFA[plugin]: Got ping from core. Sending reply...
При этом (файл создал сам для наглядности, а то он не создавался хотя понятно должен если бы реально исполнялась команда)
# ls -l /tmp/exec.log
-rw-r--r-- 1 root root 0 2006-01-12 18:48 /tmp/exec.log
ну или
# cat /tmp/exec.log
#
Так может всётки как то не так строки обрабатываются????
Кстати вот тому подтверждение:
при запуске rfw ругань в консоль
/netup/utm5/rfw5.cfg: line 35: -F: command not found
это на строку:
firewall_flush_cmd=/usr/sbin/iptables -F
Какие еще будут идеи??? Может правила в какиенибудь кавычки помещать??
Пробовал "" не проходит...
?Debug : Jan 12 18:48:46 FWCntl: Waiting second child process ... second child p
id <18074>
?Debug : Jan 12 18:48:46 FWCntl: Second child process <18074> exited with status
<0>
?Debug : Jan 12 18:48:46 FWCntl: Executing FW rule: /netup/utm5/aaa.sh is done.
?Debug : Jan 12 18:48:47 RFW URFA[plugin]: Got ping from core. Sending reply...
При этом (файл создал сам для наглядности, а то он не создавался хотя понятно должен если бы реально исполнялась команда)
# ls -l /tmp/exec.log
-rw-r--r-- 1 root root 0 2006-01-12 18:48 /tmp/exec.log
ну или
# cat /tmp/exec.log
#
Так может всётки как то не так строки обрабатываются????
Кстати вот тому подтверждение:
при запуске rfw ругань в консоль
/netup/utm5/rfw5.cfg: line 35: -F: command not found
это на строку:
firewall_flush_cmd=/usr/sbin/iptables -F
Какие еще будут идеи??? Может правила в какиенибудь кавычки помещать??
Пробовал "" не проходит...