From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.gentoo.org ([140.105.134.102] helo=robin.gentoo.org) by nuthatch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1FlCr7-0003lP-JC for garchives@archives.gentoo.org; Tue, 30 May 2006 22:38:29 +0000 Received: from robin.gentoo.org (localhost [127.0.0.1]) by robin.gentoo.org (8.13.6/8.13.6) with SMTP id k4UMaY5N007202; Tue, 30 May 2006 22:36:34 GMT Received: from xmedia.sk (chello085216193205.chello.sk [85.216.193.205]) by robin.gentoo.org (8.13.6/8.13.6) with ESMTP id k4UMSRdu027592 for ; Tue, 30 May 2006 22:28:27 GMT Received: (qmail 28559 invoked by uid 210); 31 May 2006 00:28:15 +0200 Received: from 127.0.0.1 by noro (envelope-from , uid 201) with qmail-scanner-1.25st (clamdscan: 0.83/819. spamassassin: 3.0.2. perlscan: 1.24st. Clear:RC:1(127.0.0.1):SA:0(-4.1/5.0):. Processed in 1.259377 secs); 30 May 2006 22:28:15 -0000 X-Spam-Status: No, hits=-4.1 required=5.0 Received: from localhost (HELO ?127.0.0.1?) (127.0.0.1) by localhost with SMTP; 31 May 2006 00:28:13 +0200 Message-ID: <447CC6EF.4070809@xmedia.sk> Date: Wed, 31 May 2006 00:27:59 +0200 From: Norbert Kamenicky User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.13) Gecko/20060505 X-Accept-Language: sk, cs, en-us, en Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] Howto setup tunnel in gentoo scripts References: <447CAB0E.9030405@xmedia.sk> <20060530215856.57809678@hactar.digimed.co.uk> In-Reply-To: <20060530215856.57809678@hactar.digimed.co.uk> X-Enigmail-Version: 0.92.0.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archives-Salt: 8bc84657-e15f-42dd-a61e-b256bd3ae333 X-Archives-Hash: 26ab929214b2a6c6e53f8ed36d632f95 Neil Bothwick wrote: > On Tue, 30 May 2006 22:29:02 +0200, Norbert Kamenicky wrote: > > >>to establish gre tunnel, these commands have to be run: >>(e.g. from local.start) >> >># ip tunnel add vpn0 mode gre remote 1.1.1.1 local 2.2.2.2 dev eth0 >># ip addr add 3.3.3.3 dev vpn0 >># ip link set vpn0 mtu 1420 up >> >>Does anybody know, how to put it into /etc/conf.d/net ? >>I didn't succeed yet, 'cause I found no clear doc. > > > I take it you want these run when the interface comes up? If so, put them > in the postup() function in /etc/conf.d/net. Something like > > postup() { > if [ ${IFACE} == "eth0" ]; then > ip tunnel add vpn0 mode gre remote 1.1.1.1 local 2.2.2.2 dev eth0 > ip addr add 3.3.3.3 dev vpn0 > ip link set vpn0 mtu 1420 up > fi > } > > You may need to put the shutdown commands in predown(). > > See /etc/conf.d/net.example for more info. I use ~arch, so I don't know > for sure how much of this works in the current stable baselayout, but > I've been using these functions for over a year, so I guess it's in > stable by now. > Hi Neil, thanks for the reply ... yes, I want to start it, if eth0 goes up. Ok, it will probably work (not tested yet), but ... it's not a big difference if it is in local.start, postup() function or some another script.) I feel that's not the right way how it should be done. This is probably a bit closer to rc-script author idea: modules=( "iptunnel" ) # no info about it in net.example iptunnel_vpn0=( "mode gre remote 1.1.1.1 local 2.2.2.2 dev eth0" ) config_vpn0=( "3.3.3.3" ) postup(){ [ ${IFACE} == "vpn0" ] && ip link set vpn0 mtu 1420 up } Next I like to add this route: ip route add 4.4.4.0/24 dev vpn0 which IMO should be possible to write as: routes_vpn0=( "4.4.4.0/24" ) but it fails with "[!!]" error, which tells me exactly nothing Any idea ? noro -- gentoo-user@gentoo.org mailing list