Cannot Static Routes

Home » CentOS » Cannot Static Routes
CentOS 3 Comments

Hi,

I’d want to configure persistent static routes, ie in config files, but I
can’t configure static routes, I tested:

[root@CentOS7 ~]# cat /etc/sysconfig/network-scripts/routes-enp0s3
ADDRESS0.10.10.0
NETMASK0%5.255.255.0
GATEWAY02.168.1.1

logs says nothing:

ago 27 15:38:29 CentOS7.vhgroup.corp NetworkManager[2299]:
Activation (enp0s3) Stage 5 of 5 (IPv4 Commit) complete. ago 27 15:38:29 CentOS7.vhgroup.corp NetworkManager[2299]: (enp0s3):
device state change: ip-check -> seconda…0 0]
ago 27 15:38:29 CentOS7.vhgroup.corp NetworkManager[2299]: (enp0s3):
device state change: secondaries -> acti…0 0]
ago 27 15:38:29 CentOS7.vhgroup.corp NetworkManager[2299]:
NetworkManager state is now CONNECTED_LOCAL
ago 27 15:38:29 CentOS7.vhgroup.corp NetworkManager[2299]: Policy set ‘enp0s3’ (enp0s3) as default for IPv4 r…DNS. ago 27 15:38:29 CentOS7.vhgroup.corp NetworkManager[2299]:
Activation (enp0s3) successful, device activated. ago 27 15:38:29 CentOS7.vhgroup.corp network[4172]: Activando interfaz enp0s3: Connection successfully activated (…on/5)
ago 27 15:38:29 CentOS7.vhgroup.corp network[4172]: [ OK ]
ago 27 15:38:29 CentOS7.vhgroup.corp systemd[1]: Started LSB: Bring up/down networking.
— Subject: Unit network.service has finished start-up

I’ve also tried using /etc/sysconfig/static-routes file as is in http://www.ehowstuff.com/how-to-setup-persistent-static-routes-on-linux-CentOS-6-4/

It just doesn’t work :(

How is the proper way to do it?

Thanks in advance!

3 thoughts on - Cannot Static Routes

  • 2014-08-27 15:42 GMT-03:00 Sergio Belkin :

    Shame on me, it was /etc/sysconfig/network-
    scripts/route-enp0s3 instead /etc/sysconfig/network-
    scripts/routes-enp0s3

    Sorry

  • Hi Sergio,

    The log parts you posted are related to networkManager. What happens if you explicitely say in the configuration file that the interface is not managed by NetworkMAnager?

    Regards.

  • 2014-08-28 3:02 GMT-03:00 Mihamina Rakotomandimby < mihamina.rakotomandimby@rktmb.org>:

    Hi Mihamina, it’s all about wrong filename as I earlier said, however, I’ve later disabled NetworkManager, I think that it’s not a mature software for production, but I may be wrong…