From owner-freebsd-isp@FreeBSD.ORG Wed Aug 22 12:54:34 2007 Return-Path: Delivered-To: freebsd-isp@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A8E1F16A419 for ; Wed, 22 Aug 2007 12:54:34 +0000 (UTC) (envelope-from ssch@wheel.dk) Received: from freesbee.wheel.dk (freesbee.wheel.dk [IPv6:2001:6c8:1:1000::5]) by mx1.freebsd.org (Postfix) with ESMTP id 094AC13C457 for ; Wed, 22 Aug 2007 12:54:34 +0000 (UTC) (envelope-from ssch@wheel.dk) Received: by freesbee.wheel.dk (Postfix, from userid 1011) id 0DF952E3A1; Wed, 22 Aug 2007 14:54:33 +0200 (CEST) Date: Wed, 22 Aug 2007 14:54:33 +0200 From: Steffen Schumacher To: Tom Judge Message-ID: <20070822125432.GB58627@schumacher.dk> Mail-Followup-To: Tom Judge , freebsd-isp@freebsd.org References: <20070822080112.GA58627@schumacher.dk> <46CC1E6E.9080701@tomjudge.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <46CC1E6E.9080701@tomjudge.com> X-PGP-Fingerprint: 65A2 111C D142 3A62 8E62 8C9A 3EF2 E98F 8700 F50D X-PGP-Public-Key: http://schumacher.wheel.dk/publickey.pub X-Operating-System: FreeBSD/i386 6.2-STABLE User-Agent: Mutt/1.5.16 (2007-06-09) Cc: freebsd-isp@freebsd.org Subject: Re: Using FreeBSD as a router X-BeenThere: freebsd-isp@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Internet Services Providers List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Aug 2007 12:54:34 -0000 On 22.08.2007 12:30:54 +0100, Tom Judge wrote: > Steffen Schumacher wrote: >> Hi! >> This may b the wrong list, but you might know the right one.. >> I'm using the port quagge (zebra spin-off) in order to run bgp >> off of two freebsd boxes, serving as routers. >> They receive a default candidate from bgp: a/b. >> The aim is to configure a static default with a next-hop of a/b. >> This way the isp doesn't have to announce a 0/0, and I will still >> have a default pointing the right way. >> (I'm getting the a/b in from two separate lines for redundancy). >> My problem is that I can't make the default work. >> I use 'route default a/b' which actually shows up in 'netstat -rnf inet' >> but it still doesn't work. >> I've enclosed a lot of debug output. >> Can anyone point me in the right direction? >> Debug output: >> g3# route add default 195.249.0.0 >> add net default: gateway 195.249.0.0 > > Firstly this address is not a valid host address it is a network address. > as shown by the routing entry below. Secondly your default gateway must be > on your local network segment to work however 195.249.0/16 is behind the > router 131.164.191.1. > > 195.249.0/16 131.164.191.1 UG1 1 12 vlan7 > > Perhaps your default gateway should be 131.164.191.1 ?? > Yes - ultimately that should be my gateway, but I want FreeBSD to realize this by looking at the 195.249.0/16 route. The thing is that 195.249.0/16 will also be seen from 131.164.191.2 but with a lower localpref, making 131.164.191.1 the best choice. This way if .1 dies, 195.249.0/16 should be routed towards .2, and ultimately my default should go at .2 also. This is the goal - to make the default move to .2 if .1 is dead, and back when 1. comes back up again. I don't think it matters if I use 195.249.0.0 or 195.249.1.1, since the router receiving the packets will do their own routing lookup. Whats important is only getting the next-hop mac/if for the default route, and that should be available from the 195.249.0/16 route. /Steffen > Tom > >> g3# netstat -rnf inet >> Routing tables >> Internet: >> Destination Gateway Flags Refs Use Netif Expire >> default 195.249.0.0 UGS 0 0 vlan7 >> 127.0.0.1 127.0.0.1 UH 0 725 lo0 >> 131.164.191/29 link#10 UC 0 0 vlan7 >> 131.164.191.1 00:12:1e:f0:a0:fe UHLW 2 33782 vlan7 260 >> 131.164.191.2 00:0f:34:62:27:38 UHLW 1 5927 vlan7 1127 >> 131.164.191.3 00:0e:0c:b2:c6:55 UHLW 1 35 lo0 >> 131.164.191.9 192.168.0.2 UGH1 0 981 vlan1 >> 131.164.191.10 131.164.191.10 UH 0 4 lo0 >> 131.164.191.16/29 192.168.0.2 UG1 0 270 vlan1 >> 131.164.191.24 ff:ff:ff:ff:ff:ff UHLWb 1 50 vlan5 => >> 131.164.191.24/29 link#8 UC 0 0 vlan5 >> 131.164.191.27 00:0e:0c:b2:c6:55 UHLW 1 4 lo0 >> 131.164.191.31 ff:ff:ff:ff:ff:ff UHLWb 1 39 vlan5 >> 192.168.0 link#4 UC 0 0 vlan1 >> 192.168.0.2 00:0e:0c:bd:27:38 UHLW 3 12241 vlan1 1113 >> 192.168.10 link#5 UC 0 0 vlan2 >> 192.168.11 link#4 UC 0 0 vlan1 >> 192.168.20 link#6 UC 0 0 vlan3 >> 192.168.20.2 00:0e:0c:bd:27:38 UHLW 1 508 vlan3 31 >> 192.168.21 link#7 UC 0 0 vlan4 >> 195.249.0/16 131.164.191.1 UG1 1 12 vlan7 >> and some route lookups: >> g3# route -vn get 0 >> u: inet 0.0.0.0; u: link ; RTM_GET: Report Metrics: len 168, pid: 0, seq >> 1, errno 0, flags: >> locks: inits: sockaddrs: >> default default route to: default >> destination: default >> mask: default >> gateway: 195.249.0.0 >> interface: vlan7 >> flags: >> recvpipe sendpipe ssthresh rtt,msec rttvar hopcount mtu >> expire >> 0 0 0 0 0 0 9504 >> 0 locks: inits: sockaddrs: >> default 195.249.0.0 default vlan7:0.e.c.b2.c6.55 131.164.191.3 >> g3# route -vn get 195.249.0.0 >> u: inet 195.249.0.0; u: link ; RTM_GET: Report Metrics: len 172, pid: 0, >> seq 1, errno 0, flags: >> locks: inits: sockaddrs: >> 195.249.0.0 (0) 0 ffff route to: 195.249.0.0 >> destination: 195.249.0.0 >> mask: 255.255.0.0 >> gateway: 131.164.191.1 >> interface: vlan7 >> flags: >> recvpipe sendpipe ssthresh rtt,msec rttvar hopcount mtu >> expire >> 0 0 0 0 0 0 9504 >> 0 locks: inits: sockaddrs: >> 195.249.0.0 131.164.191.1 255.255.0.0 vlan7:0.e.c.b2.c6.55 131.164.191.3 >> g3# route -vn get 131.164.191.1 >> u: inet 131.164.191.1; u: link ; RTM_GET: Report Metrics: len 164, pid: 0, >> seq 1, errno 0, flags: >> locks: inits: sockaddrs: >> 131.164.191.1 route to: 131.164.191.1 >> destination: 131.164.191.1 >> interface: vlan7 >> flags: >> recvpipe sendpipe ssthresh rtt,msec rttvar hopcount mtu >> expire >> 0 0 0 0 0 0 9504 >> 84 locks: inits: sockaddrs: >> 131.164.191.1 0.12.1e.f0.a0.fe vlan7:0.e.c.b2.c6.55 131.164.191.3 >> _______________________________________________ >> freebsd-isp@freebsd.org mailing list >> http://lists.freebsd.org/mailman/listinfo/freebsd-isp >> To unsubscribe, send any mail to "freebsd-isp-unsubscribe@freebsd.org" > > _______________________________________________ > freebsd-isp@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-isp > To unsubscribe, send any mail to "freebsd-isp-unsubscribe@freebsd.org"