Multiple interfaces to one IP address?

9,249

You can't assign multiple interfaces to one IP address (that's not how ARP works). You can use multiple interfaces in a bridge and then assign an IP address to the bridge*. Note that this will give you one virtual interface, and all network devices will be on the same subnet (although they are already on the same subnet, DHCP requests aren't relayed from eth0 to wlan0) so you will either get DHCP from the Netgear or from your dnsmasq server depending on which packet gets there first.

*Bridge eth0 and wlan0 and then assign 192.168.0.2 to br0.

You can try configuring the interface metrics so that wlan0 is preferred over eth0, but this will result in any traffic being sent from your computer to go to the Netgear.

To be honest, you should look at different subnets.

Share:
9,249

Related videos on Youtube

Delan Azabani
Author by

Delan Azabani

I’m a computer programmer based in Perth, Australia. My passions include all kinds of systems programming from Rust to x86 assembly and beyond, internationalisation and Unicode, digital preservation and archaeology, typography, cryptography, and above all, teaching. I’m also a trans woman (she/her pronouns)!

Updated on September 17, 2022

Comments

  • Delan Azabani
    Delan Azabani over 1 year

    At present, I have:

    • a Netgear router with DHCP off at 192.168.0.1
    • my computer
      • eth0 at 192.168.0.2
      • wlan0 at 192.168.0.2

    The wlan0 interface always connects to the router, while the eth0 interface connects to other computers with crossover and acts as a dnsmasq DHCP server for network boot and installation.

    If I use the Gnome NetworkManager to enable both connections, that is, with wlan0 connected to the router/internet and eth0 to another computer, both as 192.168.0.2, I cannot access the internet while eth0 is connected.

    Why is this? How can I configure my computer to follow wlan0 for Internet usage, but use eth0 for itself (the latter is working but blocking wlan0).

  • wnrph
    wnrph over 12 years
    ARP has no problems with multiple IP addresses for the same device. In fact I use multiple IP addresses every day (try it using # ip a a). It's more likely the problems arise from improper routing configuration.
  • ta.speot.is
    ta.speot.is over 12 years
    @artistoex Great that your network's working for you! Don't know how that helps us. This is about two devices with the same address, not one device with two addresses.