Help us understand the problem. What is going on with this article?

Vyatta の Firewall の Log

More than 3 years have passed since last update.

前提

試しに以下のような設定で、ログをとってみます。

show firewall 
 name IN {
     default-action drop
     enable-default-log
     rule 20 {
         action drop
         log enable
         protocol icmp
     }
 }

ファイアウォールのデフォルトアクションのログ

set firewall name IN enable-default-log

の記述により、ファイアウォールのデフォルトアクションのログを

show log firewall name IN

でみることができます。
(ログ本体は、/var/log/messages に保存されていく形です。)

vyos@khayama-test:~$ show log firewall name IN
Apr 13 01:36:59 khayama-test kernel: [143095.733345] [LOCAL-default-D]IN=eth1 OUT= MAC=06:b1:48:85:80:75:e4:c7:22:63:xx:xx:xx:xx SRC=223.xx.xx.xx DST=161.xx.xx.xx LEN=40 TOS=0x00 PREC=0x00 TTL=44 ID=31841 PROTO=TCP SPT=8089 DPT=23 WINDOW=12977 RES=0x00 SYN URGP=0 

ファイアウォールの各ルールのログ

特定のルールについても、

set firewall name IN rule 20 log enable 

と記述しておくことで

show log firewall name IN rule 20 

でルールごとのログをみることができます。

また、

monitor firewall name IN rule 20 

でリアルタイムにログ監視することができます。

vyos@khayama-test:~$ monitor firewall name IN 
Notice: monitoring information is displayed only for rules with enabled logging
Firewall-IN-rule-20: [143430.504542] [IN-20-D] IN=eth1 OUT=eth0 MAC=06:b1:48:85:80:75:e4:c7:22:61:xx:xx:xx:xx SRC=172.xx.xx.xx DST=10.xx.xx.xx LEN=60 TOS=0x00 PREC=0x00 TTL=56 ID=0 PROTO=ICMP TYPE=0 CODE=0 ID=1 SEQ=1361
khayama
このサイトにおける掲載内容はあくまで私自身の見解であり、必ずしも私の所属団体・企業における立場、戦略、意見を代表するものではありません。
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした