Each time you manually add a route after a reboot.

route add -net 10.0.0.0/8 gw 10.143.124.1 

I tried в /etc/sysconfig/network-scripts/route-eth1 add в /etc/sysconfig/network-scripts/route-eth1

 10.0.0.0/8 via 10.143.124.1 

But it had no effect.

  • and where does this address 10.143.124.1 come from? Please give the output of $ ip a; ip r $ ip a; ip r . - aleksandr barakin

2 answers 2

according to the documentation , additional routes can be specified in the /etc/sysconfig/network-scripts/route-интерфейс files in any of two formats:

  • in the format of ip program arguments
  • in the format переменная=значение

I tried to add in /etc/sysconfig/network-scripts/route-eth1
10.0.0.0/8 via 10.143.124.1

You obviously tried to add a route in the format of the ip program arguments (more precisely, ip with the route add parameters: ip route add ). in this case, you have an error - you still need to specify the interface so that the command in general sounds like (1):

 ip route add ip-адрес/маска via ip-шлюза dev интерфейс 

the interface, as I understand it, in your case is eth1. hence the line should be like this:

 10.0.0.0/8 via 10.143.124.1 dev eth1 

(1) By the way, using the ip program to control network parameters is preferable to the morally and “physically” outdated ifconfig , route , arp programs. I recommend to familiarize with the “saga” written by me once

    Try to register on the network interface

     up route add -net 10.0.0.0/8 gw 10.143.124.1 

    And this command will be executed when the interface is raised.

    • For the centos distribution, this is an inappropriate recommendation: it is simply “nowhere” to apply. about the route program; please read this "saga" . - aleksandr barakin