Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Two devices on same IP - not at the same time !

    Scheduled Pinned Locked Moved DHCP and DNS
    7 Posts 4 Posters 515 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • randombitsR
      randombits
      last edited by

      Just a quick question, I have two Raspberry pi's and wondered if it's possible to assign the same IP for each on their respective MAC's. So I can swap one to the other without have to reassign all the devices that connect to it (them). Therefore, same IP different MAC not at the same time. The idea is for testing and a cold backup if one fails - I would power it up and swap plugs.

      F 1 Reply Last reply Reply Quote 0
      • F
        FrankM @randombits
        last edited by FrankM

        @randombits

        First off, go ahead and try it!

        Though I would set the static IP for each Pi internal to them. The IP should be outside of the range of what the DHCP server hands out to devices. Say the DHCP range is 192.168.1.100 to 192.168.1.200 the IP of the Pi's should be below 192.168.1.100 or above 192.168.1.200

        And as long as only one of the Pi's is connected, your idea should work.

        This is part of the fun of doing Home Lab experiments. Learning by trying and doing.

        Take Care and Enjoy!

        randombitsR 1 Reply Last reply Reply Quote 1
        • randombitsR
          randombits @FrankM
          last edited by

          @frankm Thanks, I thought I would ask before messing things up again ! That's what I have now static IP's for everything but if a PI goes down I can swap over to another with minimal fuss. Most of the IOT things that connect need an IP rather than a hostname - I've tried.

          V johnpozJ 2 Replies Last reply Reply Quote 0
          • V
            viragomann @randombits
            last edited by

            @randombits
            With static IPs that's not a problem.

            The IP-MAC assignments are stored in the ARP table of each device in an L2 network. If a MAC was gone, when a device wants to connect to it, it sends a new ARP request for the IP and gets the new MAC and updates its ARP table.

            1 Reply Last reply Reply Quote 1
            • johnpozJ
              johnpoz LAYER 8 Global Moderator @randombits
              last edited by

              @randombits The only issue you might have is cached arp - but depending on the device arp cache normally isn't very long.

              So say my pc was talking to this IP, and it knows the mac is aa:bb:cc:00:00:01

              Now you change that out for other one and its mac is say aa:bb:cc:00:00:02, until my pc cache expires you would have problems talking to that IP.. When its cache expires it would re arp for that IP and get the new mac of the replacement device.

              Its highly unlikely you would run into this because arp caches are normally very low, but depending on the os or settings it could be longer. Pfsense on freebsd I believe defaults to a 20 min cache for example. Windows should be under 1 minute. Iot devices I would think should be be low - but if you when you swap in the other device if you have problems - reboot the client device trying to talk to it - this would force a loss of any arp cache.

              An intelligent man is sometimes forced to be drunk to spend time with his fools
              If you get confused: Listen to the Music Play
              Please don't Chat/PM me for help, unless mod related
              SG-4860 24.11 | Lab VMs 2.7.2, 24.11

              randombitsR 1 Reply Last reply Reply Quote 1
              • randombitsR
                randombits @johnpoz
                last edited by

                @johnpoz That's a good point I didn't think about ARP renewals

                johnpozJ 1 Reply Last reply Reply Quote 0
                • johnpozJ
                  johnpoz LAYER 8 Global Moderator @randombits
                  last edited by johnpoz

                  @randombits I have not looked into what Pis do - and would guess depends on what OS your actually running on them. But its possible it could/should also send out a gratuitous arp.

                  This is basically the device just telling the network on its own, hey if your looking for IP address x.x.x.x - that is me, here is my mac.

                  This should update any cache..

                  But sure arp cache should be something you should be aware of when you swap in the other device, that if you have any issues talking to it - make sure to check the cache on the device trying to talk to it, that its cache is not pointing the first devices mac.

                  An intelligent man is sometimes forced to be drunk to spend time with his fools
                  If you get confused: Listen to the Music Play
                  Please don't Chat/PM me for help, unless mod related
                  SG-4860 24.11 | Lab VMs 2.7.2, 24.11

                  1 Reply Last reply Reply Quote 1
                  • First post
                    Last post
                  Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.