- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 2.2k
 
Contrib: Code: RIPMonitor
        Pierre LALET edited this page Jan 17, 2016 
        ·
        1 revision
      
    You need to monitor RIP broadcast as they happen to help diagnose RIP problems
#! /usr/bin/env python
from scapy import *
import IPy
def rip_cb(p):
        try:
                src = socket.gethostbyaddr(p[IP].src)[0]
        except socket.herror, e:
                if e.args[0] == 1:
                        src = p[IP].src
        re = p[RIPEntry]
        while type(re) != NoPayload:
                addr = re.addr + "/" + re.mask
                print "%-25s %-18s %s" % \
                        ( src, IPy.IP(addr), re.metric)
                re = re.payload
sniff(prn=rip_cb, filter="udp and dst port route", store=0)When run it prints out three columns the source address, the route offered and the metric.
[SimplisticARPMonitor](Contrib: Code: SimplisticARPMonitor)
Thomas Stewart 2008