Page 1 of 1

[SOLVED] Adding Static Route on CentOS 6.5 Minimal

Posted: 2014/02/08 20:13:53
by Sakretsos
hello there , as the title says. i need some help to add a static route on centos 6.5 Minimal.. !
so, i add this commands on Centos 6.5 Minimal but when i restart centos the network not works again .. so can someone tell me how to add this routes to static routes !

Routes

Image

how i can add this as static ? thnx in advance !.

Re: Adding Static Route on CentOS 6.5 Minimal

Posted: 2014/02/08 20:41:45
by TrevorH
Create a file /etc/sysconfig/network-scripts/route-eth0 and add your `ip route add` command to it but without the "ip route add" on the front. You'll need to work out the syntax for your `route add` command to use `ip route add`...

Re: Adding Static Route on CentOS 6.5 Minimal

Posted: 2014/02/08 20:45:26
by Sakretsos
TrevorH wrote:Create a file /etc/sysconfig/network-scripts/route-eth0 and add your `ip route add` command to it but without the "ip route add" on the front. You'll need to work out the syntax for your `route add` command to use `ip route add`...
when i add route-eth0 i get this route -n static

Image

default gateway is not added... ! , how i can add UG flag? .

how to permanent add " route add default gw 188.165.229.254 " ?

Re: Adding Static Route on CentOS 6.5 Minimal

Posted: 2014/02/08 22:42:58
by TrevorH
What does your route-eth0 file contain?

Re: Adding Static Route on CentOS 6.5 Minimal

Posted: 2014/02/08 23:05:49
by gerald_clark
You should really keep your problem to a single thread.

[edit/avij: good point, topics merged]
[edit2/avij: these might actually be different problems (well, different servers at least), split the topics again ..]

Re: Adding Static Route on CentOS 6.5 Minimal

Posted: 2014/02/11 21:53:33
by avij
Your route-eth0 file is incorrect. According to the link you posted earlier, the file should contain:

Code: Select all

188.165.229.254 dev eth0
default via 188.165.229.254 dev eth0
ASSUMING your IP address for this server is 188.165.229.xxx. If not, adjust accordingly.

Re: Adding Static Route on CentOS 6.5 Minimal

Posted: 2014/02/12 00:40:16
by Sakretsos
thnx you ! , you can close this thread !.