• About

blog.alam.rocks

blog.alam.rocks

Tag Archives: SNMP

SNMP : Saving & Uploading router config

29 Tuesday Dec 2015

Posted by Fakrul Alam in My Work

≈ 1 Comment

Tags

cisco, SNMP

Save router configuration to tftp server:

#Set copy method via OID ccCopyProtocol:
snmpset -v 2c -c  {community-string} {device-ip-address} 1.3.6.1.4.1.9.9.96.1.1.1.1.2.112 i 1
#Set source filetype to running-config via OID ccCopySourceFileType:
snmpset -v 2c -c  {community-string} {device-ip-address} 1.3.6.1.4.1.9.9.96.1.1.1.1.3.112 i 4
#Set destination to networkfile via OID ccCopyDestFileType:
snmpset -v 2c -c  {community-string} {device-ip-address} 1.3.6.1.4.1.9.9.96.1.1.1.1.4.112 i 1
#Set TFTP server ip via OID ccCopyServerAddress:
snmpset -v 2c -c  {community-string} {device-ip-address} 1.3.6.1.4.1.9.9.96.1.1.1.1.5.112 a {ip-address-tftp-server}
#Set destination filename via OID ccCopyFileName:
snmpset -v 2c -c  {community-string} {device-ip-address} 1.3.6.1.4.1.9.9.96.1.1.1.1.6.112 s router.cfg
#Start tftp download via OID ccCopyEntryRowStatus:
snmpset -v 2c -c  {community-string} {device-ip-address} 1.3.6.1.4.1.9.9.96.1.1.1.1.14.112 i 1

Upload router configuration from tftp server:

#Set copy method:
snmpset -v 2c -c {community-string} {device-ip-address} 1.3.6.1.4.1.9.9.96.1.1.1.1.2.116 i 1
#Set sourcefile to network file:
snmpset -v 2c -c {community-string} {device-ip-address} 1.3.6.1.4.1.9.9.96.1.1.1.1.3.116 i 1
#Set destination to running-config:
snmpset -v 2c -c {community-string} {device-ip-address} 1.3.6.1.4.1.9.9.96.1.1.1.1.4.116 i 4
#Set TFTP server ip:
snmpset -v 2c -c {community-string} {device-ip-address} 1.3.6.1.4.1.9.9.96.1.1.1.1.5.116 a {ip-address-tftp-server}
#Set desination filename:
snmpset -v 2c -c {community-string} {device-ip-address} 1.3.6.1.4.1.9.9.96.1.1.1.1.6.116 s output.cfg
#Start tftp upload via via OID ccCopyEntryRowStatus:
snmpset -v 2c -c {community-string} {device-ip-address} 1.3.6.1.4.1.9.9.96.1.1.1.1.14.116 i 1

Note: The integer highlighted in red is a random integer and you can choose any integer between 1 and 255. Keep in mind to use the same integer for the whole download procedure! See the integer as a session.

Install and Configure SNMP on Ubuntu

20 Wednesday Nov 2013

Posted by Fakrul Alam in Uncategorized

≈ Leave a comment

Tags

SNMP, ubuntu

This guide describe how to install and configure SNMP on Ubuntu.

1.Installation

root@netflow:/# sudo apt-get install snmpd

2. Configuration
Move existing /etc/snmp/snmpd.conf configuration file to /etc/snmp/snmpd.conf.org

root@netflow:/# mv /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.org

Create a new /etc/snmp/snmpd.conf file:

# Configure Read-Only community and restrict who can connect
rocommunity COPUBLIC 103.12.179.0/24
rocommunity COPUBLIC 127.0.0.1

# Information about this host
sysLocation bdHUB Dhaka Bangladesh
sysContact noc@bdhub.com

# Which OSI layers are active in this host
# (Application + End-to-End layers)
sysServices 72

Make snmpd use the newly created file and make it listen to all interfaces:

Edit /etc/default/snmpd

