cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
4032
Views
0
Helpful
4
Replies

Ho to Change default-gateway using SNMP

Hello,

I need to change default gateway of 140  2960 switches. I'm wondering if anyone knows if it's possible to do that usign SNMP.

I'm testing net-snmp, but i'm receiving an error when setting the OID I think tha is the default-gateway.

#snmpwalk -v 3 -u USER -a SHA -l authNoPriv -A Password 1.1.1.100 | grep -i 1.1.1.1 (1.1.1.1 is the current default-gateway)


RFC1213-MIB::atIfIndex.10.1.1.1.1.1 = INTEGER: 10
RFC1213-MIB::atPhysAddress.10.1.1.1.1.1 = Hex-STRING: xx xx xx xx xx xx
RFC1213-MIB::atNetAddress.10.1.1.1.1.1 = Network Address: xx:xx:xx:xx
IP-MIB::ipNetToMediaIfIndex.10.1.1.1.1 = INTEGER: 10
IP-MIB::ipNetToMediaPhysAddress.10.1.1.1.1 = STRING: x:x:xx:x:x:xx
IP-MIB::ipNetToMediaNetAddress.10.1.1.1.1 = IpAddress: 1.1.1.1
IP-MIB::ipNetToMediaType.10.1.1.1.1 = INTEGER: dynamic(3)
SNMPv2-SMI::mib-2.16.19.12.0 = IpAddress: 1.1.1.1

#snmpset -v 3 -u USER -a SHA -l authNoPriv -A Password 1.1.1.100 SNMPv2-SMI::mib-2.16.19.12.0 a 1.1.1.2

Error in packet.
Reason: commitFailed
Failed object: SNMPv2-SMI::mib-2.16.19.12.0

4 Replies 4

paolo bevilacqua
Hall of Fame
Hall of Fame

Try the network management forum.

yjdabear
VIP Alumni
VIP Alumni

The same topic came up before: https://supportforums.cisco.com/thread/170135

That OID is "read-create" so it's not changable via snmpset. However, you could change the default-gateway by sending a full config to the device via snmpset.

instead of using  SNMPv2-SMI::mib-2.16.19.12.0  use the actual OID.

i believe you can set it like this ipRouteNextHop.0.0.0.0 a X.X.X.X

http://tools.cisco.com/Support/SNMP/do/BrowseOID.do?objectInput=.1.3.6.1.2.1.4.21.1.7+&translate=Translate&submitValue=SUBMIT

I have not tested what i suggested. Since an experienced member is saying it is not possible directly, i would suggest you test my suggestion in a lab before you set it on a prdn box.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: