Secure Computing SG570 Instrukcja Użytkownika Strona 309: Creating Custom Log Rules

/ 341
Spis treści
Rozwiązywanie problemów
iptables -I FORWARD -j LOG -p tcp --syn -s 5.6.7.8/32 -d
192.168.1.1 --dport 25 --log-prefix "Mail for flubber: "
This results in log output similar to:
<12> Jan 24 18:17:19 2000 klogd: Mail for flubber: IN=eth1
OUT=eth0 SRC=5.6.7.8 DST=192.168.1.1 LEN=48 TOS=0x00 PREC=0x00
TTL=126 ID=45507 DF PROTO=TCP SPT=4088 DPT=25 WINDOW=64240
RES=0x00 SYN URGP=0
Note how the
OUT
value has now changed to show which interface the access attempt
used to reach the internal host. As this request arrived on eth1 and was destined for
eth0, we can determine that it was an
inbound
request, since eth0 is the LAN port, and
eth1 is usually the WAN port.
An
outbound
request would have
IN=eth0
and
OUT=eth1
.
It is possible to use the
-i
and
-o
arguments to specify the interface that are to be
considered for
IN
and
OUT
respectively. When the
!
argument is used before the
interface name, the sense is inverted. A name ending in a
+
matches any interface that
begins with the name. e.g.
iptables -I FORWARD -j LOG -i eth0 -p tcp ...
This rule logs outbound from the LAN (eth0) only. We could limit that further by
specifying which interface it is outbound to, by using the
-o
option.
iptables -I FORWARD -j LOG -i eth0 -o eth1 -p tcp ...
This logs LAN traffic destined for the WAN, but won't log LAN traffic destined for a PPP
or perhaps IPSec link.
Similarly, we could construct a rule that looks at all inbound/outbound traffic, but excludes
VPN traffic, thus:
iptables -I FORWARD -j LOG -i eth+ -o eth+ -p tcp ...
303
Appendix B – System Log

Plik PDF · ·

Drukuj

Drukuj dokument

Dzielenie się

Pytania o Secure Computing SG570

Nie ma jeszcze pytań o tę instrukcję. Zadaj pierwsze.

Zadaj pytanie

Odpowiadamy na podstawie instrukcji i wskazujemy stronę. Pytanie pojawi się w serwisie po sprawdzeniu.

Wszystkie pytania i odpowiedzi ›

Powiązane produkty i podręczniki dla Bramy / kontrolery Secure Computing SG570