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 1FlBPu-0003Ef-6K for garchives@archives.gentoo.org; Tue, 30 May 2006 21:06:18 +0000 Received: from robin.gentoo.org (localhost [127.0.0.1]) by robin.gentoo.org (8.13.6/8.13.6) with SMTP id k4UL4VDU006201; Tue, 30 May 2006 21:04:31 GMT Received: from heisenberg.zen.co.uk (heisenberg.zen.co.uk [212.23.3.141]) by robin.gentoo.org (8.13.6/8.13.6) with ESMTP id k4UKx2Xb005652 for ; Tue, 30 May 2006 20:59:02 GMT Received: from [82.69.83.178] (helo=desiato.digimed.co.uk) by heisenberg.zen.co.uk with esmtp (Exim 4.30) id 1FlBIs-0003BK-5C for gentoo-user@lists.gentoo.org; Tue, 30 May 2006 20:59:02 +0000 Received: from hactar.digimed.co.uk (hactar.digimed.co.uk [192.168.1.2]) by desiato.digimed.co.uk (Postfix) with ESMTP id D38DB1421082 for ; Tue, 30 May 2006 21:58:59 +0100 (BST) Date: Tue, 30 May 2006 21:58:56 +0100 From: Neil Bothwick To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] Howto setup tunnel in gentoo scripts Message-ID: <20060530215856.57809678@hactar.digimed.co.uk> In-Reply-To: <447CAB0E.9030405@xmedia.sk> References: <447CAB0E.9030405@xmedia.sk> Organization: Digital Media Production X-Mailer: Sylpheed-Claws 2.3.0-rc4 (GTK+ 2.8.18; x86_64-pc-linux-gnu) X-GPG-Fingerprint: 7260 0F33 97EC 2F1E 7667 FE37 BA6E 1A97 4375 1903 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 Content-Type: multipart/signed; boundary=Sig_kpn.zUhFeZ2aTPnLoInboUn; protocol="application/pgp-signature"; micalg=PGP-SHA1 X-Originating-Heisenberg-IP: [82.69.83.178] X-Archives-Salt: dfbd92da-d348-45cf-a3e1-cf99117fc9c4 X-Archives-Hash: 9a7eb99ebb03e1b862ee0690b5dda339 --Sig_kpn.zUhFeZ2aTPnLoInboUn Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable 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) >=20 > # 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 >=20 > 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} =3D=3D "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. --=20 Neil Bothwick No maintenance: Impossible to fix. --Sig_kpn.zUhFeZ2aTPnLoInboUn Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (GNU/Linux) iD8DBQFEfLITum4al0N1GQMRAlXYAJwJOOE9sj+u1xvZrr+HKr4E/N8UagCg0ldI wB5WiVSHvSpvcxbM/ofUZYI= =Xp0Q -----END PGP SIGNATURE----- --Sig_kpn.zUhFeZ2aTPnLoInboUn-- -- gentoo-user@gentoo.org mailing list