conf/111558: link1 flag doesn't work as intended when specified in startup scripts

Eugene M. Zheganin emz at norma.perm.ru
Sat Apr 14 07:10:03 UTC 2007


>Number:         111558
>Category:       conf
>Synopsis:       link1 flag doesn't work as intended when specified in startup scripts
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Apr 14 07:10:02 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator:     Eugene M. Zheganin
>Release:        6.2-RELEASE
>Organization:
Norma JSC.
>Environment:
FreeBSD bsd.niiums.perm.ru 6.2-RELEASE FreeBSD 6.2-RELEASE #2: Thu Jan 25 16:13:06 YEKT 2007     emz at bsd.niiums.perm.ru:
/usr/obj/usr/src/sys/NIIUMS  i386
>Description:
'link1' flag doesn't work as intended when configured for gre tunnel using main system config files:

- when configured via ifconfig_gre0="" with all appropriate parameters the interface does appear with 'LINK1' flag, but requires an additional 'ifconfig gre link1' command for the tunnel to start working;

- when configured via 'start_if.gre0' script with all additional parameters, for example

===Cut===
#!/bin/sh

/sbin/ifconfig gre0 192.168.1.1 192.168.1.2 netmask 255.255.255.255 10.10.10.1 10.10.10.5 mtu 1480
# even when sleep 10
sleep 10
/sbin/ifconfig gre0 link1
===Cut==

the system still requires 'ifconfig gre0 link1' for the tunnel to start working;
>How-To-Repeat:
Create a gre tunnel with link1 set in configuration files; in rc.conf or even in start_if.gre0.
Reboot the machine.
Try to ping remote.
>Fix:
echo gre_enable="YES" >> /etc/rc.conf
echo gre_flags="greX link1" >> /etc/rc.conf

(according to your configuration)

and place the following script to /usr/local/etc/rc.d/:

#!/bin/sh
#

#
# gre startup script by drookie, 14/04/2007 12:38
# to avoid link1 bug when it is configured in earlier scripts :/
#
# PROVIDE: gre
# REQUIRE: LOGIN NETWORKING
#
#

name=gre
command=/sbin/ifconfig
gre_enable=${gre_enable:-"NO"}

. /etc/rc.subr
rcvar=`set_rcvar`
load_rc_config ${name}

run_rc_command "$1"
>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list