add route

Issues related to configuring your network
Post Reply
derdertere
Posts: 13
Joined: 2019/04/11 18:35:58

add route

Post by derdertere » 2019/10/15 20:07:10

I've added a route into the and what I want to learn is why the routes are written in rc.local. which purpose or design is used for this. route s always written into rc.local.
route running when I restart server but if i run ( service network restart ) then route is not running added routes do not work then i run the systemctl start rc-local.service and route is running. this method is correct ? when the network is reset, I have to do this.
this method is correct for writing a permanent route. and what I want to learn is why the routes are written in rc.local. which purpose or design is used for this. routes always written into rc.local.

there is a structure like this on the system right now

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

Re: add route

Post by jlehtone » 2019/10/15 20:28:57

No. You are mistaken.

If you have to add static routes locally, then use NetworkManager to modify the relevant connection's configuration.

derdertere
Posts: 13
Joined: 2019/04/11 18:35:58

Re: add route

Post by derdertere » 2019/10/15 20:44:21

can you show an example about use NetworkManager . do you have any idea why it is written in rc-local
thanks

User avatar
TrevorH
Forum Moderator
Posts: 28881
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: add route

Post by TrevorH » 2019/10/15 21:09:04

And if you are not using NetworkManager then you still don't use rc.local to add routes. That's what /etc/sysconfig/network-scripts/route-$interface and /etc/sysconfig/network-scripts/rule-$interface are for.
CentOS 6 will die in November 2020 - migrate sooner rather than later!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

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

Re: add route

Post by jlehtone » 2019/10/16 06:23:55

derdertere wrote:
2019/10/15 20:44:21
do you have any idea why it is written in rc-local
Yes, somebody is either <unprintable> or <unprintable>.

Code: Select all

man nmcli
man nmcli-examples
man nm-settings
Or more verbosely: https://access.redhat.com/documentation ... uide/index

An example (where router 10.20.30.254 is link-local to connection bridce-br0):

Code: Select all

nmcli con mod bridge-br0 +ipv4.routes "192.168.0.0/24  10.20.30.254"

Post Reply

Return to “CentOS 7 - Networking Support”