• About

http://blog.fakrul.com

http://blog.fakrul.com

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

  • krebsonsecurity.com/2021/03/whistl… 1 week ago
  • very production vs code extension marketplace.visualstudio.com/items?itemName… 1 week ago
  • afr.com/companies/tour… 1 week ago
  • RT @Tyriar: We're looking at finally adding terminal tabs to @code soon. This month we explored what the UX should look like and have some… 2 weeks ago
  • RT @teamcymru: April 7 at 10AM GMT +3 We're hosting a webinar on our FREE community services! Live DEMO of Nimbus and learn about • DDoS mi… 2 weeks ago
  • Interesting! Looks like #cloudflare is not just a CDN only. cloudflare.com/en-au/magic-wan 2 weeks ago
  • still beta but good to see #meraki is rolling out AnyConnect client for MX. Windows L2TP VPN client is pain-in-the-… twitter.com/i/web/status/1… 3 weeks ago
  • one more bug reported cisco.ios.ios_bgp_address_family module github.com/ansible-collec… #ansible #cisco #ios… twitter.com/i/web/status/1… 4 weeks ago
  • #azure canola oil https://t.co/yEj1mCbQ4K 1 month ago
  • My first attempt to fix bug for cisco.ios.ios_bgp_address_family ansible module. PR done. github.com/ansible-collec… 1 month ago
  • RT @C_C_Krebs: This is the real deal. If your organization runs an OWA server exposed to the internet, assume compromise between 02/26-03/0… 1 month ago
  • RT @MirjamKuhne: This morning at #apricot2021 an update from NOGs in the region. https://t.co/kv7tEhszZf 1 month ago
  • RT @hfpreston: A Type 3 LSA walks into a bar and the bartender asks, “Not from the area?” A Type 5 LSA walks into a bar and orders a drink… 1 month ago
  • ansible.com/blog/announcin… 1 month ago
  • Time to refresh home wifi. Moving from #meraki to #Unifi https://t.co/9t6FYIfQfb 1 month 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.