“RTNETLINK answers: File exists” after upgrading to Debian 7

debian-wheezynetworking

I upgraded my system from Debian 6 to Debian 7.3 yesterday.

After rebooting, I chose the new kernel linux-image-3.2.0-4-amd64 and the network became unavailable.

I tried sudo service networking restart and got the following errors:

RTNETLINK answers: File exists
Failed to bring up eth0.

I only setup for eth0. Here's my /etc/network/interfaces.:

auto lo eth0
iface lo inet loopback

iface eth0 inet static
    address x.x.x.x
    netmask 255.255.255.0
    gateway x.x.x.x

and the routing table is empty sudo route -n:

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface

However, the old kernel 2.6.32-5-amd64 x86_64 still works.

Any help would be greatly appreciated.

Best Answer

Check if the new kernal can see the interface with :

ifconfig -a

if the interface is listed, check it's name,

then assign an ip manually, assuming the name is eth0

ifconfig eth0 IP_ADDRESS netmask NET_MASK

example: ifconfig eth0 192.168.1.1 netmask 255.255.255.0

add default gw, assuming the gateway is 192.168.1.254

route add default gw 192.168.1.254

This is just a temp solution.