• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login
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 531 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.
  • R
    randombits
    last edited by Nov 23, 2022, 11:54 AM

    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 Nov 23, 2022, 12:07 PM Reply Quote 0
    • F
      FrankM @randombits
      last edited by FrankM Nov 23, 2022, 12:10 PM Nov 23, 2022, 12:07 PM

      @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!

      R 1 Reply Last reply Nov 23, 2022, 12:49 PM Reply Quote 1
      • R
        randombits @FrankM
        last edited by Nov 23, 2022, 12:49 PM

        @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 J 2 Replies Last reply Nov 23, 2022, 1:45 PM Reply Quote 0
        • V
          viragomann @randombits
          last edited by Nov 23, 2022, 1:45 PM

          @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
          • J
            johnpoz LAYER 8 Global Moderator @randombits
            last edited by Nov 23, 2022, 3:51 PM

            @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.8, 24.11

            R 1 Reply Last reply Nov 24, 2022, 10:49 AM Reply Quote 1
            • R
              randombits @johnpoz
              last edited by Nov 24, 2022, 10:49 AM

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

              J 1 Reply Last reply Nov 24, 2022, 10:56 AM Reply Quote 0
              • J
                johnpoz LAYER 8 Global Moderator @randombits
                last edited by johnpoz Nov 24, 2022, 10:57 AM Nov 24, 2022, 10:56 AM

                @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.8, 24.11

                1 Reply Last reply Reply Quote 1
                7 out of 7
                • First post
                  7/7
                  Last post
                Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
                  This community forum collects and processes your personal information.
                  consent.not_received