[CentOS] Help with routing question.

Thu Feb 19 15:30:16 UTC 2015
Les Mikesell <lesmikesell at gmail.com>

On Thu, Feb 19, 2015 at 9:19 AM, James B. Byrne <byrnejb at harte-lyne.ca> wrote:
>
> On Wed, February 18, 2015 13:07, Les Mikesell wrote:
>> On Wed, Feb 18, 2015 at 11:39 AM, James B. Byrne
>> <byrnejb at harte-lyne.ca> wrote:
>>> 2. How does one configure the routing table on network startup to
>>> specifically detail the route particular addresses are supposed to
>>> take?
>>>
>>
>> Not exactly sure how routing works with aliases on the same interface
>> but the first thing I would try is the same as you would use on
>> different interfaces.  That is, leave the 'GATEWAY=' on your
>> internet-facing etho, but remove the entry from the private eth0:192.
>>   Then add a route-eth0:192  file containing the network(s) and
>> gateway for the private side.   The source address it picks should be
>> the one appropriate to reach the next-hop router specified in your
>> routes.
>>
>
> I created a file called /etc/sysconfig/network-scripts/route-eth0:192
> and in accordance with the instructions obtained at:
>
> https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Deployment_Guide/sec-networkscripts-static-routes-network-netmask-directives.html
>
> I added these directives to the route-eth0:192 file:
>
> ADDRESS0=192.168.6.9
> NETMASK0=255.255.255.0
> GATEWAY0=192.168.6.1

You don't need an extra route for the range covered by your netmask.
Your own interface can reach them directly and the route is implicit.
 I was assuming you had a more complicated private side with
additional subnets behind the 192.168.6.1.   If that is not the case,
you don't need the route-* file at all or any GATEWAY mentioned for
the private range.

-- 
   Les Mikesell
      lesmikesell at gmail.com