Gentoo Archives: gentoo-user

From: Neil Bothwick <neil@××××××××××.uk>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Howto setup tunnel in gentoo scripts
Date: Tue, 30 May 2006 21:06:18
Message-Id: 20060530215856.57809678@hactar.digimed.co.uk
In Reply to: [gentoo-user] Howto setup tunnel in gentoo scripts by Norbert Kamenicky
1 On Tue, 30 May 2006 22:29:02 +0200, Norbert Kamenicky wrote:
2
3 > to establish gre tunnel, these commands have to be run:
4 > (e.g. from local.start)
5 >
6 > # ip tunnel add vpn0 mode gre remote 1.1.1.1 local 2.2.2.2 dev eth0
7 > # ip addr add 3.3.3.3 dev vpn0
8 > # ip link set vpn0 mtu 1420 up
9 >
10 > Does anybody know, how to put it into /etc/conf.d/net ?
11 > I didn't succeed yet, 'cause I found no clear doc.
12
13 I take it you want these run when the interface comes up? If so, put them
14 in the postup() function in /etc/conf.d/net. Something like
15
16 postup() {
17 if [ ${IFACE} == "eth0" ]; then
18 ip tunnel add vpn0 mode gre remote 1.1.1.1 local 2.2.2.2 dev eth0
19 ip addr add 3.3.3.3 dev vpn0
20 ip link set vpn0 mtu 1420 up
21 fi
22 }
23
24 You may need to put the shutdown commands in predown().
25
26 See /etc/conf.d/net.example for more info. I use ~arch, so I don't know
27 for sure how much of this works in the current stable baselayout, but
28 I've been using these functions for over a year, so I guess it's in
29 stable by now.
30
31
32 --
33 Neil Bothwick
34
35 No maintenance: Impossible to fix.

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-user] Howto setup tunnel in gentoo scripts Norbert Kamenicky <noro@××××××.sk>