Ubuntu: SIOCADDRT: File exists Error and Solution

The “SIOCADDRT: File exists” error message in Ubuntu (and other Linux distributions) occurs when you try to add a route to the system routing table that already exists. This error message indicates that the system is unable to add the new route because it conflicts with an existing route.

To resolve this issue, you can try the following steps:

  1. Use the “route” command to view the existing routes in the system routing table:
    route -n
  2. Identify the conflicting route and take note of the destination network and the gateway.
  3. Remove the conflicting route using the “route” command:
    route del -net <destination_network> gw <gateway>
  4. Add the desired route:
    route add -net <destination_network> gw <gateway>
  5. Verify the new route by using the “route” command again:
    route -n

If the “SIOCADDRT: File exists” error still persists, you may need to troubleshoot the issue further, such as checking the network configuration, firewall settings, and so on.

Leave a Comment