[CentOS] Help with routing question.

James B. Byrne byrnejb at harte-lyne.ca
Thu Feb 19 15:19:42 UTC 2015


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

However, when I restart the network service I see this:

service network restart
Shutting down interface eth0:                              [  OK  ]
Shutting down loopback interface:                          [  OK  ]
Bringing up loopback interface:                            [  OK  ]
Bringing up interface eth0:  Determining if ip address 216.185.71.9 is
already in use for device eth0...
Determining if ip address 216.185.71.Y is already in use for device
eth0...
Determining if ip address 192.168.6.9 is already in use for device
eth0...
RTNETLINK answers: Invalid argument
                                                           [  OK  ]

If I comment out all the directives in route-eth0:192 then the Invalid
argument error disappears so it is definitely the contents of the new
file that is triggering the error.  But I cannot see any obvious error
and the syntax seems rather limited to hide any.  Switching to the ip
route syntax gives the same error:

192.168.6.9/24 via 192.168.6.1 dev eth0

The ifcfg-eth0:192 file now contains:

BOOTPROTO="static"
DEVICE="eth0:192"
IPADDR="192.168.6.9"
NETMASK="255.255.255.0"
# Also see route-eth0:192
NM_CONTROLLED="no"
ONPARENT="yes"
TYPE="Ethernet"

Can anyone see what it is that I have done that is incorrect?

-- 
***          E-Mail is NOT a SECURE channel          ***
James B. Byrne                mailto:ByrneJB at Harte-Lyne.ca
Harte & Lyne Limited          http://www.harte-lyne.ca
9 Brockley Drive              vox: +1 905 561 1241
Hamilton, Ontario             fax: +1 905 561 0757
Canada  L8E 3C3




More information about the CentOS mailing list