0

I would like to make the following route info persistent.

I know how to do it for the default, but how about this line:

10.27.74.0      *               255.255.255.0   U     0      0        0 eth0



Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.27.74.0      *               255.255.255.0   U     0      0        0 eth0
link-local      *               255.255.0.0     U     1002   0        0 eth0
default         10.27.74.253    0.0.0.0         UG    0      0        0 eth0
faker
  • 17,496
  • 2
  • 60
  • 70
yield
  • 771
  • 1
  • 9
  • 24

2 Answers2

2

You create a file /etc/sysconfig/network-scripts/route-eth0

And add the following:

10.x.x.x/y via 10.x.x.x

Where 10.x.x.x/y is the IP or subnet you want to route and 10.x.x.x is the gateway for that subnet.

You then restart your network or disable/enable eth0 and it should automatically bring up your static route.

Cha0s
  • 2,462
  • 2
  • 16
  • 26
0

The most compatible way is to create a route file under /etc/sysconfig/network-script and to specify here the desired route.

In your case, create the file /etc/sysconfig/network-script/route-eth0 and put into it the following directive: 10.27.74.0/8 via 10.27.74.253 After that, issue the command service network restart

This setup works both with and without NetworkManager. You can read more here and here.

shodanshok
  • 47,711
  • 7
  • 111
  • 180