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

    2 MACs map to one IP addr. Wired, then Wifi OK, reverse not?

    Scheduled Pinned Locked Moved DHCP and DNS
    5 Posts 4 Posters 334 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.
    • T
      tzalmaves
      last edited by

      Hello all,

      I have a computer that I would like to always be at the same IP address. I've created 2 static mappings for it, one for its wired interface and one for its wireless interface. I've noticed that if this computer is connected via Ethernet, and I unplug the Ethernet cable and then connect via Wi-Fi, then DHCP gives the Wi-Fi interface the IP address that is supposed to receive. On the other hand, if I'm connected by Wi-Fi, and I then disconnect Wi-Fi and connect the Ethernet cable, the DHCP server does not issue an IP address. I then have to make the now-offline Wi-Fi lease go away, and then the DHCP server will issue the IP address to the wired interface.

      Is there a way to fix this problem?

      Also, how does PFSense know to remove the wired lease when I disconnect the ethernet cable?

      GPz1100G 1 Reply Last reply Reply Quote 0
      • U
        Uglybrian
        last edited by

        My experience has been you always need to turn off the Wi-Fi rather than disconnect. Computer With Wi-Fi and ethernet will have a preferred connection. It won’t look to the second connection until the preferred is switched off. I believe if you just disconnect the Wi-Fi, it’ll just standby with that connection waiting for you to reconnect. That’s why you need to switch it off.

        T 1 Reply Last reply Reply Quote 0
        • T
          tzalmaves @Uglybrian
          last edited by

          @Uglybrian Yes, when I say disconnect Wifi, I mean turning off Wifi.

          patient0P 1 Reply Last reply Reply Quote 0
          • patient0P
            patient0 @tzalmaves
            last edited by

            @tzalmaves what OS do you use? I run Linux Mint and often have to manually restart the NetManager daemon to get it working.

            1 Reply Last reply Reply Quote 0
            • GPz1100G
              GPz1100 @tzalmaves
              last edited by GPz1100

              Perhaps the solution is to release the lease prior to disconnecting either network.

              Unplugging a network connection is different than releasing the lease then disconnecting the cable.

              If this is windows, it's possible to create a task based on a trigger. In this case I don't think it will work. The trigger would be loss of network connection, but once lost, can't issue a dhcp release.

              You could however run a script that would do the same via commandline. Just have to remember to execute it before switching wired<>wireless.

              I use something like this for my screen blanking. I have a rodent that suffers from tourette's syndrome, manifesting as random movements when the the trackball is not even touched. This results in the screen waking for no good reason.

              Using such a script it's set to disable the mouse, then induce screen sleep mode. Of course I can't wake the mouse but can with keyboard. A trigger based on wakeup runs another script that re-enables the rodent.

              This particular box has 2 ethernet nics + wifi. AP is configured for for a different vlan than the primary lan. Both wifi and wired can be on at the same time (with different IP's).

              What is your use case for keeping the same ip for both interfaces?

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