# [SOLVED] No defaultroute on boot for static IP + baselayout2

## ese002

I justed updated, along with the rest of the teaming masses, to baselayout2.  I use static IP.  Upon boot, the interface is configured with the correct IP but I have no default route and no dns_server.  If I /etc/init.d/net.eth0 restart, everything is fine.  Also, if I use dhcp it works fine, but I have good reason to want static assignment.

/etc/config.net is as follows:

# This blank configuration will automatically use DHCP for any net.*

# scripts in /etc/init.d.  To create a more complete configuration,

# please review /etc/conf.d/net.example and save your configuration

# in /etc/conf.d/net (this file :]!).

config_eth0=( "192.168.2.4 netmask 255.255.255.0" )

dns_servers=( "192.168.2.1" )

#config_eth0=( "dhcp" )

routes_eth0=( "default gw 192.168.2.1" )Last edited by ese002 on Fri May 20, 2011 4:41 am; edited 1 time in total

----------

## Veldrin

try routes_eth0=( "default via 192.168.2.1" ) ...

maybe you need iproute2 for this to work.

V.

----------

## chiefbag

You should remove the brackets from the config file for a start.

Please refer to the Baselayout and OpenRC Migration Guide

http://www.gentoo.org/doc/en/openrc-migration.xml

----------

## ese002

Removing the brackets changed nothing.  It appears that that part of the migration guide is erroneous or at least out of date.  I am now running the exact same /etc/conf.d/net from baselayout1.  It works fine.  The trick is that somewhere in the migration I added /etc/init.d/net.eth0 to the boot runlevel.  The first pass worked fine.  I could see that in the logs.  IP assigned, default route assigned.  But for some reason, when net.eth0 ran again in "default", it removed the default route and the dns assignment.

Once I removed net.eth0 from "boot", it was fine.  I can boot and my static assignment comes up just it is supposed to.

----------

