gateway throwing error

General support questions
Post Reply
Posts: 155
Joined: 2017/02/25 12:41:42

gateway throwing error

Post by knzzz » 2020/09/21 04:04:58

Hi All,

when trying to set(add) the gateway ip post installation in centos 7.6 throwing the error

RTNETLINK answers: network is unreachable

i tried by adding the gateway in below methods

----route add default gw GATEWAYIP
----- i made the entry in ip address settings

by performing the above steps i did

systemctl restart network
rebooted the system

but still not able to add the gateway address kindly assist

User avatar
Posts: 3088
Joined: 2007/12/11 08:17:33
Location: Finland

Re: gateway throwing error

Post by jlehtone » 2020/09/21 07:16:43

Code: Select all

man ip-route
has an example of syntax:

Code: Select all

ip route add default via $GATEWAYIP
The 'ip' command adds a route on the fly and the result does not persist after reboot.

The network configuration is managed with NetworkManager.service by default.
You restart network.service. Is that a conscious decision?

For network.service, you would set variable GATEWAY in file /etc/sysconfig/network

PS. 7.6? You need the network in order to update.

Post Reply

Return to “CentOS 7 - General Support”