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