public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download: 
* Re: [gentoo-user] Howto  setup tunnel in gentoo scripts
  @ 2006-05-30 20:58 99% ` Neil Bothwick
  0 siblings, 0 replies; 1+ results
From: Neil Bothwick @ 2006-05-30 20:58 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 1091 bytes --]

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.


-- 
Neil Bothwick

No maintenance: Impossible to fix.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[relevance 99%]

Results 1-1 of 1 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2006-05-30 20:29     [gentoo-user] Howto setup tunnel in gentoo scripts Norbert Kamenicky
2006-05-30 20:58 99% ` Neil Bothwick

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox