Tuesday 21 September 2010

How To: Use MRTG with GNS3


What is MRTG?

  • MRTG is opensource program which gets traffic statistics from devices using SNMP and builds graphs like this:

Installing MRTG

Setup virtual topology

In this case we wan’t to make most simple example so we are using only one router:
  •  Install Ms loopback adapter to your Windows machine and configured IP-address 10.10.10.1/24 for it.
  • Configure router:
hostname R0
!
interface FastEthernet1/0
ip address 10.10.10.2 255.255.255.0
duplex auto
speed auto
!
!
!
snmp-server community mycommunity RO
Verify that ping goes from your local computer to emulated router R0

Configure and run MRTG

  • After you have configured MRTG with command:
perl cfgmaker mycommunity@10.10.10.2 –global “WorkDir: c:\www\mrtg” –output mrtg.cfg
  • Run MRTG with command:
perl mrtg mrtg.cfg
Every time when you run MRTG it will get data from the router and save it. You can run MRTG manually every 5 minutes or configure this to happen automatically. To do this follow MRTGinstructions. When you have done this MRTG starts to build graph for you.

0 comments:

Post a Comment