[CentOS] adding static route via network setup fails

Tue Apr 28 18:48:43 UTC 2009
Kai Schaetzl <maillists at conactive.com>

I want to add the following route command
route add -net 192.168.2.0/27 gw 192.168.2.3

via the normal network setup.
The result should be the following routing table (the first line):
192.168.2.0/27 via 192.168.2.3 dev xenbr1  scope link
192.168.2.0/27 dev eth2  proto kernel  scope link  src 192.168.2.4
192.168.2.0/27 dev xenbr1  proto kernel  scope link  src 192.168.2.3
192.168.1.0/24 dev xenbr0  proto kernel  scope link  src 192.168.1.24
default via 192.168.1.1 dev xenbr0

I found:
http://www.cyberciti.biz/faq/redhat-centos-fedora-linux-static-routing/
http://www.centos.org/docs/5/html/5.2/Deployment_Guide/s1-networkscripts-
static-routes.html

tells me to use sysconfig/route-xenbr1

But whatever syntax I try I get a variety of errors:

Bringing up interface xenbr1:  Error: an inet address is expected rather 
than "1"..168.2.3
Bringing up interface xenbr1:  Error: an inet prefix is expected rather 
than "19/27"..2.0
Bringing up interface xenbr1:  Error: either "to" is duplicate, or 
"192.168.2.3" is a garbage.
"ringing up interface xenbr1:  Cannot find device "xenbr1

route-xenbr1:
#192.168.2.0/27 via 192.168.2.3

#GATEWAY0=192.168.2.3
#NETMASK0=255.255.255.224
#ADDRESS0=192.168.2.10

#default 192.168.2.3 dev xenbr1

192.168.2.0/27 via 192.168.2.3 dev xenbr1

(the commented out are from various tries, corresponding to the errors 
above)

This is on a xen kernel. 2.6.18-128.1.6.el5xen

Kai

-- 
Kai Schätzl, Berlin, Germany
Get your web at Conactive Internet Services: http://www.conactive.com