Помогите, пожалуйста, разобраться с логами ufw.log. Вижу там записи, которых по логике быть не должно.
Вот статус ufw:
# sudo ufw status verbose
Состояние: активен
Журналирование: on (low)
По умолчанию: allow (входящие), allow (исходящие)
Новые профили: skip
В Действие Из
- -------- --
3389 LIMIT IN Anywhere
22 LIMIT IN Anywhere
21/tcp LIMIT IN Anywhere
3389 LIMIT IN Anywhere (v6)
22 LIMIT IN Anywhere (v6)
21/tcp LIMIT IN Anywhere (v6)
Стоят limit'ы на вполне конкретные порты, все остальное в статусе allow.
Вот ufw.log:
Aug 9 14:28:15 srv232 kernel: [14225.214089] [UFW BLOCK] IN=eth1 OUT= MAC=68:05:ca:08:38:66:c0:c1:c0:52:ae:6c:08:00 SRC=95.211.9.130 DST=192.168.1.232 LEN=40 TOS=0x00 PREC=0x00 TTL=56 ID=0 DF PROTO=TCP SPT=80 DPT=35199 WINDOW=0 RES=0x00 RST URGP=0
Aug 9 14:29:03 srv232 kernel: [14272.616987] [UFW BLOCK] IN=eth1 OUT= MAC=68:05:ca:08:38:66:c0:c1:c0:52:ae:6c:08:00 SRC=95.211.9.130 DST=192.168.1.232 LEN=40 TOS=0x00 PREC=0x00 TTL=56 ID=0 DF PROTO=TCP SPT=80 DPT=35199 WINDOW=0 RES=0x00 RST URGP=0
Aug 9 14:45:44 srv232 kernel: [15272.885224] [UFW BLOCK] IN=eth1 OUT= MAC=68:05:ca:08:38:66:c0:c1:c0:52:ae:6c:08:00 SRC=95.211.9.130 DST=192.168.1.232 LEN=40 TOS=0x00 PREC=0x00 TTL=56 ID=0 DF PROTO=TCP SPT=80 DPT=35243 WINDOW=0 RES=0x00 RST URGP=0
Aug 9 14:45:44 srv232 kernel: [15272.885248] [UFW BLOCK] IN=eth1 OUT= MAC=68:05:ca:08:38:66:c0:c1:c0:52:ae:6c:08:00 SRC=95.211.9.130 DST=192.168.1.232 LEN=40 TOS=0x00 PREC=0x00 TTL=56 ID=0 DF PROTO=TCP SPT=80 DPT=35244 WINDOW=0 RES=0x00 RST URGP=0
Aug 9 14:45:44 srv232 kernel: [15273.014618] [UFW BLOCK] IN=eth1 OUT= MAC=68:05:ca:08:38:66:c0:c1:c0:52:ae:6c:08:00 SRC=95.211.9.133 DST=192.168.1.232 LEN=40 TOS=0x00 PREC=0x00 TTL=56 ID=0 DF PROTO=TCP SPT=80 DPT=39638 WINDOW=0 RES=0x00 RST URGP=0
Aug 9 14:45:44 srv232 kernel: [15273.563031] [UFW BLOCK] IN=eth1 OUT= MAC=68:05:ca:08:38:66:c0:c1:c0:52:ae:6c:08:00 SRC=95.211.9.133 DST=192.168.1.232 LEN=40 TOS=0x00 PREC=0x00 TTL=56 ID=0 DF PROTO=TCP SPT=80 DPT=39641 WINDOW=0 RES=0x00 RST URGP=0
Aug 9 14:45:44 srv232 kernel: [15273.563057] [UFW BLOCK] IN=eth1 OUT= MAC=68:05:ca:08:38:66:c0:c1:c0:52:ae:6c:08:00 SRC=95.211.8.142 DST=192.168.1.232 LEN=40 TOS=0x00 PREC=0x00 TTL=56 ID=0 DF PROTO=TCP SPT=80 DPT=42804 WINDOW=0 RES=0x00 RST URGP=0
Aug 9 14:45:44 srv232 kernel: [15273.803138] [UFW BLOCK] IN=eth1 OUT= MAC=68:05:ca:08:38:66:c0:c1:c0:52:ae:6c:08:00 SRC=95.211.8.142 DST=192.168.1.232 LEN=40 TOS=0x00 PREC=0x00 TTL=56 ID=0 DF PROTO=TCP SPT=80 DPT=42806 WINDOW=0 RES=0x00 RST URGP=0
Aug 9 14:45:49 srv232 kernel: [15278.033864] [UFW BLOCK] IN=eth1 OUT= MAC=68:05:ca:08:38:66:c0:c1:c0:52:ae:6c:08:00 SRC=95.211.9.130 DST=192.168.1.232 LEN=40 TOS=0x00 PREC=0x00 TTL=56 ID=0 DF PROTO=TCP SPT=80 DPT=35239 WINDOW=0 RES=0x00 RST URGP=0
Aug 9 14:45:49 srv232 kernel: [15278.104961] [UFW BLOCK] IN=eth1 OUT= MAC=68:05:ca:08:38:66:c0:c1:c0:52:ae:6c:08:00 SRC=95.211.8.142 DST=192.168.1.232 LEN=40 TOS=0x00 PREC=0x00 TTL=56 ID=0 DF PROTO=TCP SPT=80 DPT=42804 WINDOW=0 RES=0x00 RST URGP=0
Aug 9 14:45:49 srv232 kernel: [15278.314678] [UFW BLOCK] IN=eth1 OUT= MAC=68:05:ca:08:38:66:c0:c1:c0:52:ae:6c:08:00 SRC=95.211.9.130 DST=192.168.1.232 LEN=40 TOS=0x00 PREC=0x00 TTL=56 ID=0 DF PROTO=TCP SPT=80 DPT=35243 WINDOW=0 RES=0x00 RST URGP=0
Aug 9 14:45:49 srv232 kernel: [15278.314701] [UFW BLOCK] IN=eth1 OUT= MAC=68:05:ca:08:38:66:c0:c1:c0:52:ae:6c:08:00 SRC=95.211.9.130 DST=192.168.1.232 LEN=40 TOS=0x00 PREC=0x00 TTL=56 ID=0 DF PROTO=TCP SPT=80 DPT=35244 WINDOW=0 RES=0x00 RST URGP=0
Aug 9 14:46:16 srv232 kernel: [15305.360416] [UFW BLOCK] IN=eth1 OUT= MAC=68:05:ca:08:38:66:c0:c1:c0:52:ae:6c:08:00 SRC=95.211.8.142 DST=192.168.1.232 LEN=40 TOS=0x00 PREC=0x00 TTL=56 ID=0 DF PROTO=TCP SPT=80 DPT=42804 WINDOW=0 RES=0x00 RST URGP=0
Aug 9 14:46:24 srv232 kernel: [15312.915532] [UFW BLOCK] IN=eth1 OUT= MAC=68:05:ca:08:38:66:c0:c1:c0:52:ae:6c:08:00 SRC=95.211.9.133 DST=192.168.1.232 LEN=40 TOS=0x00 PREC=0x00 TTL=56 ID=0 DF PROTO=TCP SPT=80 DPT=39638 WINDOW=0 RES=0x00 RST URGP=0
Aug 9 14:46:57 srv232 kernel: [15346.429152] [UFW BLOCK] IN=eth1 OUT= MAC=68:05:ca:08:38:66:c0:c1:c0:52:ae:6c:08:00 SRC=95.211.8.142 DST=192.168.1.232 LEN=40 TOS=0x00 PREC=0x00 TTL=56 ID=0 DF PROTO=TCP SPT=80 DPT=42806 WINDOW=0 RES=0x00 RST URGP=0
Aug 9 14:47:05 srv232 kernel: [15354.373082] [UFW BLOCK] IN=eth1 OUT= MAC=68:05:ca:08:38:66:c0:c1:c0:52:ae:6c:08:00 SRC=95.211.9.130 DST=192.168.1.232 LEN=40 TOS=0x00 PREC=0x00 TTL=56 ID=0 DF PROTO=TCP SPT=80 DPT=35243 WINDOW=0 RES=0x00 RST URGP=0
Что это за блокировки соединений на какие-то неясные порты, которые в статусе ufw даже не фигурируют?! Меня смущает, что они вроде как блокируются, хотя я их блокировать не просил...
Машинка находится в локальной сети но на нее проброшены порты через роутер для раздачи торрентов. Подозреваю, что эти соединения - торрент-клиенты, которые обращаются за раздачами.
Начал копать iptables, но очень мало там понимаю.

