I was getting this error on a MFEL, but it is applicable to any Linux server with multiple NICs.
I‘m typing the following command under Ubuntu Linux:
route add default gw 192.168.3.2 eth0
But it is giving me out the following error:
SIOCADDRT: File exists
How do I fix this problem?
This error normally displayed when you try to modify or or add a new routing IP address. For example, when you set the same route multiple times you will get this error.
Understanding SIOCADDRT: File exists Message
Open a command-line terminal (select Applications > Accessories > Terminal), and then type the following command to see your current routing table:
netstat -r or ip route list
Use the following syntax:
sudo ip route delete {IP/SUBNET} dev {INTERFACE}
To delete default route 192.168.1.0/24 via eth0, enter:
sudo ip route delete 192.168.1.0/24 dev eth0
Type the following command:
sudo ip route add default via 192.168.3.2 OR sudo route add default gw 192.168.3.2 eth0
Edit, /etc/network/interfaces file and setup the correct routing address:
auto eth0 iface eth0 inet static address 192.168.3.10 network 192.168.3.0 netmask 255.255.255.0 broadcast 192.168.3.255 ### set router default ip here ### gateway 192.168.3.2
Originally from http://www.cyberciti.biz/faq/siocaddrt-file-exists-ubuntu-linux-error-solution/