1

I'm having a problem similar to this one Solving “RTNETLINK answers: File exists” when running ifup

My setup is basically 2 separate networks one via Ethernet and one WiFi. I want to have a simpless plug-and-play connection, if Ethernet is connected use it, if not, fall back to WiFi. It worked nicely with DHCP setup on both networks, but now I'm forced to use static IP with Ethernet and DHCP with WiFi, and now have to reboot every time I plug Ethernet back into RPI...

Here's my network config: auto lo iface lo inet loopback

    iface eth0 inet static
    address x.x.x.x
    netmask 255.255.252.0
    broadcast x.x.x.x
    gateway x.x.x.x
    dns-nameservers x.x.x.x
    dns-search cool_stuff.com

    auto wlan0
    allow-hotplug wlan0
    iface wlan0 inet manual
    wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf

    iface default inet dhcp

Now what happens, at boot everything works in any configuration of Eth0/wlan0 availability. But if I unplug Ethernet cable, WiFi successfully kicks in, but when I plug Ethernet back I'm stuck with no connection, ifconfig reports eth0 as Up and running with static IP address, but it is not actually connecting to internet. If I forcefully do ifdown, it fails saying eth0 is not configured (which is weird as ifconfig reports it in "Up" state with assigned IP address) and ifup eth0 fails with the same “RTNETLINK answers: File exists” error...

Anyone has any ideas how to fix that for the case when one network is static and one DHCP?

Removing gateway entry does not work, as in such case static IP won't work... and I don't really have gateway entry for wlan as it uses dhcp...

Your Answer

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

Browse other questions tagged or ask your own question.