From owner-freebsd-questions@FreeBSD.ORG Thu Mar 10 11:35:45 2005 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E1AD016A4CF for ; Thu, 10 Mar 2005 11:35:44 +0000 (GMT) Received: from webmail-outgoing.us4.outblaze.com (webmail-outgoing.us4.outblaze.com [205.158.62.67]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7CF5C43D53 for ; Thu, 10 Mar 2005 11:35:44 +0000 (GMT) (envelope-from fteg@london.com) Received: from wfilter.us4.outblaze.com (wfilter.us4.outblaze.com [205.158.62.180])82DAA1800135 for ; Thu, 10 Mar 2005 11:35:44 +0000 (GMT) X-OB-Received: from unknown (205.158.62.49) by wfilter.us4.outblaze.com; 10 Mar 2005 11:35:44 -0000 Received: by ws1-1.us4.outblaze.com (Postfix, from userid 1001) id 7474C4BE6D; Thu, 10 Mar 2005 11:35:44 +0000 (GMT) Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Received: from [213.187.181.70] by ws1-1.us4.outblaze.com with http for fteg@london.com; Thu, 10 Mar 2005 06:35:44 -0500 From: "Fafa Diliha Romanova" To: "Mario Hoerich" Date: Thu, 10 Mar 2005 06:35:44 -0500 X-Originating-Ip: 213.187.181.70 X-Originating-Server: ws1-1.us4.outblaze.com Message-Id: <20050310113544.7474C4BE6D@ws1-1.us4.outblaze.com> cc: questions@freebsd.org Subject: Re: IPv6 setup script ... doesn't work!! X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Mar 2005 11:35:45 -0000 Mario, Thank you! I am beyond appreciation and respect to you! I feel I also learned a lot about shell scripting while doing this. You are truly a kind soul for letting your experience influence my life, man. Again, thank you. 1) How would this setup look in rc.conf? Since FreeBSD 5 is all about centralizing, they say, I'd appreciate being able to move all my vital configuration into one place. 2) Does this code look OK now then? case "$1" in start) ifconfig gif create ifconfig gif0 inet 213.187.181.70 213.121.24.85 ifconfig gif0 inet6 2001:618:400::d5bb:b546 prefixlen 128 route add -inet6 default 'fe80::%gif0' ifconfig lnc0 inet6 2001:618:400:6ad9:: prefixlen 64 sysctl -w net.inet6.ip6.forwarding=3D1 /usr/sbin/rtadvd lnc0 if [ $? =3D "0" ]; then echo "IPv6 activated." else echo "IPv6 activation failed." 1>&2 exit 1 fi ;; stop) killall -m rtadvd sysctl -w net.inet6.ip6.forwarding=3D0 ifconfig fxp0 inet6 2001:618:400:6ad9:: prefixlen 64 delete route delete -inet6 default fe80::%gif0 ifconfig gif0 inet6 2001:618:400::d5bb:b546 prefixlen 128 delete ifconfig gif0 delete if [ $? =3D "0" ]; then echo "IPv6 deactivated." else echo "IPv6 deactivation failed" 1>&2 exit 1 fi ;; restart) $0 stop echo Pausing 5 seconds before restart ... sleep 5 $0 start ;; *) echo "Usage: `basename $0` {start|stop|restart}" 1>&2 exit 1 esac exit 0 3) By the way, are you up for hire? All the best, -- Fafa ----- Original Message ----- From: "Mario Hoerich" To: "Fafa Diliha Romanova" Subject: Re: IPv6 setup script ... doesn't work!! Date: Thu, 10 Mar 2005 02:02:21 +0100 >=20 > # Fafa Diliha Romanova: > > # ifconfig gif create >=20 > Try uncommenting this (by removing the '#'). >=20 > > gifconfig gif0 inet 213.187.181.70 213.121.24.85 >=20 > Looks like a typo, this is probably just ifconfig. >=20 >=20 > > route add -inet6 default fe80::%gif0 >=20 > The shell will mangle this. Quote it, like 'fe80::%gif0'. >=20 >=20 > > ifconfig fxp0 inet6 2001:618:400:6ad9:: prefixlen 64 >=20 > Replace every occurence of fxp0 with your ethernet NIC (i.e. xl0). >=20 >=20 > > sysctl ?w net.inet6.ip6.forwarding=3D1 > ^^ > Another typo, this is supposed to be -w. >=20 >=20 > > echo "IPv6 activation complete!" || > > { echo "IPv6 activation failed!" 1>&2; exit 1; } > > ;; >=20 > Eh? So if echo on stdout fails, we're moving to stderr? > What am I missing here? >=20 > I'd guess the actual intent was more like >=20 > /usr/sbin/rtadvd fxp0 > if [ $? =3D "0" ]; then > echo "IPv6 activated." > else > echo "IPv6 activation failed." 1>&2 > exit 1 > fi >=20 >=20 > > gifconfig gif0 delete > > echo "IPv6 deactivation complete!" || > > { echo "IPv6 deactivation failed!" 1>&2; exit 1; } > > ;; >=20 > More junk code. >=20 >=20 > > echo "Usage: $0 {start|stop|restart}" >=20 > echo "Usage: `basename $0` {start|stop|restart}" 1>&2 >=20 >=20 > > Where did I go wrong? >=20 > You didn't. The script is rotten. >=20 > Regards, > Mario --=20 ___________________________________________________________ Sign-up for Ads Free at Mail.com http://promo.mail.com/adsfreejump.htm