From owner-freebsd-stable@FreeBSD.ORG Tue Jun 19 07:56:34 2012 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A66301065670 for ; Tue, 19 Jun 2012 07:56:34 +0000 (UTC) (envelope-from hm@hm.net.br) Received: from msrv.matik.com.br (msrv.matik.com.br [187.95.0.181]) by mx1.freebsd.org (Postfix) with ESMTP id 0B5048FC0A for ; Tue, 19 Jun 2012 07:56:33 +0000 (UTC) Received: from pop1.hm.net.br (bd072572.virtua.com.br [189.7.37.114] (may be forged)) (authenticated bits=0) by msrv.matik.com.br (8.14.5/8.14.5) with ESMTP id q5J7uFg3086350 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 19 Jun 2012 04:56:15 -0300 (BRT) (envelope-from hm@hm.net.br) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.97.4 at msrv.matik.com.br X-DKIM: OpenDKIM Filter v2.5.2 msrv.matik.com.br q5J7uFg3086350 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=hm.net.br; s=racoon; t=1340092577; bh=xVeFHgxzzoM/gv4ECwiySLgXsFIE/dJGXsM++2NUPtE=; h=From:To:Subject:Date:Cc:References:In-Reply-To; b=cqnPP1Ic3zTLwhe0jJXr1ZB7Clq5p4faQy17lduNhelIMVC2DtWfdvygkmQViwA82 eTQY83pLlrsCQ/ssYm0LRysd3AbwLXloZxxkPQy4HE7NbL+9U9c1gAqGLARmTlgf4S es+RoBW7BAg6o72sIQl9rhslXKdtYBMq4Q2G4Sag= Authentication-Results: msrv.matik.com.br; sender-id=pass header.from=hm@hm.net.br; auth=pass (PLAIN); spf=pass smtp.mfrom=hm@hm.net.br From: H Organization: HM-Net To: freebsd-stable@freebsd.org Date: Tue, 19 Jun 2012 04:55:59 -0300 User-Agent: KMail/1.13.7 (FreeBSD/9.0-STABLE; KDE/4.8.4; i386; ; ) References: <4FDB6AA3.3040606@gmail.com> <201206181803.41211.hm@hm.net.br> <201206182307.10050.hselasky@c2i.net> In-Reply-To: <201206182307.10050.hselasky@c2i.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart4499585.QzosB4aL3A"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <201206190456.13409.hm@hm.net.br> X-Spam-Status: No, score=4.5 required=5.0 tests=AWL=-0.369,BAYES_00=-1.9,DKIM_SIGNED=0.1,DKIM_VALID=-0.1,DKIM_VALID_AU=-0.1,RCVD_IN_BRBL_LASTEXT=1.449,RCVD_IN_PBL=3.335,RCVD_IN_RP_RNBL=1.31,RDNS_NONE=0.793,SPF_PASS=-0.001 msrv.matik.com.br 1356; Body=1 Fuz1=1 Fuz2=1 [127.0.0.11] [127.0.0.2] [1 mail.matik.com.br.] [127.0.0.6] [187.95.0.182] autolearn=no ASN AS28573 189.7.36.0/22 X-Spam-Level: **** X-Spam-Checker-Version: SpamAssassin 3.3.2-hm_201202.c (2011-06-06) on msrv.matik.com.br Cc: sthaug@nethelp.no, Hans Petter Selasky Subject: Re: How to bind a route to a network adapter and not IP X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jun 2012 07:56:34 -0000 --nextPart4499585.QzosB4aL3A Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: quoted-printable On Monday 18 June 2012 18:07 Hans Petter Selasky wrote: > On Monday 18 June 2012 23:03:34 H wrote: > > On Monday 18 June 2012 12:54 Hans Petter Selasky wrote: > > > On Monday 18 June 2012 00:00:51 H wrote: > > > > sthaug@nethelp.no wrote: > > > > >>> I loose packets because I use a WLAN adapter. Sometimes the link > > > > >>> is down for various reasons, and then the routes start changing > > > > >>> for manually created routes, and I want to prevent that. > > > > >>=20 > > > > >> well that is certainly not a reason for changing routes > > > > >>=20 > > > > >> I have the feeling you are not explaining good enough what really > > > > >> is going on and it may help sending your configurations and an > > > > >> example of routes and IP addresses before and after this route > > > > >> change > > > > >=20 > > > > > Why is this so hard to understand? "Link down" leads to "static > > > > > route is deleted". This is standard FreeBSD behavior, and has been > > > > > this way for as long as I can remember (btw, I believe this > > > > > behavior is from the original BSD, not FreeBSD specific). > > > > >=20 > > > > > You can show this by having a static default route pointing to an > > > > > address on an Ethernet interface which has link. And then pulling > > > > > the TP cable from the Ethernet interface. Observe that the default > > > > > route is automatically removed. > > > >=20 > > > > may be you have not understood your own problem yet > > > >=20 > > > > because so far is nothing to be understood because none of your > > > > statements is correct, it is also not FreeBSD's standard behavior a= nd > > > > never has been > > > >=20 > > > > as long as there is the valid IP address on the related interface, = no > > > > static route will be deleted, you can even boot without cable and t= he > > > > [default] static route is there > > > >=20 > > > > so you need to explain better your problem in order to understand it > > > >=20 > > > > probably you have some other stuff running, thirdparty network > > > > manager or something, incorrect or incomplete ppoe or dhc > > > > configuration or whatever leads to the problem > > > >=20 > > > > FYI static routes usually are the manually configured routes, so wh= at > > > > you say is redundant and not correct, I guess you're loosing some > > > > kind of dynamic route > > > >=20 > > > > since WL networks usually do not run RIP/OSPF/BGP I guess the route > > > > you apparently loose is coming from some dhcp server and may be your > > > > dhclient configuration is incomplete or none existent, but here now > > > > it would be useful to see your config > > >=20 > > > Hi, > > >=20 > > > I think we need to distinguish between two matters. One is where the > > > route is directly reachable on the local-net of the network adapter, > > > and ARP is valid/responding. The second case is when the route is not > > > directly reachable. The second case is where the problem happens, like > > > Stian kindly explained. > > >=20 > > > # For example: > > >=20 > > > ifconfig wlan0 10.0.0.2 255.255.255.0 up > > >=20 > > > # Assume the router is at 10.0.0.1 > > > # And we want to reach a certain destination through 10.0.0.1 > > > # Then we do: > > >=20 > > > route add 10.22.1.1 10.0.0.1 > >=20 > > no no no my friend, wrong again > >=20 > > that is a static route and it goes away same way it was created, manual= ly > > or by deleting the IP address 10.0.0.2 from the related interface > >=20 > > wether there is or not an active link on that interface does not matter >=20 > Hi, >=20 > Can it be that dhclient which I'm running on this interface with manual > routes disrupts stuff then ?? >=20 so now we're coming to the point ... on renewal of the IP address the interface is set do down, old IP removed a= nd=20 the new one (even if the same as before) is associated and the IF comes up= =20 again means, any route associated get lost, you may get a new one (default) from = the=20 dhcp server you could set some options in your /etc/dhclient.conf to match your needs you could request a longer lease time, eventually reduce the retry time to = get=20 less down time check your log what the dhcp server send to you may be you try something like: timeout 60; retry 60; send dhcp-lease-time 36000; (or more to cover your longest up time) if the longer lease time does not work, then I guess then you could use th= e=20 'script "name"' option to set your special route after renewal Hans =2D-=20 HM +55 17 8111.3300 --nextPart4499585.QzosB4aL3A Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEABECAAYFAk/gMJ0ACgkQvKVfg5xjCDxPdgCbBKbueD3t8vMZgrIO2tA4811L xnkAoJ6POSri4yslvTyKvnztgTsigxbK =Fvl6 -----END PGP SIGNATURE----- --nextPart4499585.QzosB4aL3A--