From owner-freebsd-net@FreeBSD.ORG Sun Apr 29 21:33:13 2012 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8917A1065673 for ; Sun, 29 Apr 2012 21:33:13 +0000 (UTC) (envelope-from mlists+freebsd-net=freebsd-net=freebsd.org=ljksjktw@daemonground.de) Received: from mx.daemonground.de (mx.daemonground.de [IPv6:2a01:4f8:131:33e1::325]) by mx1.freebsd.org (Postfix) with ESMTP id 9A9A88FC15 for ; Sun, 29 Apr 2012 21:33:12 +0000 (UTC) Received: from [2001:4dd0:f88e:0:5dd:9690:2e32:3ad5] (helo=[IPv6:::1]) by mx.daemonground.de with esmtpsa (TLSv1:DHE-RSA-CAMELLIA256-SHA:256) (Exim) (envelope-from ) id 1SObjz-000PHu-Lv; Sun, 29 Apr 2012 23:33:11 +0200 Message-ID: <4F9DB397.2090104@daemonground.de> Date: Sun, 29 Apr 2012 23:33:11 +0200 From: Sascha Holzleiter User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20120327 Thunderbird/11.0.1 MIME-Version: 1.0 To: lev@FreeBSD.org References: <1606941405.20120429170656@serebryakov.spb.ru> In-Reply-To: <1606941405.20120429170656@serebryakov.spb.ru> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-net@freebsd.org Subject: Re: Hetzner.de IPv6 and FreeBSD -- default gateway is on other prefix, need to add static route before default -- how? X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: sascha@root-login.org List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Apr 2012 21:33:13 -0000 On 29.04.2012 15:06, Lev Serebryakov wrote: > Hello, Freebsd-net. > > "Famous" dedicated server provider Hetzner provides native IPv6 for > servers, but with rather strange routing configuration: you need to > configure static interface route and make this route default. > > If I add such lines in /etc/rc.conf: > > ifconfig_re0_ipv6="inet6 2a01:4f8:131:60a2::2 prefixlen 64 auto_linklocal accept_rtadv" > ipv6_static_routes="ipv6defgw" > ipv6_route_ipv6defgw="2a01:4f8:131:60a0:: -prefixlen 59 -iface re0" > ipv6_defaultrouter="2a01:4f8:131:60a0::1" > ipv6_default_interface="re0" > > It doesn't work, because default route added first and it fails to > be added, as route to 2a01:4f8:131:60a0::1 is not known yet. > > If I replace this line in /etc/rc.d/routing: > > ipv6_static_routes="default ${ipv6_static_routes}" > > with > > ipv6_static_routes="${ipv6_static_routes} default" > > Everything works, but it is ugly hack -- to change system startup > script, and I don't like it (for FreeBSD 8 I needed to change > /etc/network.subr in similar way). > > Is here any good way to configure such routing without changes in > scripts, only with /etc/rc.conf? Hi Lev, just use another static route instead of the ipv6_defaultroute entry: ipv6_static_routes="ipv6defgw ipv6defgwroute" ipv6_route_ipv6defgw="2a01:4f8:131:60a0:: -prefixlen 59 -iface re0" ipv6_route_ipv6defgwroute="default 2a01:4f8:131:60a0::1" It's not pretty but works without having to modify the rc scripts. Greetings, Sascha