FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Red Hat Linux

 
 
LinkBack Thread Tools
 
Old 06-07-2011, 01:31 PM
Matt Iavarone
 
Default /etc/sysconfig/network-scripts/route-ethN Question

On Tue, Jun 7, 2011 at 9:02 AM, Matty Sarro <msarro@gmail.com> wrote:
> Hey everyone,
> I am trying to find out more about setting up per-device routing using
> the /etc/sysconfig/network-scripts/route-ethN file. Basically I'm not
> about to find any real details about how the file is supposed to be
> created. Is it just a shell script with ip route commands? I have
> three network interfaces, and each needs to be connected to its own
> discrete network with its own gateway. Right now I have all of the
> rules set up in /etc/rc.local, which seems to work fine for the first
> two interfaces, but not the third.
>
> Due to the circumstances, normal static routing won't work - I need to
> use iproute2.
>
> Since the /etc/sysconfig/network-script/route-ethN file gets run when
> the interface comes up, I am assuming this may help. Any advice is
> appreciated.
>
> --
> redhat-list mailing list
> unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe
> https://www.redhat.com/mailman/listinfo/redhat-list
>

Take a look at the ifup and ifdown scripts. It will give you a good
idea how the route files work and how they are implemented and
removed.

--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list
 
Old 06-07-2011, 05:17 PM
"Richardson, Joshua A."
 
Default /etc/sysconfig/network-scripts/route-ethN Question

You can simply create the file in the /etc/sysconfig/network-scripts folder. Here's an example of one I use:

[root@AMDRFileServer1 ~]# cat /etc/sysconfig/network-scripts/route-eth0
# /etc/sysconfig/network-scripts/route-eth0
#
0.0.0.0/0 via 10.10.207.1 dev eth0 # Default gateway route
192.168.4.3 via 10.10.207.88 dev eth0 # Host route
192.168.0.0/16 dev eth0 # Subnet route


Josh Richardson
General Dynamics AIS
Office: 703-272-1761
Cell: 540-383-9093

-----Original Message-----
From: redhat-list-bounces@redhat.com [mailto:redhat-list-bounces@redhat.com] On Behalf Of Matty Sarro
Sent: Tuesday, June 07, 2011 9:02 AM
To: General Red Hat Linux discussion list
Subject: /etc/sysconfig/network-scripts/route-ethN Question

Hey everyone,
I am trying to find out more about setting up per-device routing using
the /etc/sysconfig/network-scripts/route-ethN file. Basically I'm not
about to find any real details about how the file is supposed to be
created. Is it just a shell script with ip route commands? I have
three network interfaces, and each needs to be connected to its own
discrete network with its own gateway. Right now I have all of the
rules set up in /etc/rc.local, which seems to work fine for the first
two interfaces, but not the third.

Due to the circumstances, normal static routing won't work - I need to
use iproute2.

Since the /etc/sysconfig/network-script/route-ethN file gets run when
the interface comes up, I am assuming this may help. Any advice is
appreciated.

--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list

--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list
 
Old 06-07-2011, 06:23 PM
RILINDO FOSTER
 
Default /etc/sysconfig/network-scripts/route-ethN Question

Another way is to dispense with the routing syntax and setup the variables in the file:


[root@XXX network-scripts]# cat route-eth0
ADDRESS0=192.168.16.0
ADDRESS1=192.168.17.0
ADDRESS2=192.168.18.0
NETMASK0=255.255.255.0
NETMASK1=255.255.255.0
NETMASK2=255.255.255.0
GATEWAY0=192.168.15.200
GATEWAY1=192.168.15.200
GATEWAY2=192.168.15.200

Red Hat's startup scripts will pattern match base on the variables and file name, setting the routes accordingly per adapter. In this case, the routes in question will be configured through eth0.

Here is another example:

[root@sl6 network-scripts]# cat route-virbr0
ADDRESS0=192.168.122.0
NETMASK0=255.255.255.0

This setup the routes on the virtual interface to my VMs. Since the gateway is local, there was no need to setup the gateway variable.

At any event, here is the output of my routes after bootup:

[root@sl6 ~]# netstat -rn
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
192.168.18.0 192.168.15.200 255.255.255.0 UG 0 0 0 eth0
192.168.17.0 192.168.15.200 255.255.255.0 UG 0 0 0 eth0
192.168.16.0 192.168.15.200 255.255.255.0 UG 0 0 0 eth0
192.168.15.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.168.122.0 0.0.0.0 255.255.255.0 U 0 0 0 virbr0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
0.0.0.0 192.168.15.1 0.0.0.0 UG 0 0 0 eth0

http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5/html/Deployment_Guide/s1-networkscripts-static-routes.html


On Jun 7, 2011, at 1:17 PM, Richardson, Joshua A. wrote:

> You can simply create the file in the /etc/sysconfig/network-scripts folder. Here's an example of one I use:
>
> [root@AMDRFileServer1 ~]# cat /etc/sysconfig/network-scripts/route-eth0
> # /etc/sysconfig/network-scripts/route-eth0
> #
> 0.0.0.0/0 via 10.10.207.1 dev eth0 # Default gateway route
> 192.168.4.3 via 10.10.207.88 dev eth0 # Host route
> 192.168.0.0/16 dev eth0 # Subnet route
>
>
> Josh Richardson
> General Dynamics AIS
> Office: 703-272-1761
> Cell: 540-383-9093
>
> -----Original Message-----
> From: redhat-list-bounces@redhat.com [mailto:redhat-list-bounces@redhat.com] On Behalf Of Matty Sarro
> Sent: Tuesday, June 07, 2011 9:02 AM
> To: General Red Hat Linux discussion list
> Subject: /etc/sysconfig/network-scripts/route-ethN Question
>
> Hey everyone,
> I am trying to find out more about setting up per-device routing using
> the /etc/sysconfig/network-scripts/route-ethN file. Basically I'm not
> about to find any real details about how the file is supposed to be
> created. Is it just a shell script with ip route commands? I have
> three network interfaces, and each needs to be connected to its own
> discrete network with its own gateway. Right now I have all of the
> rules set up in /etc/rc.local, which seems to work fine for the first
> two interfaces, but not the third.
>
> Due to the circumstances, normal static routing won't work - I need to
> use iproute2.
>
> Since the /etc/sysconfig/network-script/route-ethN file gets run when
> the interface comes up, I am assuming this may help. Any advice is
> appreciated.
>
> --
> redhat-list mailing list
> unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe
> https://www.redhat.com/mailman/listinfo/redhat-list
>
> --
> redhat-list mailing list
> unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe
> https://www.redhat.com/mailman/listinfo/redhat-list

--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list
 

Thread Tools




All times are GMT. The time now is 05:13 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org