16.06.2014 Views

Cisco CCNA Study Guide - Router Alley

Cisco CCNA Study Guide - Router Alley

Cisco CCNA Study Guide - Router Alley

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>CCNA</strong> <strong>Study</strong> <strong>Guide</strong> v2.62 – Aaron Balchunas<br />

263<br />

Access List Logging<br />

Consider again the following example:<br />

Assume there is a webserver on the 172.16.x.x network with an IP address<br />

of 172.16.10.10.<br />

We wish to keep track of the number of packets permitted or denied by each<br />

line of an access-list. Access-lists have a built-in logging mechanism for<br />

such a purpose:<br />

<strong>Router</strong>(config)# access-list 101 permit tcp 172.18.0.0 0.0.255.255 host 172.16.10.10 eq 80 log<br />

<strong>Router</strong>(config)# access-list 101 deny ip 172.18.0.0 0.0.255.255 172.16.0.0 0.0.255.255 log<br />

<strong>Router</strong>(config)# access-list 101 permit ip any any log<br />

Notice we added an additional keyword log to each line of the access-list.<br />

When viewing an access-list using the following command:<br />

<strong>Router</strong># show access-list 101<br />

We will now have a counter on each line of the access-list, indicating the<br />

number of packets that were permitted or denied by that line. This<br />

information can be sent to a syslog server:<br />

<strong>Router</strong>(config)# logging on<br />

<strong>Router</strong>(config)# logging 172.18.1.50<br />

The logging on command enables logging. The second logging command<br />

points to a syslog host at 172.18.1.50.<br />

We can include more detailed logging information, including the source<br />

MAC address of the packet, and what interface that packet was received on.<br />

To accomplish this, use the log-input argument:<br />

<strong>Router</strong>(config)# access-list 101 permit ip any any log-input<br />

* * *<br />

All original material copyright © 2013 by Aaron Balchunas (aaron@routeralley.com),<br />

unless otherwise noted. All other material copyright © of their respective owners.<br />

This material may be copied and used freely, but may not be altered or sold without the expressed written<br />

consent of the owner of the above copyright. Updated material may be found at http://www.routeralley.com.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!