snmpset the ip default-gateway

Unanswered Question
Jan 10th, 2008

Hi everybody,

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

snmpset -c geheim -v 2c myhost .1.3.6.1.2.1.16.19.12.0 a 192.168.1.254

Error in packet.

Reason: commitFailed

Failed object: 16.19.12.0

Debugging on the 2950:

#debug snmp packets

SNMP packet debugging is on

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

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

rmon.19.12.0 = 192.168.1.254

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 = 192.168.1.254

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

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

Rolf

I have this problem too.
0 votes
  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (1 ratings)
Loading.
yjdabear Thu, 01/10/2008 - 07:07

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

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 0.0.0.0."

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

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:

http://www.cisco.com/en/US/tech/tk648/tk362/technologies_configuration_example09186a0080094aa6.shtml

PAUL TRIVINO Thu, 01/10/2008 - 16:09

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

Paul

Actions

This Discussion