On 25/03/10 13:37, Rainer Traut wrote:
> Am 25.03.2010 11:58, schrieb Alexander Dalloz:
>>> Hi,
>>>
>>> is there a way to set routing infos for a network device -
>>> if I have changed e.g.
>>> /etc/sysconfig/network-scripts/route-eth1
>>> ?
>>
>> route-ethX must contain "ip route add" syntax instructions ...
>
> How come? Has it changed?
>
> Here is a working example:
>
> # cat /etc/sysconfig/network-scripts/route-eth1
> ADDRESS0=192.168.200.0
> NETMASK0=255.255.255.0
> GATEWAY0=192.168.100.1
> ADDRESS1=192.168.101.0
> NETMASK1=255.255.255.0
> GATEWAY1=192.168.100.1
>
>>> I know I can bring down/up eth1 with ifdown/ifup, but I'd rather do this
>>> in another way.
>>
>> ... so without bringing down&& up the device you can just do
>>
>> while read line;
>> do ip route add ${line}
>> done< /etc/sysconfig/network-scripts/route-eth1
>>
>
> Umm no, not with my working syntax.
>From TFM (/usr/share/doc/initscripts-8.45.30/sysconfig.txt):
"/etc/sysconfig/network-scripts/route-<interface-name>
Contains lines that specify additional routes that should be added
when the
associated interface is brought up.
The files are processed by the ifup-routes script and uses the
/sbin/ipcalc
utility for all network masks and numbers. Routes are specified using the
syntax:
ADDRESSn=<network>
NETMASKn=<network/prefix mask>
GATEWAYn=<next-hop router/gateway IP address>
The "n" can be any integer number, but is expected to be monotonically
increasing and counting starts from 0. For example:
ADDRESS0=192.168.2.0
NETMASK0=255.255.255.0
GATEWAY0=192.168.1.1
adds a network route to the 192.168.2.0 network via the gateway at
192.168.1.1. Since you must already have a route to the network of the
gateway, there is no need to specify a device.
Note: The ifup-routes script also supports an older syntax designed to be
used directly as an argument to "/sbin/ip route add". This syntax is
deprecated, but if no "ADDRESSn" lines are found the following will still
work:
192.168.2.0/24 dev ppp0
adds a network route to the 192.168.2.0 network through ppp0."
_______________________________________________
rhelv5-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/rhelv5-list