R
R
rudaki29rus2018-02-08 16:53:51
linux
rudaki29rus, 2018-02-08 16:53:51

How to set up routing in centos?

To create a route, I use the command
route add -host "ip address" gw "gateway" dev eth1
when rebooting, respectively, everything flies.
you need to set it to "Forever"
Tried: nano /etc/sysconfig/network-scripts/route-eth1
ADDRESS0= "ip address"
GATEWAY0= "gateway"
NETMASK0= "mask"
Or like this, /<subnet mask> via <gateway> dev <interface>
after a reboot, you still have to re-enter the command.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
C
CityCat4, 2018-02-09
@rudaki29rus

in the route-eth0 file, you need to directly register the routing commands. For example, like this:

10.87.6.0/24 via 10.87.1.17
10.87.2.0/24 via 10.87.1.17
10.54.200.0/24 via 10.87.1.17

S
Sergey, 2018-02-08
@feanor7

https://www.centos.org/docs/5/html/5.2/Deployment_...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question