When I want to create route when gateway is from another subnet I have to execute two commands:
route add -host 10.10.100.17 eth0
for adding gateway, and:
route add -net 10.210.0.0/16 gw 10.10.100.17
to add a route to network using previously defined gateway
The problem is when I wan to persist this route. I am trying to do it in /etc/sysconfig/network-scripts/route-eth0
Content of file:
10.210.0.0/16 via 10.10.100.17
But I end up with error: Bringing up interface eth0: RTNETLINK answers: No such process
How can I add a host gateway ?
UPDATE:
I tried also with syntax
ADDRESS0=10.210.0.0
NETMASK0=255.255.0.0
GATEWAY0=10.10.100.17
But there is still error. Problem is with 10.7.233.17 gateway. As I mentioned before after command route add -host 10.10.100.17 eth0 it works fine, but I don't know how to add host 10.10.100.17 in /etc/sysconfig/network-scripts/route-eth0
UPDATE2: Checked with
ADDRESS0=10.10.100.17
NETMASK0=255.255.255.255
GATEWAY0=<MY_IP>
ADDRESS1=10.210.0.0
NETMASK1=255.255.0.0
GATEWAY1=10.10.100.17
But still error.
route -n after network restart produce:
Destination Gateway Genmask Flags Metric Ref Use Iface
10.10.100.17 <MY_IP> 255.255.255.255 UGH 0 0 0 eth0
route -n after command route add -host 10.10.100.17 eth0 produce:
Destination Gateway Genmask Flags Metric Ref Use Iface
10.10.100.17 0.0.0.0 255.255.255.255 UH 0 0 0 eth0
So i tried with
ADDRESS0=10.10.100.17
NETMASK0=255.255.255.255
GATEWAY0=0.0.0.0
But error still exist, btw route -n after network restart produce this same output as after route add -host 10.10.100.17 eth0 command. I am totally confused...