Menu

#197 Change IP address of device

fixed
ND1-Parity (18)
2015-11-28
2015-01-16
No

Is it possible to add ND1 option to change the IP address of a device in ND2?

-i || --changeip old_ip new_ip

Change IP address of device. Creates new entry, removes old one and moves nodes over to the new one.

Discussion

  • Oliver Gorwits

    Oliver Gorwits - 2015-02-04
    • labels: --> ND1-Parity
    • status: new --> fixed
    • assigned_to: Oliver Gorwits
     
    • Frederik Reenders

      Post awaiting moderation.
  • Oliver Gorwits

    Oliver Gorwits - 2015-02-04

    Hi,

    This feature is implemented in commit [9179b41] and will be in the next release.

    regards,
    oliver.

     
  • Frederik Reenders

    Hi,

    Is it possible to allow the renumbering of the device ip in an ip that's already on the device?
    For example we have a switch with 2 addresses. We want to renumber the device to get the secondary ip as the root ip.
    When we do this now we get an error stating the ip is already in use.
    It is but on the same device.

    Example error:

    netdisco-do renumber -d 10.12.2.5 -e 172.17.46.4
    [38315] 2015-02-20 15:39:04 info renumber: started at Fri Feb 20 16:39:04 2015
    [38315] 2015-02-20 15:39:04 info renumber: finished at Fri Feb 20 16:39:04 2015
    [38315] 2015-02-20 15:39:04 info renumber: status error: Already know new device: 10.12.2.5

    Regards,

    Frederik

     
  • Oliver Gorwits

    Oliver Gorwits - 2015-02-23
    • status: fixed --> taken
     
  • Oliver Gorwits

    Oliver Gorwits - 2015-02-23
    • status: taken --> fixed
     
  • Oliver Gorwits

    Oliver Gorwits - 2015-02-23

    Hi Frederik,

    Unfortunately this cannot be done.

    The selection of "root" or "canonical" IP for any device is done by SNMP::Info->root_ip() method (which picks an IP from all IPs on the system using some magical rules), so even if you could change the IP, it would revert on the next discovery. This is a fairly fundamental restriction in Netdisco and SNMP::Info, and needs additional coding and configuration to be fixed.

    Sorry about that,

    regards,
    oliver.

     
  • Frederik Reenders

    Hi Oliver,

    We found that SNMP::Info does not have a magic rule to determine to root_ip and does not change it back on a new discover.
    If we renumber a device in netdisco it just keeps using that ip as the root ip from that point.

    It would be nice if you could make it possible the renumber the ip to an secondary ip already on the device.

    We are running the patch I added as attachments(2 files) in our production right now without any problems.

    Can you maybe add this or something like this to netdisco 2?

    Regards,

    Frederik

     
  • Frederik Reenders

    Hmmm. and the second file. :)

     
  • Jeroen van Ingen

    To clarify: what we found is that root_ip() only seems to be used at the first discover. When we renumber a device from it's original root to one of its aliases, Netdisco doesn't seem to change it back on subsequent discovers.

     
  • Oliver Gorwits

    Oliver Gorwits - 2015-03-24
    • status: fixed --> taken
     
  • Frederik Reenders

    Hi Oliver,

    Does this line "fix bug in renumbering to an alias" in your last commit for version 2.032003 mean this ticket is also fixed?

    Regards,

    Frederik

     
    • Oliver Gorwits

      Oliver Gorwits - 2015-05-12

      Hi Frederik,

      I believe so, yes. It's possible to renumber a device to any of its aliases and this will not be challenged by Netdisco. See the release notes for a little more info:

      https://metacpan.org/pod/release/OLIVER/App-Netdisco-2.032003/lib/App/Netdisco/Manual/ReleaseNotes.pod

      I kept the ticket open because what I'd like to implement next are some configuration rules for selecting the correct canonical IP on first discovery.

      regards,
      oliver.

       
  • Oliver Gorwits

    Oliver Gorwits - 2015-11-28
    • status: taken --> fixed