public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: Norbert Kamenicky <noro@xmedia.sk>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] Howto  setup tunnel in gentoo scripts
Date: Wed, 31 May 2006 00:27:59 +0200	[thread overview]
Message-ID: <447CC6EF.4070809@xmedia.sk> (raw)
In-Reply-To: <20060530215856.57809678@hactar.digimed.co.uk>

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



  reply	other threads:[~2006-05-30 22:38 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-30 20:29 [gentoo-user] Howto setup tunnel in gentoo scripts Norbert Kamenicky
2006-05-30 20:58 ` Neil Bothwick
2006-05-30 22:27   ` Norbert Kamenicky [this message]
2006-05-30 23:15     ` Neil Bothwick
2006-05-31 22:40       ` [gentoo-user] Re: [OT] " Norbert Kamenicky
2006-05-31 23:00         ` Neil Bothwick
2006-06-01 17:17           ` Norbert Kamenicky
2006-06-01 17:55             ` Neil Bothwick

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=447CC6EF.4070809@xmedia.sk \
    --to=noro@xmedia.sk \
    --cc=gentoo-user@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox