From owner-freebsd-net@FreeBSD.ORG Sun Aug 24 21:29:01 2014 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B4D49922 for ; Sun, 24 Aug 2014 21:29:01 +0000 (UTC) Received: from mail-qa0-x233.google.com (mail-qa0-x233.google.com [IPv6:2607:f8b0:400d:c00::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7129736B4 for ; Sun, 24 Aug 2014 21:29:01 +0000 (UTC) Received: by mail-qa0-f51.google.com with SMTP id k15so11480811qaq.24 for ; Sun, 24 Aug 2014 14:29:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=VWcQnRVHIbVDAClHKC/7gRaA2t/j2b6dBZAB5VX32XE=; b=yJhkeIrk9qq/HfuHhqJFP6KDG2LZUp6n7buimwVaKOpcUD9o4x/muWbC/BldLqe1KR O/wqzlZt/8GXQuPVNZOUXVDxV8VhkjeiPB+PZnWnPB4Tja3AgjJ6kLLSc6lBcpTrbKhG Z2mSyQAVvXkWQBYYW6YHnZ1NLQx7/eCH0nIr8tYzXolKM0f/ixeZPk4LkF7WqtJe8qVB uVi2cr43IcSarHroO4uavyJ6sIlXNpJXEWsxrUtBAPPnlDCbYam+Hv2TS7kUyXP5H/YP FGOIlvi/cQDdNozWbvJAfxXFe9/R6UfRTxjNH2YE7OIPh08IsCOSeu3iPBfjvfqdRX51 AFqg== MIME-Version: 1.0 X-Received: by 10.140.104.69 with SMTP id z63mr27182278qge.81.1408915740466; Sun, 24 Aug 2014 14:29:00 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.39.139 with HTTP; Sun, 24 Aug 2014 14:29:00 -0700 (PDT) In-Reply-To: <14808814623.112dfc436230575.4702450748812904217@devalias.io> References: <14808814623.112dfc436230575.4702450748812904217@devalias.io> Date: Sun, 24 Aug 2014 14:29:00 -0700 X-Google-Sender-Auth: TI9MlBqAnQ5VyQ_kDqBpjI6WFQ8 Message-ID: Subject: Re: Re: Set arbitrary protocol for route? From: Adrian Chadd To: jmoore Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: FreeBSD Net X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Aug 2014 21:29:01 -0000 Hi, It looks like someone needs to abstract out the address manager code a little - adding/removing/querying routing table information is an OS specific thing and should be moved into a module. Then yes, you could use the protocol flags mentioned to do it on freebsd, complete with whatever other OS specific stuff has to happen. -a On 24 August 2014 07:58, jmoore wrote: > ---- On Sat, 23 Aug 2014 13:33:04 -0400 Nikolay Denev <nike_d@cytexbg.= com> wrote ---- > > On Sat, Aug 23, 2014 at 8:49 AM, Adrian Chadd <adrian@freebsd.org> = wrote: > > Ok, so how does the whole protocol thing implement priority? > > > > > > -a > > Ah, sorry, reading again I don't think it does that. For some reason I > was under the impression it does. > So, it looks like it's just a 8 bit tag applied to each route, not > involved in the actual routing, but allows you > to filter when displaying etc. > From linux ip-route(8) man page : > > protocol RTPROTO > the routing protocol identifier of this route. RTPROTO may be a > number or a string from the file /etc/iproute2/rt_protos. If > the routing protocol ID is not given, ip assumes protocol boot > (i.e. it assumes the route was added by someone who doesn't > understand what they are doing). Several protocol values have a > fixed interpretation. Namely: > > redirect - the route was installed due to an ICMP > redirect. > > kernel - the route was installed by the kernel during > autoconfiguration. > > boot - the route was installed during the bootup > sequence. If a routing daemon starts, it will purge all > of them. > > static - the route was installed by the administrator to > override dynamic routing. Routing daemon will respect > them and, probably, even advertise them to its peers. > > ra - the route was installed by Router Discovery > protocol. > > The rest of the values are not reserved and the administrator is > free to assign (or not to assign) protocol tags. > > > > --Nikolay > > > The context for this questions is updating this script[1] to allow a (cur= rently) unsupported FreeBSD instance running on Google Compute Engine to be= able to use their load balancers. In this case, the proto is used as a ma= gic number, as necessary internal routes are programmatically determined an= d then compared to current routes, adding/removing as needed. > > [1] https://github.com/GoogleCloudPlatform/compute-image-packages/blob/ma= ster/google-daemon/usr/share/google/google_daemon/address_manager.py > > > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"