30

I'm running Linux Mint on a home server that happens to run pihole. Since it's both a dhcp and dns server for my network, it has a static ip address. It has an ethernet connection as well as wifi and it's always been my understanding that you can't have two network interfaces sharing the same IP address, so I've been looking into ways to have one network adapter enabled and the other disabled and then if the network connection of the active device is lost, the other re-enables with the same IP address and disables the other device. This mostly work.

However while debugging one bit of software that seems to have a problem with me disabling my wifi adapter, I inadvertently enabled both the eth and wifi connections while each have the same, manually assigned ip address and everything so far just seems to work. I didn't think this was possible and I'm wondering, should I expect problems? I can connect to the machine remotely fine, pihole and dvr services installed on the box work. Is there any reason to believe this won't work?

you are viewing a single comment's thread
view the rest of the comments
[-] pelya@lemmy.world 6 points 1 day ago* (last edited 1 day ago)

It's perfectly possible on Linux to have several network adapters with the same IP address, or several default routes.

Most server applications will listen to 0.0.0.0 address, which means all network interfaces. Any incoming TCP connection will remember it's network interface, and the server will send responses to the same interface.

This will not work for UDP connections, and for outgoing TCP connections - they will always choose the network interface with the lowest metric, which you can print with ip r command.

This does not include advanced techniques like bridge or bonding or iptables routing - you need to run special commands in the terminal, which you cannot do just by clicking your mouse in system settings app.

[-] non_burglar@lemmy.world 1 points 1 day ago

Is it possible to configure interfaces this way? Yes.

Will it work? No, not without bonding, and not with WiFi as one of the interfaces.

[-] ReluctantMuskrat@lemmy.world 2 points 1 day ago

What won't work, because at the moment everything seems to be working fine and I'm pleasantly surprised.

[-] non_burglar@lemmy.world 1 points 1 day ago

Oh, you are failing one over if the other fails? That's not the same thing as configuring two interfaces with the same IP, gateway, at the same time, which is what I thought you were trying to do.

[-] atzanteol@sh.itjust.works 2 points 1 day ago

I've done this for years with no failover. Linux doesn't care, zero issues.

[-] non_burglar@lemmy.world 1 points 1 day ago

That's because only one interface is really being used. A TCP session will reset if the hop count or metric changes all the time, the SYN/ACK wouldn't work.

[-] ReluctantMuskrat@lemmy.world 1 points 1 day ago

Thanks for sharing your experience... so it really does work! I mean it certainly seems to be working fine and I keep thinking I'm overlooking something. I feel like I'm in a love triangle with 2 girls fully aware of the other and they're fine with it... this feels like a disaster but everyone seems to be happy!

[-] atzanteol@sh.itjust.works 2 points 1 day ago

Yeah - I mean it's technically "not ideal" but I simply don't have any issues. I did have a windows computer that once complained about there being two devices on the network with the same IP but it didn't stop it from working with it. I think that was some security software installed on that system though. This is the "less than ideal" part - it will look a bit suspicious if you have any security software that scans network traffic because "arp poisoning" is a common attack (basically stealing an IP address).

[-] ReluctantMuskrat@lemmy.world 1 points 1 day ago

I simply wanted a fail-over but in the process got 2 interfaces with the same IP and I can't find a problem with it 😄

[-] ReluctantMuskrat@lemmy.world 1 points 1 day ago

Will UDP packets produce an error when sent or will they simply be received twice, potentially causing errors/issues?

[-] pelya@lemmy.world 2 points 1 day ago

Nope. The server receives UDP packet from WiFi and sends reply over Ethernet, which simply gets lost in your router. From the Linux side there's no error, it sent the packet somewhere, and what happens next is your router's problem.

[-] ReluctantMuskrat@lemmy.world 1 points 1 day ago* (last edited 1 day ago)

That's the thing about UDP packets... receipt isn't acknowledged as part of the protocol. It's send and forget. I'm not sure a UDP packet sent to my server would get lost but I'm not 100% certain there couldn't be situations where the packet is received by the server on both interfaces, essentially duplicated. It's been almost 30 years since I wrote programs that utilized UDP for communicating. I'm definitely a little rusty. 😄

[-] curbstickle@anarchist.nexus 1 points 1 day ago

Unless its rudp.

this post was submitted on 04 Jun 2026
30 points (100.0% liked)

Linux

65497 readers
410 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 7 years ago
MODERATORS