Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 205894 - net.eth0 improperly adds default gateway
Summary: net.eth0 improperly adds default gateway
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: AMD64 Linux
: High major (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
: 205932 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-01-14 21:29 UTC by Marcin Deranek
Modified: 2008-01-16 13:08 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Fix default route (ifconfig.patch,967 bytes, patch)
2008-01-15 11:47 UTC, Roy Marples
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Marcin Deranek 2008-01-14 21:29:03 UTC
After upgrading to baselayout-1.12.11 I started having network problems - while local network was reachable for anything else I was getting 'Network unreachable'.
After some investigation I found out that network startup script improperly sets default gateway:

sun ~ # netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         192.168.1.1     255.255.255.255 UGH       0 0          0 eth0
192.168.1.0     0.0.0.0         255.255.255.0   U         0 0          0 eth0
127.0.0.0       0.0.0.0         255.0.0.0       U         0 0          0 lo

As you can see default gateway has 'H' flags which means that route is for host (in opposite to network). Adding route manually:

route add default gw 192.168.1.1

solves the problem. In such case route shows up as:

0.0.0.0         192.168.1.1     0.0.0.0         UG        0 0          0 eth0

My network configuration is the following:

config_eth0=( "192.168.1.3/24" )
routes_eth0=(
        "default via 192.168.1.1"
)

which is exactly what is specified in net.example file. AFter some debugging I figured out that route command for default gateway was invoked with -host option.

Reproducible: Always

Steps to Reproduce:
1. Upgrade baselayout 1.12.11
2. Startup network
3. Try to ping something outside your LAN

Actual Results:  
Network unreachable error

Expected Results:  
ICMP reply

Portage 2.1.4 (default-linux/amd64/2007.0/desktop, gcc-4.2.2, glibc-2.7-r1, 2.6.23-gentoo-r5 x86_64)
=================================================================
System uname: 2.6.23-gentoo-r5 x86_64 AMD Athlon(tm) 64 X2 Dual Core Processor 5000+
Timestamp of tree: Mon, 14 Jan 2008 19:47:01 +0000
ccache version 2.4 [enabled]
app-shells/bash:     3.2_p33
dev-lang/python:     2.5.1-r5
dev-python/pycrypto: 2.0.1-r6
dev-util/ccache:     2.4-r7
sys-apps/baselayout: 1.12.11
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.13, 2.61-r1
sys-devel/automake:  1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.18-r1
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.24
virtual/os-headers:  2.6.23-r3
ACCEPT_KEYWORDS="amd64 ~amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=athlon64 -mtune=athlon64 -msse3 -ftracer -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/revdep-rebuild /etc/splash /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-O2 -march=athlon64 -mtune=athlon64 -msse3 -ftracer -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="ccache distlocks metadata-transfer parallel-fetch sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="ftp://ftp.snt.utwente.nl/pub/os/linux/gentoo"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-znow"
LINGUAS="en pl"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/paludis/local"
SYNC="rsync://rsync.be.gentoo.org/gentoo-portage/"
USE="3dnow 3dnowext X a52 aac aalib accessibility acpi adns alsa amd64 ao apm audiofile avahi bash-completion bcmath berkdb bidi bitmap-fonts bluetooth bzip2 cairo caps cddb cdparanoia cdr clamav cli cracklib crypt cscope ctype cups curl curlwrappers dbus dga directfb dri dts dv dvb dvd dvdr dvdread encode exif expat fbcon ffmpeg fftw firefox flac flatfile foomaticdb ftp gb gd gdbm ggi gif ginac glut gmp gnome gnutls gphoto2 gpm graphviz gstreamer gtk gtkhtml guile hal iconv idn imagemagick imlib isdnlog javascript jbig jikes jpeg jpeg2k kdehiddenvisibility lcms ldap lesstif libcaca libedit libgda libnotify libsamplerate libwww lm_sensors m17n-lib mad maildir matroska mbox mcal memlimit mhash midi mikmod mime mmap mmx mmxext mng mp3 mpeg mpi mplayer mudflap musepack ncurses nntp nocd nptl nptlonly nsplugin offensive ogg openal openexr opengl openmp osc oss pam pcntl pcre pda pdf pic plotutils png portaudio posix ppds pppd qt3support quicktime rdesktop readline recode reflection sdl session sharedmem shorten simplexml skey slang slp sndfile snmp sockets sox speex spell sse sse2 ssl svg sysvipc szip tcpd test theora threads tidy tiff truetype truetype-fonts type1-fonts unicode usb v4l vcd videos vim-syntax vorbis wifi wmf wxwindows x264 xcomposite xine xinerama xml xmlrpc xorg xosd xpm xscreensaver xsl xv xvid yaz zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter 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" CAMERAS="canon" ELIBC="glibc" INPUT_DEVICES="keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en pl" USERLAND="GNU" VIDEO_CARDS="radeon v4l"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Andreas Proteus 2008-01-15 05:56:52 UTC
Exactly the same problem here. I reverted to baselayout-1.12.10-r5 and solved the problem.

Portage 2.1.4 (!../usr/portage/profiles/default-linux/x86/2007.0, gcc-4.1.2, glibc-2.7-r1, 2.6.23-gentoo-r5-ufb-02 i686)
=================================================================
System uname: 2.6.23-gentoo-r5-ufb-02 i686 Intel(R) Core(TM)2 Duo CPU E6550 @ 2.33GHz
Timestamp of tree: Tue, 15 Jan 2008 03:46:01 +0000
distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [enabled]
ccache version 2.4 [enabled]
app-shells/bash:     3.2_p33
dev-java/java-config: 1.3.7, 2.1.2-r1
dev-lang/python:     2.5.1-r5
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     2.4-r7
sys-apps/baselayout: 1.12.10-r5
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.13, 2.61-r1
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.18-r1
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.24
virtual/os-headers:  2.6.23-r3
ACCEPT_KEYWORDS="x86 ~x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=prescott -O3 -pipe -fomit-frame-pointer"
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/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/
CXXFLAGS="-march=prescott -O3 -pipe -fomit-frame-pointer"
DISTDIR="/mnt/nfs_portage/distfiles"
FEATURES="ccache distcc distlocks metadata-transfer parallel-fetch sandbox s
GENTOO_MIRRORS="ftp://ftp.ntua.gr/pub/linux/gentoo/ ftp://gentoo.arcticnetwo
LANG="el_GR.ISO-8859-7"
LINGUAS="en el"
MAKEOPTS="-j7"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compr                                                                                           xclude=/local --exclude=/packages --filter=H_**/files/digest-*"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/mnt/nfs_portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="X acl alsa arts bash-completion berkdb bitmap-fonts bzip2 cli cracklib                                                                                             hal iconv isdnlog java jpeg kde mad midi mmx mono mp3 mudflap mysql ncurses                                                                                           pppd python qt3 rdesktop readline reflection samba session slang spl sse ssl                                                                                            win32codecs x86 xine xorg xpm xprint xv xvid zlib" ALSA_CARDS="hda-intel" A                                                                                           s iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route                                                                                            nux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb n
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LDFLAG

Comment 2 SpanKY gentoo-dev 2008-01-15 10:04:56 UTC
*** Bug 205932 has been marked as a duplicate of this bug. ***
Comment 3 Roy Marples 2008-01-15 11:47:16 UTC
Created attachment 140975 [details, diff]
Fix default route

This patch is for /lib/rcscripts/net/ifconfig.sh
To apply do this
cd /lib/rcscripts/net
patch </path/to/patch
Comment 4 Martin Kramer 2008-01-15 15:44:27 UTC
I can confirm that baselayout-1.12.11 works with the patch.
Thanks!
Comment 5 Saul Peebsen 2008-01-15 17:37:23 UTC
(In reply to comment #3)
> Created an attachment (id=140975) [edit]
> Fix default route
> 
> This patch is for /lib/rcscripts/net/ifconfig.sh
> To apply do this
> cd /lib/rcscripts/net
> patch </path/to/patch
> 

Thanks for the patch, my routing table after boot looks sane again. :)
Comment 6 Marcin Deranek 2008-01-15 17:52:26 UTC
Works here as well..

When can we expect this patch to appear in portage ?
Comment 7 SpanKY gentoo-dev 2008-01-16 02:14:22 UTC
please be patient and do not ask about "when is it going to be in portage".  this really only serves to annoy people.  it'll get added whenever someone gets around to doing so, and asking does not make any difference.

baselayout-1.12.11.1 should work fine
Comment 8 Silvence 2008-01-16 13:02:24 UTC
> baselayout-1.12.11.1 should work fine

WFM

Thank you