Static route setup

Jason Kohles email at jasonkohles.com
Fri Mar 4 19:16:01 UTC 2005


On Fri, Mar 04, 2005 at 04:31:19PM +0000, Iain Conochie wrote:
> Hello,
> 
>     I am at present upgrading some IBM blades from RedHat AS2.1 to RedHat
> AS3.0. I am using basically the same ks.cfg file that was used for the 2.1
> install, and all seems to progress smoothly. However, when the server
> reboots, I am finding that the static routes I am attempting to configure
> are broken. for example
> 
This bit me too, the static route configuration changed between AS2.1 and AS3,
so you can't do them the same way...

This is how I solved the problem...

# kickstart-post-static-routes
TAG="# Static routes added by kickstart"

function static_route() {
	DEST=$1
	GW=$2
	DEV=$3

	case `rpm -qf /etc/redhat-release` in
		*3AS*)
			FILE="/etc/sysconfig/network-scripts/route-$DEV"
			ROUTE="$DEST via $GW dev $INT"
			;;
		*2.1AS*)
			FILE="/etc/sysconfig/static-routes"
			ROUTE="$DEV host $DEST gw $GW"
			;;
	esac
	grep -q $TAG $FILE || echo $TAG >> $FILE
	echo $ROUTE >> $FILE
}

static_route 10.170.127.10/32 10.170.67.121 eth1
static_route 192.168.42.1/24 10.170.67.122 eth1
# ... etc ...

> So it looks like the /etc/sysconfig/static-routes file is not in the
> format expected, as I have a bogus route for 169.254.0.0 network. Can
> anyone point out where I am going wrong in the config?
> 
AS3 doesn't even make any attempt to read /etc/sysconfig/static-routes
as far as I can tell, but so far I haven't tracked down where the
168.245.0.0 route is coming from, I have it on most of my boxes as well.

-- 
Jason Kohles                         A witty saying proves nothing.
email at jasonkohles.com                   -- Voltaire (1694 - 1778)
http://www.jasonkohles.com/




More information about the Kickstart-list mailing list