Скажите, в какой ситуации в лог могут попадать записи, указанные выше?
Как настроить ufw, чтобы логи не мусорились?
iptabels-save:
# Generated by iptables-save v1.4.12 on Fri Aug 9 16:11:47 2013
*nat
:PREROUTING ACCEPT [150346:18184513]
:INPUT ACCEPT [150214:18176241]
:OUTPUT ACCEPT [45051:7724156]
:POSTROUTING ACCEPT [44160:7562639]
-A PREROUTING -d 193.218.140.118/32 -p tcp -m tcp --dport 3389 -j DNAT --to-destination 192.168.122.99:3389
-A PREROUTING -d 192.168.1.232/32 -p tcp -m tcp --dport 3389 -j DNAT --to-destination 192.168.122.99:3389
-A OUTPUT -d 193.218.140.118/32 -p tcp -m tcp --dport 3389 -j DNAT --to-destination 192.168.122.99:3389
-A OUTPUT -d 192.168.1.232/32 -p tcp -m tcp --dport 3389 -j DNAT --to-destination 192.168.122.99:3389
-A POSTROUTING -s 192.168.122.0/24 ! -d 192.168.122.0/24 -p tcp -j MASQUERADE --to-ports 1024-65535
-A POSTROUTING -s 192.168.122.0/24 ! -d 192.168.122.0/24 -p udp -j MASQUERADE --to-ports 1024-65535
-A POSTROUTING -s 192.168.122.0/24 ! -d 192.168.122.0/24 -j MASQUERADE
COMMIT
# Completed on Fri Aug 9 16:11:47 2013
# Generated by iptables-save v1.4.12 on Fri Aug 9 16:11:47 2013
*mangle
:PREROUTING ACCEPT [4993439:714706289]
:INPUT ACCEPT [4732704:295739973]
:FORWARD ACCEPT [252417:418556854]
:OUTPUT ACCEPT [5015615:9668773797]
:POSTROUTING ACCEPT [5286380:10089472872]
-A POSTROUTING -o virbr0 -p udp -m udp --dport 68 -j CHECKSUM --checksum-fill
COMMIT
# Completed on Fri Aug 9 16:11:47 2013
# Generated by iptables-save v1.4.12 on Fri Aug 9 16:11:47 2013
*filter
:INPUT ACCEPT [60:1860]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [29:1022]
:ufw-after-forward - [0:0]
:ufw-after-input - [0:0]
:ufw-after-logging-forward - [0:0]
:ufw-after-logging-input - [0:0]
:ufw-after-logging-output - [0:0]
:ufw-after-output - [0:0]
:ufw-before-forward - [0:0]
:ufw-before-input - [0:0]
:ufw-before-logging-forward - [0:0]
:ufw-before-logging-input - [0:0]
:ufw-before-logging-output - [0:0]
:ufw-before-output - [0:0]
:ufw-logging-allow - [0:0]
:ufw-logging-deny - [0:0]
:ufw-not-local - [0:0]
:ufw-reject-forward - [0:0]
:ufw-reject-input - [0:0]
:ufw-reject-output - [0:0]
:ufw-skip-to-policy-forward - [0:0]
:ufw-skip-to-policy-input - [0:0]
:ufw-skip-to-policy-output - [0:0]
:ufw-track-input - [0:0]
:ufw-track-output - [0:0]
:ufw-user-forward - [0:0]
:ufw-user-input - [0:0]
:ufw-user-limit - [0:0]
:ufw-user-limit-accept - [0:0]
:ufw-user-logging-forward - [0:0]
:ufw-user-logging-input - [0:0]
:ufw-user-logging-output - [0:0]
:ufw-user-output - [0:0]
-A INPUT -i virbr0 -p udp -m udp --dport 53 -j ACCEPT
-A INPUT -i virbr0 -p tcp -m tcp --dport 53 -j ACCEPT
-A INPUT -i virbr0 -p udp -m udp --dport 67 -j ACCEPT
-A INPUT -i virbr0 -p tcp -m tcp --dport 67 -j ACCEPT
-A INPUT -j ufw-before-logging-input
-A INPUT -j ufw-before-input
-A INPUT -j ufw-after-input
-A INPUT -j ufw-after-logging-input
-A INPUT -j ufw-reject-input
-A INPUT -j ufw-track-input
-A FORWARD -d 192.168.122.0/24 -o virbr0 -m state --state RELATED,ESTABLISHED -j ACCEPT
-A FORWARD -s 192.168.122.0/24 -i virbr0 -j ACCEPT
-A FORWARD -i virbr0 -o virbr0 -j ACCEPT
-A FORWARD -o virbr0 -j REJECT --reject-with icmp-port-unreachable
-A FORWARD -i virbr0 -j REJECT --reject-with icmp-port-unreachable
-A FORWARD -j ufw-before-logging-forward
-A FORWARD -j ufw-before-forward
-A FORWARD -j ufw-after-forward
-A FORWARD -j ufw-after-logging-forward
-A FORWARD -j ufw-reject-forward
-A OUTPUT -j ufw-before-logging-output
-A OUTPUT -j ufw-before-output
-A OUTPUT -j ufw-after-output
-A OUTPUT -j ufw-after-logging-output
-A OUTPUT -j ufw-reject-output
-A OUTPUT -j ufw-track-output
-A ufw-after-input -p udp -m udp --dport 137 -j ufw-skip-to-policy-input
-A ufw-after-input -p udp -m udp --dport 138 -j ufw-skip-to-policy-input
-A ufw-after-input -p tcp -m tcp --dport 139 -j ufw-skip-to-policy-input
-A ufw-after-input -p tcp -m tcp --dport 445 -j ufw-skip-to-policy-input
-A ufw-after-input -p udp -m udp --dport 67 -j ufw-skip-to-policy-input
-A ufw-after-input -p udp -m udp --dport 68 -j ufw-skip-to-policy-input
-A ufw-after-input -m addrtype --dst-type BROADCAST -j ufw-skip-to-policy-input
-A ufw-after-logging-forward -m limit --limit 3/min --limit-burst 10 -j LOG --log-prefix "[UFW BLOCK] "
-A ufw-before-forward -j ufw-user-forward
-A ufw-before-input -i lo -j ACCEPT
-A ufw-before-input -m state --state RELATED,ESTABLISHED -j ACCEPT
-A ufw-before-input -m state --state INVALID -j ufw-logging-deny
-A ufw-before-input -m state --state INVALID -j DROP
-A ufw-before-input -p icmp -m icmp --icmp-type 3 -j ACCEPT
-A ufw-before-input -p icmp -m icmp --icmp-type 4 -j ACCEPT
-A ufw-before-input -p icmp -m icmp --icmp-type 11 -j ACCEPT
-A ufw-before-input -p icmp -m icmp --icmp-type 12 -j ACCEPT
-A ufw-before-input -p icmp -m icmp --icmp-type 8 -j ACCEPT
-A ufw-before-input -p udp -m udp --sport 67 --dport 68 -j ACCEPT
-A ufw-before-input -j ufw-not-local
-A ufw-before-input -d 224.0.0.251/32 -p udp -m udp --dport 5353 -j ACCEPT
-A ufw-before-input -d 239.255.255.250/32 -p udp -m udp --dport 1900 -j ACCEPT
-A ufw-before-input -j ufw-user-input
-A ufw-before-output -o lo -j ACCEPT
-A ufw-before-output -m state --state RELATED,ESTABLISHED -j ACCEPT
-A ufw-before-output -j ufw-user-output
-A ufw-logging-allow -m limit --limit 3/min --limit-burst 10 -j LOG --log-prefix "[UFW ALLOW] "
-A ufw-logging-deny -m state --state INVALID -m limit --limit 3/min --limit-burst 10 -j RETURN
-A ufw-logging-deny -m limit --limit 3/min --limit-burst 10 -j LOG --log-prefix "[UFW BLOCK] "
-A ufw-not-local -m addrtype --dst-type LOCAL -j RETURN
-A ufw-not-local -m addrtype --dst-type MULTICAST -j RETURN
-A ufw-not-local -m addrtype --dst-type BROADCAST -j RETURN
-A ufw-not-local -m limit --limit 3/min --limit-burst 10 -j ufw-logging-deny
-A ufw-not-local -j DROP
-A ufw-skip-to-policy-forward -j DROP
-A ufw-skip-to-policy-input -j ACCEPT
-A ufw-skip-to-policy-output -j ACCEPT
-A ufw-track-input -p tcp -m state --state NEW -j ACCEPT
-A ufw-track-input -p udp -m state --state NEW -j ACCEPT
-A ufw-track-output -p tcp -m state --state NEW -j ACCEPT
-A ufw-track-output -p udp -m state --state NEW -j ACCEPT
-A ufw-user-input -p tcp -m tcp --dport 3389 -m state --state NEW -m recent --set --name DEFAULT --rsource
-A ufw-user-input -p tcp -m tcp --dport 3389 -m state --state NEW -m recent --update --seconds 30 --hitcount 6 --name DEFAULT --rsource -j ufw-user-limit
-A ufw-user-input -p tcp -m tcp --dport 3389 -j ufw-user-limit-accept
-A ufw-user-input -p udp -m udp --dport 3389 -m state --state NEW -m recent --set --name DEFAULT --rsource
-A ufw-user-input -p udp -m udp --dport 3389 -m state --state NEW -m recent --update --seconds 30 --hitcount 6 --name DEFAULT --rsource -j ufw-user-limit
-A ufw-user-input -p udp -m udp --dport 3389 -j ufw-user-limit-accept
-A ufw-user-input -p tcp -m tcp --dport 22 -m state --state NEW -m recent --set --name DEFAULT --rsource
-A ufw-user-input -p tcp -m tcp --dport 22 -m state --state NEW -m recent --update --seconds 30 --hitcount 6 --name DEFAULT --rsource -j ufw-user-limit
-A ufw-user-input -p tcp -m tcp --dport 22 -j ufw-user-limit-accept
-A ufw-user-input -p udp -m udp --dport 22 -m state --state NEW -m recent --set --name DEFAULT --rsource
-A ufw-user-input -p udp -m udp --dport 22 -m state --state NEW -m recent --update --seconds 30 --hitcount 6 --name DEFAULT --rsource -j ufw-user-limit
-A ufw-user-input -p udp -m udp --dport 22 -j ufw-user-limit-accept
-A ufw-user-input -p tcp -m tcp --dport 21 -m state --state NEW -m recent --set --name DEFAULT --rsource
-A ufw-user-input -p tcp -m tcp --dport 21 -m state --state NEW -m recent --update --seconds 30 --hitcount 6 --name DEFAULT --rsource -j ufw-user-limit
-A ufw-user-input -p tcp -m tcp --dport 21 -j ufw-user-limit-accept
-A ufw-user-limit -m limit --limit 3/min -j LOG --log-prefix "[UFW LIMIT BLOCK] "
-A ufw-user-limit -j REJECT --reject-with icmp-port-unreachable
-A ufw-user-limit-accept -j ACCEPT
COMMIT
# Completed on Fri Aug 9 16:11:47 2013