Configuring Redhat 6 And Centos 6 Linux For Static Persistent Routes

The vi editor that doesn’t exist it will create it automatically so that’s what we’re going to do it’s.

Route and then a – R – whatever you want to call it and then the number of the interface that we’re routing over which is – so it’s a ETH – okay and yes.

We put our routes in we’re going to need three things first is going to be the subnet we’re gonna.

Want to route – which is our one 92168 one network the net mask and the Gateway that it’s gonna need to go across first thing we’re going to do is we’re gonna put the address network in so let’s do that and you actually have to put a number on these and our first one of course is Linux is going to start with zero because in most of the world.

And of course in computer stuff zero is the very first number and most things so this is our first route so it’s going to be zero so you’re going to put.

Address or zero equals and we’re gonna put the subnet that we want to route over and that’s the the one network 191 six eight one zero network okay the netmask then.

Again we have to put the number you know on all of them I’m just gonna put a 24-bit subnet mask there okay and then the Gateway it has to have a gateway to get out here to go to find that route over and it’s a gateway 0 and for this instance it’s one unto.

One six eight whoops dot 20.

25 for is the router that it needs to access to get across to that other VPN okay I’ve got my looks like everything’s good so I’m.

Just gonna go ahead and save this file okay and we look look back now at our C we go if we look now we do another listing we’ll see that we have that file it actually exists right here but watch this when I try to ping my still nothing’s happening well that’s because I have to restart the network services.

So it’ll reread those configuration files so we’re gonna go.

Ahead and do that the simplest way to do it in red hat or CentOS is the issue of the command service networks Network restart and you’ll see it shutting down the interfaces and bringing them back up okay everything has okay we’re good to go now let’s try to ping again ah cool it works that’s a very simple easy way to persistent static routes in your server you’ll have instances maybe you’ll have a.

VPN connection but you’ll have some servers that don’t know anything about the route to get over there but you only.

Might need maybe one of those boxes to actually communicate across the link.

Or the route so instead of changing things in the actual gateway router for those boxes you can just go into that one particular box itself especially if you don’t have access to the router if you don’t know the the command line to configure the routes on a Cisco or something this might.

Be the easiest quickest way to fix that if you just need to add a couple of routes now if you need to add other routes to this file it’s very simple to do also all.

You’d have to do is open it back up and editor and you would start with a the next sequence of numbers so the next route you would add would start with address one and then it would go address two and three and however many routes you put in each route.

Leave a Reply

Your email address will not be published. Required fields are marked *