Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 8 Jun 2016 15:43:27 +0500
From:      "Eugene M. Zheganin" <emz@norma.perm.ru>
To:        stable@freebsd.org
Cc:        freebsd-net@freebsd.org
Subject:   cannot delete on-interface route in FIB
Message-ID:  <5757F6CF.7070807@norma.perm.ru>

next in thread | raw e-mail | index | archive | help
Hi.

(first part of the message is describing why I need this, so impatient
people can proceed to th 'setfib 2 route delete' part directly).

I have a FreeBSD router connected to the ISP network, which is organized
according to the rfc3069 (you know, when all of the clients think they
have /24. but in reality they have /32 and a central router is
proxy-arping requests). This router is handling two organizations LANs,
and it has two Internet links connected, I'm using FIB 0 for the first
organization, and FIB 2 for second. To be specific:

46.146.220.88/24 - main router IP, gateway is 46.146.220.254, interface
vlan2
46.146.206.94/24 - second router IP, gateway is 46.146.206.254,
interface vlan4

Both 46.146.220.24 and .206.254 are the same ISP router.

I also have the application server on IP 46.146.220.92, which FIB 0
thinks is on-interface. Now the tricky part:

When FIB 0 need to communicate with 46.146.220.92, it does so from it's
address 46.146.220.88, since it thinks it's directly reachable. But when
requesting MAC from 46.146.220.88 it receives the ISP router MAC, so it
does so via ISP router. This part is fine.

Now the troubled part:

When FIB 2 needs to communicate with 46.146.220.92, it thinks.... yeah,
that it's directly reachable from vlan2. When it initiates the session,
it takes 46.146.220.88 as source interface and everything is fine
(again). But when the client in the LAN initiates the exchange, the
packet IP src is translated to the 46.146.206.94 address, and the route
still points to the vlan2 interface. So, network stack sends the packet
with IP src of 46.146.206.94 via vlan2, and the ISP router seems to
dislike such packets. Two workarounds come to mind:

- translating the packets from internal LAN destined to specific address
of 46.146.220.92 to appropriate address of vlan2
- deleting the on-interface route from FIB 2.

I have chosen the second (more obvious to me) but then I discovered that
I cannot do this:

 # setfib 2 route delete 46.146.220.0/24
route: writing to routing socket: Address already in use
delete net 46.146.220.0 fib 2: gateway uses the same route

why ?

Finally I added the host route to 46.146.220.92 in FIB 2 pointing to the
appropriate (46.146.206.254) gateway and got my connectivity, but I
still don't understand why the deletion of on-interface route is
impossible. After all, it's the second FIB, and I don;t understand whet
gateway the error is talking about. I tried this without having the
default gateway in FIB 2, same result.

Thanks.
Eugene.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5757F6CF.7070807>