Val:~$ whoami

I am Val Glinskiy, network engineer specializing in data center networks. TIME magazine selected me as Person of the Year in 2006.

Search This Blog

Saturday, February 04, 2012

ip accounting-list

Cisco has interface level command "ip accounting" which records number of bytes and packets passed through the router. If you want to count traffic only for specific IP address, you need to use "ip accounting-list" command. There seems to be a tiny bug in context help in 12.4(15)T14:

R2(config)#ip accounting-list 1.1.1.1 ?
  A.B.C.D  IP address mask

Note that context help says you need to enter address mask. 
R2(config)#ip accounting-list 1.1.1.1 255.255.255.255

After checking
R2(config)#do sho run | i accounting
ip accounting-list 0.0.0.0 255.255.255.255

That's not what I entered. In reality, you are supposed to enter wildcard mask, which makes more sense. Specifying ACL number or name would have made even more sense. So, let's fix it:

R2(config)#no ip accounting-list 0.0.0.0 255.255.255.255
R2(config)#ip accounting-list 1.1.1.1 0.0.0.0
R2(config)#interface fa 0/0
R2(config-if)#ip accounting

and test it. Traffic from R3 to 192.168.12.1 and 1.1.1.1 must pass through R2's Fa0/0 interface: 

R3#ping 192.168.12.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.12.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 28/58/120 ms
R3#ping 1.1.1.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/47/88 ms

R2#sho ip account
   Source           Destination              Packets               Bytes
 192.168.23.3     1.1.1.1                          5                 500

As you can see from the output above, only pings to 1.1.1.1 got counted.

1 comment:

  1. Once you've have} one of these information, have the ability to|you presumably can} import it into your printer’s slicer software to generate the G-code that the printer will use to print your design. Now that you’ve got a bunch of really wonderful 3D printed initiatives accomplished, why not showcase your best 3D prints? We’d advocate a web-based portfolio website that has a variety of|quite a lot of|a wide range of} stylish templates select from|to choose from} and provides a free trial . With all of the cool things to 3D print, you’ll ready to|be succesful of|have the ability to} update your portfolio with broad variety|all kinds} of kid bathroom shower curtain merchandise. Once purchasers see all your 3D printer designs, they’ll be clamoring to have you print one thing magical only for them. A actual robotic made in your home home} with only some wires and some 3D printed materials?

    ReplyDelete