root@netflow:/# vi /etc/default/snmpd

Change from:

# snmpd options (use syslog, close stdin/out/err).
SNMPDOPTS=’-Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid 127.0.0.1’

To:

# snmpd options (use syslog, close stdin/out/err).
#SNMPDOPTS=’-Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid 127.0.0.1’
SNMPDOPTS=’-Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid -c /etc/snmp/snmpd.conf’

and restart snmpd

root@netflow:/# /etc/init.d/snmpd restart

3. Test
Check SNMP is running

root@netflow:/# sudo netstat -ulnp | grep 161
udp 0 0 0.0.0.0:161 0.0.0.0:* 28676/snmpd

Check the snmpstatus output

root@netflow:/# snmpstatus -c ‘COPUBLIC’ -v2c 103.12.179.12

Social

  • View rapappu’s profile on Twitter
  • View fakrulalam’s profile on LinkedIn
  • View fakrul’s profile on GitHub
  • View FakrulAlamPappu’s profile on Google+
  • View fakrulalam’s profile on Flickr

Twitter Updates

  • #sydeny #summer https://t.co/4FhMTbgG1g 1 week ago
  • RT @protocoljournal: The August 2022 issue of IPJ is ready. Head over to protocoljournal.org for your copy! https://t.co/c0dfwBQAuu 3 weeks ago
  • RT @teamcymru: Take The first step toward clarity, visibility, and reducing external asset related risks With our free Attack Surface Asses… 3 weeks ago
  • RT @akanygren: Have you been working with tech for years and want an overview of #IPv6? I've been working on an open source "Inessential I… 1 month ago
  • blog.lastpass.com/2022/11/notice… 2 months ago
  • #bdnog15 CfP is now open bdnog.org/bdnog15/cfp.php #bdnog #bangladesh #nog #networkoperatorsgroup 2 months ago
  • RT @Cloudflare: Today we’re introducing Cloudflare Radar’s route leak data and API so that anyone can get information about route leaks acr… 2 months ago
  • Battling Zimbabwe fall short as Bangladesh win in chaotic final-over finish espncricinfo.com/series/icc-men… #t20 #worldcup #bangladeh 3 months ago
  • RT @vince2_: With the team @Free_1337, we have developed a Netflow/IPFIX collector and visualizer. It is available at https://t.co/6XtpOtm9… 6 months ago
  • RT @openbsdnow: Effective Shell effective-shell.com 7 months ago
  • RT @nocontextfooty: https://t.co/PU0JeRSrbD 7 months ago
  • smallstep.com/blog/if-openss… 7 months ago
  • github.com/tldr-pages/tldr 9 months ago
  • How to properly interpret a traceroute or MTR | APNIC Blog blog.apnic.net/2022/03/28/how… 9 months ago
  • #dayandnight #Newcastle #beachlife https://t.co/LaKATcEsFY 10 months ago
Follow @rapappu

Tags

antismap antivirus automation Azure bangladesh BASH BASH Script BDCERT bgp bind ccsp centos CentOS mirror CERT CISA cisco Cyber Security ddos dhaka dhakacom DNS DNSSEC GSM intrusion detectoin system Intrusion prevention system ips IPv6 ISACA junos linux Looking Glass lxc lxc profile lxd mailqueue mailscanner Mail Server mailwatch Meraki mikrotik monitor mpls MPLS L3 VPN mysql My Work network network management nginx NSD observium OpenVPN perl PHP ping postfix Proxy PTA python RANCID Reading RPKI Shell Script sms sms server SNMP SSH Tutorial ubuntu Ubuntu Mirror Server Virtual Box vispan vmware websvn Youtube hack খামাখা

Blog at WordPress.com.

  • Follow Following
    • blog.alam.rocks
    • Join 27 other followers
    • Already have a WordPress.com account? Log in now.
    • blog.alam.rocks
    • Customize
    • Follow Following
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar