snmpset the ip default-gateway

Unanswered Question
Jan 10th, 2008
User Badges:

Hi everybody,

I've been trying to set the gateway ip-address of a Catalyst 2950 via SNMP:

snmpset -c geheim -v 2c myhost . a

Error in packet.

Reason: commitFailed

Failed object:

Debugging on the 2950:

#debug snmp packets

SNMP packet debugging is on

Jan 10 13:42:17: SNMP: Packet received via UDP from on Vlan1

Jan 10 13:42:17: SNMP: Set request, reqid 1804646304, errstat 0, erridx 0

rmon.19.12.0 =

Jan 10 13:42:17:

Incoming SNMP packet

Jan 10 13:42:17: v1 packet

Jan 10 13:42:17: community string: geheim

Jan 10 13:42:17: SNMP: Response, reqid 1804646304, errstat 14, erridx 1

rmon.19.12.0 =

Jan 10 13:42:17: SNMP: Packet sent via UDP to

The variable's (netDefaultGateway.0) permission is "read-create".

Is it not allowed to set this variable or am I doing something wrong?

Thanks in advance


  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (1 ratings)
yjdabear Thu, 01/10/2008 - 07:07
User Badges:
  • Gold, 750 points or more

I don't think this is the way to set the default gateway on a Cisco device, since this OID you're trying to set is part of the RMON2-MIB. In fact, I don't know if it's even possible to set the default gateway via SNMP. Has this method worked for you before?

Rolf Fischer Thu, 01/10/2008 - 07:48
User Badges:

No, I'm trying it for the first time like that.

I can't access the switch and changing the GW would be a solution. By using SNMP I can configure changes without needing the way back from the switch to my location, that's the reason...

The description of this variable says

"The IP Address of the default gateway. If this value is

undefined or unknown, it shall have the value"

which sounds good for me but I'm not sure if I can change it via SNMP.

David Stanford Thu, 01/10/2008 - 09:31
User Badges:
  • Cisco Employee,

It looks like there is no way to set this via snmp.

From what I see all the write capabilities on objects allow route entries (such as default route) to deleted, but not modified.

You can only modify the routing table using the CLI or downloading new configuration files to the device. The second option is possible via this doc:

PAUL TRIVINO Thu, 01/10/2008 - 16:09
User Badges:
  • Bronze, 100 points or more

Perhaps it can be set via SNMP using the CONFIG MIB - I think you're right about the MIB-II set...



This Discussion