アクセスリストでの"log"の利用方法
- カテゴリ:
- Cisco
今回はアクセスリストでの"log"の利用方法を確認します。R1とR2はF0/0で接続されており、EIGRPが設定されています。
| R1(config)#do sh ip int b Interface IP-Address OK? Method Status Protocol FastEthernet0/0 12.12.12.1 YES manual up up Loopback0 17.17.1.1 YES NVRAM up up R2(config)#do sh ip int b Interface IP-Address OK? Method Status Protocol FastEthernet0/0 12.12.12.2 YES manual up up Loopback0 17.17.2.2 YES NVRAM up up R1(config)#do sh ip ei 100 int IP-EIGRP interfaces for process 100 Xmit Queue Mean Pacing Time Multicast Pending Interface Peers Un/Reliable SRTT Un/Reliable Flow Timer Routes Fa0/0 1 0/0 12 0/1 50 0 Lo0 0 0/0 0 0/1 0 0 R1(config)#do sh ip rou ei 17.0.0.0/24 is subnetted, 2 subnets D 17.17.2.0 [90/156160] via 12.12.12.2, 00:08:57, FastEthernet0/0 R1(config)#do pin 17.17.2.2 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 17.17.2.2, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 4/8/12 ms |
pingを通すためのアクセスリストを作成します。EIGRPも併せて許可しています。
| R2(config)#ip access-list extended LIST1 R2(config-ext-nacl)#10 permit icmp an an R2(config-ext-nacl)#100 per eigrp an an R2(config-ext-nacl)#do sh ip acce Extended IP access list LIST1 10 permit icmp any any 100 permit eigrp any any |
F0/0に適用して、pingコマンドを実行します。
| R2(config-ext-nacl)#int f0/0 R2(config-if)#ip access-group LIST1 in R2(config-if)#do sh ip int f0/0 | i LIST1 Inbound access list is LIST1 |
実行後、R1よりpingを実行します。
| R1(config)#do pin 17.17.2.2 〜略〜 !!!!! |
R2でアクセスリストを確認すると"15 matches"となっており、正しく適用されたことが分かります。
| R2(config)#do sh ip acce Extended IP access list LIST1 10 permit icmp any any (15 matches) 100 permit eigrp any any (6 matches) |
ICMPの行に"log"を追加します。
| R2(config)#ip access-list extended LIST1 R2(config-ext-nacl)#no 10 per icmp an an R2(config-ext-nacl)#10 per icm an an log R2(config-ext-nacl)#do sh ip acce Extended IP access list LIST1 10 permit icmp any any log 〜略〜 |
R1でpingを実行すると、下記のようなログがR2に表示されます。
| Sep 5 06:12:46.347: %SEC-6-IPACCESSLOGDP: list LIST1 permitted icmp 12.12.12.1 -> 17.17.2.2 (0/0), 5 packets |
"log"を"log-input"に変更します。
| R2(config-ext-nacl)#no 10 R2(config-ext-nacl)#10 permit icmp an an log-input |
R1でpingを実行すると、下記のようなログがR2に表示されます。"log"と違い、MACアドレスが表示されることが分かります。
| Sep 5 06:14:30.551: %SEC-6-IPACCESSLOGDP: list LIST1 permitted icmp 12.12.12.1 (FastEthernet0/0 c200.163f.0000) -> 17.17.2.2 (0/0), 5 packets |


コメント