Hi,

Sorry to bother you people again.

Actually I couldn't get the commands working.

 

>(note that you need to include the length of the IP address - hence the
extra '4')

Can you please explain the above line.

 

I tried like this.

 

[root@localhost ~]# snmpget -v 2c -c public 10.20.20.20
ipAddressIfIndex.ipv4.4.10.10.10.10

IP-MIB::ipAddressIfIndex.ipv4."10.10.10.10" = INTEGER: 3

 

And I believe this is the value to be used in the next command.

 

[root@localhost ~]# snmpset -v 2c -c public 10.20.20.20
ipAddressIfIndex.ipv4.4.10.10.10.30 = 3

Error in packet.

Reason: inconsistentName (That object can not currently be created)

Failed object: IP-MIB::ipAddressIfIndex.ipv4."10.10.10.30"

 

[root@localhost ~]# snmpset -v 2c -c public 10.20.20.20
ipAddressStatus.ipv4.4.10.10.10.30 = createAndGo

ipAddressStatus.ipv4.4.10.10.10.30: Bad value name (createAndGo)

 

[root@localhost ~]# snmpset -v 2c -c public 10.20.20.20
ipAddressStatus.ipv4.4. 10.10.10.30 = destroy

ipAddressStatus.ipv4.4. 10.10.10.30: Bad value name (destroy)

 

Off Topic

=======

Is there any way to access the mail archive of snmp-coders.

If it is possible, it would be useful for new-comers like me to find
similar queries, which may have been answered already.

 

 

Thanks and Regards,

Basil Joseph.

 

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 

-----Original Message-----
From: [email protected] [mailto:[email protected]] On
Behalf Of Dave Shield
Sent: 24 November 2011 18:26
To: Basil Joseph (WT01 - GMT-Telecom Equipment)
Cc: [email protected]
Subject: Re: Setting IP address through SNMP

 

On 24 November 2011 12:10,  <[email protected]
<mailto:[email protected]> > wrote:

> I have to configure the IP address of eth1 interface of a network
device.

 

> I can get the IP address of the eth1 interface by # snmpget -v 2c -c 

> public 10.20.20.20 ipAdEntAddr.10.10.10.10

 

 

> The permission for that OID is read-only.

> So I can't issue a set command.

 

 

The ipAddrTable is specific to IPv4, and has been deprecated in favour
of the ipAddressTable, which can handle both IPv4 and IPv6, and *does*
support modification via SNMP.

 

The equivalent request would probably be something like

 

   # snmpget .... ipAddressIfIndex.ipv4.4.10.10.10.10

 

(note that you need to include the length of the IP address - hence the
extra '4')

 

 

 

> If I have to change the ip address to, say 10.10.10.30, what I have to
do?

 

Try

 

  #  snmpset ....

           ipAddressIfIndex.ipv4.4.10.10.10.11 = 1    #  ifIndex as
above

           ipAddressStatus.ipv4.4.10.10.10.11 = createAndGo

 

(to add the new address)

 

  #  snmpset ....

           ipAddressStatus.ipv4.4.10.10.10.10 = destroy

 

(to remove the new address)

 

 

Dave

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to