in etc/network/interfaces:

iface eth0 inet static

allow-hotplug wlan0
auto wlan0

iface wlan0 inet static
  dns-nameservers # the router's IP
  wpa-ssid "my network name"
  wpa-psk "my password"
  • Sure, why not if you do the routing right. I'm not in a position to writeup a whole answer, but in the educational spirit of the Pi: have a look at how IP and ARP work. The OSI model will help you keep your sense of direction on your journey... The pot of gold at the end of the rainbow is a routing table in your router(s) with a higher cost on the Wifi route then on the wired one. – Chris Wesseling Mar 19 '14 at 8:00

Technically, you can. However you will have to hack the route table to make sure that every packet knows exactly where it should go to. Take this as an example (from a screwed up Ubuntu VM I used to operate, as this is a generic Linux problem):

  • eth0:, leads to machine
  • eth1:, leads to router that goes to the Internet

You need to set up the routing table so that packets to goes through eth0 and everything else go to eth1, like:

ip route add dev eth0
ip route add default via dev eth1

Also, packet routing can be even more troublesome.

  • "packet routing can be even more troublesome"? – SDsolar Apr 23 '17 at 5:02

As other folks have said, not at "the same time". However, this doesn't mean they can't be configured simultaneously. When you plug in the Ethernet cable, you'd need to unplug the Wi-Fi, and if the Wi-Fi is plugged in you'd need to unplug the Ethernet. Keep in mind that switching would probably break current connections, so don't do it in the middle of a download.


Not at the same router at the same time. External machines don't know its the same machine. Every interfacecard is a unique address and a unique machine in the eyes of others.

If you choose not to be online with both interfaces at the same time, it will work as you tried with the static addresses in /etc/network/interfaces

Or, using DHCP, you could clone the macaddress from one interface to another, that way the DHCPserver would provide the same address.

Add the output of this line to the wlan0 section in /etc/network/interfaces:
ifconfig eth0 |grep -o -E "HWaddr\ [a-f0-9:]*"|sed s/HWaddr\ /hwaddr\ ether\ /

(Should look something like this: hwaddress ether 02:01:02:03:04:08)

  • 1
    Hmmm, i think your router wil have a harder time with cloned MAC addresses than with the same ip address. IP and its routing is designed to have multiple routes to the same destination address. (It was kind of the goal of the whole exercise) But MACs MUST be unique in your network. Only clone them if you really know what you are doing. – Chris Wesseling Mar 19 '14 at 7:51
  • that's true. I'm used to dhcp but if you assign static ipaddresses yourself is more likely to be useful. But then the advice stands: Not at the same time – ExploWare Mar 19 '14 at 11:16
  • Why not? Cloning a MAC address is a bad idea, unless you have a device that doesn't have one, or you want to impersonate another device (like the router your ISP lend you, when they've locked their service to their device). MAC must be unique. IP doesn't have to.. The whole point of routing tables is that there are "more roads that lead to rome". Having the same IP for different hosts that may become a challenge. – Chris Wesseling Mar 19 '14 at 12:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.