SIOCADDRT: File exists

I’ve been getting output from cron mailed to me as:

SIOCADDRT: File exists

This warning stems from the same route being set several times. I want to make sure eth0 is set to be the default device, should it have changed for some reason.

The message breaks down to this:

SIOC = Serial Input Output Controller

ADD = action is ADD

RT = RouTe

File exists = This means that the route is already configured (file exists in /proc)

In my case the solution is to simply suppress the message by redirecting it to /dev/null:

route add default dev eth0 2>/dev/null


This entry was posted in Linux and tagged , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *