OpenVZ Forum


Home » General » Support » Add route when venet0 comes up
Add route when venet0 comes up [message #35981] Sat, 09 May 2009 12:21 Go to next message
schogge is currently offline  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 #36074 is a reply to message #35981] Tue, 19 May 2009 12:56 Go to previous messageGo to next message
schogge is currently offline  schogge
Messages: 19
Registered: July 2007
Junior Member
It seems like the script /etc/vz/dists/scripts/redhat-add_ip.sh has something to with adding routes for venet0. Unfortunately I don't understand this script completely so I can't modify it to do what i want.

Does anybody has any hint?

schogge

[Updated on: Wed, 20 May 2009 11:32]

Report message to a moderator

Re: Add route when venet0 comes up [message #36080 is a reply to message #36074] Wed, 20 May 2009 11:37 Go to previous message
schogge is currently offline  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

Previous Topic: SIOCGMIIPHY on vr1 failed: Operation not supported
Next Topic: *SOLVED* Shutdown Driving me nuts
Goto Forum:
  


Current Time: Sat Sep 28 03:19:19 GMT 2024

Total time taken to generate the page: 0.04187 seconds