# [SOLVED] no default gateway on startup

## mateuszz

Hello

Recently my network seemed to stop working. After reboot - i can ping my switch/router but no external IP (f.e. 208.67.222.222). BUT everytime $route add default gateway 192.168.1.1  brings my network to live. Temporary I added it to /etc/conf.d/local.start, but It's a workaround.

My current /etc/conf.d/net is:

```
config_eth0=( "192.168.1.2 netmask 255.255.255.0" )

routes_eth0=( "default via 192.168.1.1" )

```

In fact, problem started with file's previous version - I thought I have some typo I'm missing, but I can see nothing. 

What's going on?Last edited by mateuszz on Mon Nov 02, 2009 4:47 pm; edited 1 time in total

----------

## glamoroushacker

Can you please post your emerge --info? Do you have a /etc/conf.d/network file?

----------

## mateuszz

emerge --info

```
Portage 2.2_rc48 (default/linux/x86/10.0/desktop, gcc-4.3.4, glibc-2.10.1-r0, 2.6.31-gentoo-r3-k7 i686)

=================================================================

System uname: Linux-2.6.31-gentoo-r3-k7-i686-AMD_Athlon-tm-_XP_2200+-with-gentoo-2.0.1

Timestamp of tree: Sun, 01 Nov 2009 19:20:01 +0000

ccache version 2.4 [enabled]

app-shells/bash:     4.0_p35

dev-java/java-config: 2.1.9-r1

dev-lang/python:     2.6.4, 3.1.1-r1

dev-util/ccache:     2.4-r8

dev-util/cmake:      2.6.4-r3

sys-apps/baselayout: 2.0.1

sys-apps/openrc:     0.5.2-r1

sys-apps/sandbox:    2.2

sys-devel/autoconf:  2.13, 2.63-r1

sys-devel/automake:  1.8.5-r3, 1.9.6-r2, 1.10.2, 1.11

sys-devel/binutils:  2.20

sys-devel/gcc-config: 1.4.1

sys-devel/libtool:   2.2.6a

virtual/os-headers:  2.6.30-r1

ACCEPT_KEYWORDS="x86 ~x86"

CBUILD="i686-pc-linux-gnu"

CFLAGS="-O2 -march=athlon-xp -pipe -mtune=i686"

CHOST="i686-pc-linux-gnu"

CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config"

CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c /etc/udev/rules.d"

CXXFLAGS="-O2 -march=athlon-xp -pipe -mtune=i686"

DISTDIR="/usr/portage/distfiles"

FEATURES="assume-digests ccache distlocks fixpackages news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch"

GENTOO_MIRRORS="http://src.gentoo.pl/ ftp://ftp.gentoo.mesh-solutions.com/gentoo/ http://gentoo.prz.rzeszow.pl  http://gentoo.mirror.pw.edu.pl"

LANG="pl_PL.UTF-8"

LC_ALL="pl_PL.UTF-8"

LDFLAGS="-Wl,-O1"

LINGUAS="pl en"

MAKEOPTS="-j2 -s"

PKGDIR="/usr/portage/packages"

PORTAGE_CONFIGROOT="/"

PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"

PORTAGE_TMPDIR="/var/tmp"

PORTDIR="/usr/portage"

PORTDIR_OVERLAY="/usr/portage/local/layman/kadu-stable"

SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"

USE="# 3dnow 3dnowext 7zip X a52 aac acl acpi akonadi alsa amarok bash-completion berkdb bluetooth branding bzip2 cairo cddb cdr cli consolekit cracklib crypt cups dbus doc dri dts dvd dvdr eds emboss encode evo exif ext4 fam ffmpeg firefox flac fortran gdbm gif gpm gstreamer hal iconv imagemagick ipv6 java jpeg kde ldap libnotify mad mikmod mmx mmxext modules mp3 mp4 mpeg mplayer mudflap musicbrainz ncurses nls nptl nptlonly ntfs ogg opengl openmp pam pcre pdf perl png ppds pppd python qt3support qt4 quicktime readline reflection reiserfs samba sdl semantic-desktop session slang spell spl sse ssl startup-notification svg sysfs tcpd theora thunar tiff truetype unicode usb v4l vorbis webkit win32codecs x264 x86 xcomposite xine xinerama xml xorg xulrunner xv xvid xvmc zlib" ALSA_CARDS="intel8x0" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES=" evdev " KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="pl en" USERLAND="GNU" VIDEO_CARDS="nvidia" 

Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
```

/etc/conf.d/network is present, but it's all commented out

----------

## Veldrin

IIRC with openrc-0.5 the entire network config has been move to /etc/conf.d/network.

So you have to move your config from net to network in /etc/conf.d

(There was another issue with the new init-scripts, but they were masked.disabled for the time being)

----------

## mateuszz

 *Veldrin wrote:*   

> IIRC with openrc-0.5 the entire network config has been move to /etc/conf.d/network.
> 
> So you have to move your config from net to network in /etc/conf.d

 

Thanks a lot Veldrin!

That particular elog msg must have skipped my attention (there was a lot of them after last update). 

For anyone with the same problem:

1) edit /etc/conf.d/network to your liking

2) move aside /etc/conf.d/net

3) rc-update del net.eth0; rm /etc/init.d/net.eth0

4) rc-update add network default

[UPDATE 2009-12-24]

Ok, if You got to this post because You have the VERY same problem with the very next openrc update (openrc-0.6):

After emerge -u I etc-update wants to clear your /etc/conf.d/network. So I cancelled overriding the file. Turns out I had to change defaultgateway line from defaultroute="gw 192.168.1.1" to defaultroute="192.168.1.1" (missing gw).

----------

