Skip to content
Home » Linux » How to Resolve RTNETLINK answers: Invalid argument Error adding default gateway

How to Resolve RTNETLINK answers: Invalid argument Error adding default gateway

RTNETLINK answers: Invalid argument

When I restarted the newly configured network interface, it returned error rtnetlink answers: invalid argument like the following: [root@test ~]# service network restart
...
RTNETLINK answers: Invalid argument
Error adding default gateway ...

Please check the gateway that you just set.[root@test ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth2
...
GATEWAY=192.168.25.1

If you were sure about IP address of the gateway was set correctly such as it's .1 suffixed but not .0, then you should set the default route to no to avoid this error. DEFROUTE=no

Now you can restart your network again. No more rtnetlink answers: invalid argument.

Leave a Reply

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