Worms are hot topic of day. Blaster and Nachi are making trouble for ISPs as well as end users worldwide.
There are diffrent ways to combat these worms. If you are a network administrator utilizing Cisco gear in your network, you can reduce the effect of these worms using some simple tricks. I have already posted an article on blocking Blaster worm in a cisco router.
But blocking Nachi is a little bit tricky since it uses ICMP echo/reply to map your network and propagate its code. This will cause a heavy ICMP storm in your netowork (that you may have already noticed). The most simple way is blocking all ICMP traffic which is not a good solution and harms your customers (They won’t be able to do PING measurement in this case).
Here is what I did to protect against Nachi (in a Cisco router):
Setup your NULL0 interface like this:
!
interface Null0
no ip unreachables
!
Then make an access-list that matches ICMP echo/reply packets:
!
ip access-list extended nachi-list
permit icmp any any echo
permit icmp any any echo-reply
!
Now the trick:
!
route-map nachi permit 10
match ip address nachi-list
match length 92 92
set interface Null0
!
Fortunately, Nachi uses fixed size ICMP packets (92 bytes, including IP header) as reachability probe. Above route-map will forward all ICMP packets with size of 92 bytes to Null0 interface. Null0 will not return any unreachable code and just drops the packet.
You should put this route-map on your network interface, like this (necessary parts listed only):
!
interface FastEthernet0/0
description Connected to Local Network
ip route-cache policy
ip policy route-map nachi
!
That “ip route-cache policy” is very important because it asks the router to cache all policy-route information in order to reduce processor load. (CEF won’t be useful here).
This is the result after 5 minutes:
router#sh route-map nachi
route-map nachi, permit, sequence 10
Match clauses:
ip address (access-lists): nachi-list
length 92 92
Set clauses:
interface Null0
Policy routing matches: 190909 packets, 20236354 bytes
Congratulations! Your network is saved.