Add route when venet0 comes up [message #35981] |
Sat, 09 May 2009 12:21 |
schogge
Messages: 19 Registered: July 2007
|
Junior Member |
|
|
Hi everybody,
OS: CentOS 5
I would like to add a route to a table automatically when venet0 comes up (on system start for example).
To add the route manually this works:
ip route add 10.3.0.0/24 dev venet0 table mytable
But after a system restart this is gone of course.
I tried to create the file /etc/sysconfig/network-scripts/route-venet0 with this content:
10.3.0.0/24 dev venet0 table mytable
It works this way with normal eth interfaces but not with venet0.
Any idea?
Thanks
schogge
|
|
|
|
Re: Add route when venet0 comes up [message #36080 is a reply to message #36074] |
Wed, 20 May 2009 11:37 |
schogge
Messages: 19 Registered: July 2007
|
Junior Member |
|
|
The script redhat-add_ip.sh seems to be not helpful in this case.
But I think I have another solution:
The OpenVZ start script /etc/init.d/vz has a function called start_net(). At the end of this function I added the following line:
ip route add 10.3.0.0/24 dev venet0 table mytable
This is working at the moment.
Does anybody has any thoughts that I'm breaking something by doing this?
schogge
[Updated on: Wed, 20 May 2009 11:38] Report message to a moderator
|
|
|