"fallback_route_eth0" (which is configured in /etc/conf.d/net) does not work. I expect it to set the default gateway in case the DHCP server is not available for whatever reason. * Bringing down interface eth0 * Removing addresses * 10.20.7.56/21 * Bringing up interface eth0 * dhcp ... * Running dhcpcd ...dhcpcd: version 4.99.6 starting dhcpcd: eth0: rebinding lease of 10.20.7.56 dhcpcd: eth0: checking 10.20.7.56 is available on attached networks dhcpcd: timed out [ !! ] * Trying fallback configuration 10.20.7.56/21 * 10.20.7.56/21 [ ok ] This is my config file: modules=("dhcpcd" "ifconfig") # "iproute2" dhcpcd="-t 6" # -I '' (bug #188284), -L config_eth0="dhcp" fallback_eth0="10.20.7.56/21" fallback_route_eth0="default via 10.20.0.1" config_eth1="null" "route" showed me that no default gateway was set - so fallback_eth0 works while "fallback_route_eth0" didn't. Reproducible: Always Steps to Reproduce: 1. configure fallback_route_eth0 2. make the DHCP server unavailable (maybe by setting dhcpcd="-t 6" 3. start or restart eth0 Actual Results: Interface was up with the desired IP address (good!) but no gateway assigned Expected Results: Default Gateway assigned Portage 2.2_rc17 (default/linux/x86/2008.0/desktop, gcc-4.1.2, glibc-2.6.1-r0, 2.6.27-gentoo-r1 i686) ================================================================= System uname: Linux-2.6.27-gentoo-r1-i686-Intel-R-_Xeon-R-_CPU_E5430_@_2.66GHz-with-glibc2.0 Timestamp of tree: Sun, 14 Dec 2008 02:15:02 +0000 ccache version 2.4 [enabled] app-shells/bash: 3.2_p48 dev-java/java-config: 1.3.7, 2.1.6 dev-lang/python: 2.5.2-r8 dev-python/pycrypto: 2.0.1-r6 dev-util/ccache: 2.4-r8 sys-apps/baselayout: 2.0.0 sys-apps/openrc: 0.3.0-r1 sys-apps/sandbox: 1.2.18.1-r2 sys-devel/autoconf: 2.13, 2.61-r2 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.1-r1 sys-devel/binutils: 2.18-r3 sys-devel/gcc-config: 1.4.0-r4 sys-devel/libtool: 1.5.26 virtual/os-headers: 2.6.27-r2 ACCEPT_KEYWORDS="x86" CBUILD="i686-pc-linux-gnu" CFLAGS="-O3 -march=pentium4 -pipe" 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/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/revdep-rebuild /etc/terminfo /etc/udev/rules.d" CXXFLAGS="-O3 -march=pentium4 -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="ccache distlocks fixpackages parallel-fetch preserve-libs protect-owned sandbox sfperms strict unmerge-orphans userfetch" GENTOO_MIRRORS="http://gentoo.osuosl.org/" LDFLAGS="-Wl,-O1" LINGUAS="cs de en fr pl" 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" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage/layman/n4g" SYNC="rsync://rsync.de.gentoo.org/gentoo-portage" USE="X aac alsa arts bash-completion bindist cups dbus fam firefox gnome gpm gtk hal ipod kde kerberos ldap logrotate ncurses nls nptl nptlonly nsplugin offensive oss pam pcre pic png python qt3 qt4 rdesktop readline samba sasl slang spell sqlite sqlite3 ssl svg syslog tcpd threads tk truetype unicode vnc webdav wxwindows x86 xcomposite xinetd xscreensaver zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 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 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="keyboard vmmouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="cs de en fr pl" USERLAND="GNU" VIDEO_CARDS="vmware" Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, MAKEOPTS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
I confirm this on my ~amd64 system. However, if I set 'routes_eth1=( "default via 192.168.1.1" )', it is assigned regardless of whether dhcp succeeds in configuring addresses with 'config_eth1=( "dhcp" )'.
I confirm this on my ~x86 system. I'l try to edit init.d/net.lo. It seems it doesn't knew anyting about fallback_route :\
(In reply to comment #1) > I confirm this on my ~amd64 system. However, if I set 'routes_eth1=( "default > via 192.168.1.1" )', it is assigned regardless of whether dhcp succeeds in > configuring addresses with 'config_eth1=( "dhcp" )'. This may be the new way of doing this. Thorsten, can you try setting routes_eth0 instead of fallback_route_eth0 and see if that solves the issue for you? If so, I will rework the documentation. Thanks, William
Please test with fallback_routes_ instead of fallback_route_.
(In reply to comment #4) > Please test with fallback_routes_ instead of fallback_route_. I tested both ways and neither of them works. I also tested the suggestion in comment #1. I found that any routes listed in routes_* get added to the routing table, regardless of whether the primary or fallback configuration for the interface is used. Assuming that the primary and fallback configurations are on the same network, this makes sense, because you might have static routes in routes_* which you want either way. But is it fair to assume that the two configurations will be on the same network? If we do not assume that, this is a bug. If we do make that assumption, fixing this is just a matter of fixing the comments in the net.example files.
How about the following logic for the failure case: 1. attempt bringup 2. failure 3. routes=${fallback_routes_$IFVAR} 4. [ -z "${routes}" ] && routes=${routes_$IFVAR} 5. add ${routes}
Created attachment 269071 [details] fix-fallback.patch Robin, what do you tink of this patch? If this works for you I'll commit it. Thanks, William
williamh: if the code works, ship it.
This is fixed in commit 15660db. There are a couple of differences in this implementation from baselayout-1; however, they are covered in the net.example file. - the variable names are fallback_routes_* instead of fallback_route_*. - If you want the routes setting to be the same, regardless of whether the primary or fallback configuration is used, you do not need this setting; routes_* will be used if fallback_routes_* is not set.