Ubuntu: How to Solve RTNETLINK answers: File exists (Two Methods)

There are two reasons for this problem

###1. When there are two gateways, there are two gateways in IP address configuration

    auto eth0
    iface eth0 inet static
    address 192.168.5.21
    netmask 255.255.2550
    gateway 192.168.5.1

    # VM traffic interface
    auto eth1
    iface eth1 inet static
    address 192.168.5.22
    netmask 255.255.255.0
    gateway 192.168.5.1

eth0 and eth1 have different IP addresses, but they have both configured gateways. At this time, after one starts, the other fails to start

RTNETLINK answers: File exists
Failed to bring up eth2.

If you still have this situation after modification, you need to refresh eth0 and eth1

    ip addr flush dev eth0
    ip addre flush dev eth1
    ifdown eth0 && ifup eth0 && ifdown eth1 && ifup eth1

###2. When the bridge or other network is deleted and the network is changed correctly, this problem still occurs # IP addr flush dev eth0 # restart the network configuration under the condition of ensuring that the network configuration is correct

IP addr flush also dumps all the deleted addresses in the format described in the previous subsection

Similar Posts: