From owner-freebsd-net@freebsd.org Tue Dec 12 20:00:53 2017 Return-Path: Delivered-To: freebsd-net@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 28163E82B7A for ; Tue, 12 Dec 2017 20:00:53 +0000 (UTC) (envelope-from freebsd-rwg@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0DCC26FC73 for ; Tue, 12 Dec 2017 20:00:52 +0000 (UTC) (envelope-from freebsd-rwg@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id vBCK0nJq088144; Tue, 12 Dec 2017 12:00:49 -0800 (PST) (envelope-from freebsd-rwg@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd-rwg@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id vBCK0nAE088143; Tue, 12 Dec 2017 12:00:49 -0800 (PST) (envelope-from freebsd-rwg) From: "Rodney W. Grimes" Message-Id: <201712122000.vBCK0nAE088143@pdx.rh.CN85.dnsmgr.net> Subject: Re: Changes to route(8) or routing between r325235 and r326782? In-Reply-To: <20171212.203058.74686940.sthaug@nethelp.no> To: sthaug@nethelp.no Date: Tue, 12 Dec 2017 12:00:49 -0800 (PST) CC: eugen@grosbein.net, freebsd-net@freebsd.org, crest@rlwinm.de X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Dec 2017 20:00:53 -0000 > > > >>> The whole maintain_loopback_route should be KILLED from the kernel, > > > >>> it is simply the wrong thing to be doing. > > > >> > > > >> Only if you can supply alternative way to assign highest priority > > > >> (administrative distance = 0) for "directly connected" routes. > > > >> And ability to override dynamically received prefixes with direct > > > >> interface address assignment. > > > > > > > > This is all done by correctly configured routing daemon > > > > running in userland over the route socket. > > > > > > Do we have such daemon maintaining directly connected routed in the base system? > > > > I believe we do, though it uses a fairly rare protocol now a days, > > called ripv2. man routed Both bird and quagga maintain these > > routes as well. I believe that openospfd does too. In fact > > I dont know of a routing daemon that does not try to maintain > > these. > > > > Also why does this need to ba a "in the base system"? Certainly > > sticking a route decision in the kernel that defeats any attempt > > to change it makes that pointless anyway. > > Being a router jockey at my daytime job I can symphatize with both > views here. > > - I *expect* that a route pointing out an interface will disappear > when that interface goes down, and reappear again when the interface > comes back up. This behavior is extremely consistent across all the > major router brands. On a hardware router this is always handled by a configured protocol, try turning off all configured protocols and see what happens. > - The standard FreeBSD behavior where a static route (added by a > manual "route add -net ...") does *not* reappear when an interface > comes back up, simply feels incredibly wrong and inconsistent. Again, your use to that behavior because on the hardware router you always have a routing protocol running. Try a router fresh out of the box with no protocols and see if it instantiats a loop back route, hech, I am not even sure if lo0 exists on some routers unless you create it! > But I also want the kernel to handle packet *forwarding*, and not > routing policy. I guess I'm looking for a a simplified routed which > will handle my static routes and can be turned on with a only an > xxx_enable in rc.conf and then basically forgotten. routed -q Need to test that, but if the code hasnt been broken that should just do the right thing about routes via local interfaces having the local IP added as a lo0 loopback route. I also think that if you use /etc/rc.d/netif and have your variables properly set in /etc/rc.conf that your routes well come and go as you down and up with /etc/rc.d/netif. > If I want something more complicated (typically BGP) I'll install > quagga. One of the problems now is that these programs are fighting with the kernel over these routes and just fill your logs with lots of useless messages and you can not reliably predict the loop back routes even if you ARE running a routing protocol daemon. I also find it hillarious that the code emits a bogous console message when I down an interface that it could not delete the loopback route, that is because it went away when the if went down and it is nonsense to call maintain_loopback_route with a delete flag in this instance. This clearly informs one that the code was not well thought out. Probably written by someone that does not understand what is happening in the kernel automatically when an interface goes down. > Steinar Haug, Nethelp consulting, sthaug@nethelp.no -- Rod Grimes rgrimes@freebsd.org