Should note that I can resolve this by filtering the incoming prefixes with:
deny from group "peering ASxxxx" prefix 172.20.104.0/22 prefixlen = 22

Which I'm doing right now to workaround the problem and being able to continue working but I don't understand why openbgpd would overwrite directly connected routes.

If somebody could clear that up for me I would be super grateful :)

Best regards
Tobias

On 07/30/2018 04:09 PM, Tobias Urdin wrote:
Hello,

I have a setup where we connect a OSPF area with a edge router, this
edge router then has a BGP peer to my router
where it redistributes all OSPF routes into the BGP feed to my router.

My router is running FreeBSD 11.1 with openbgpd

root@myrouter:~ # uname -a
FreeBSD dr20-1-sto1 11.1-RELEASE FreeBSD 11.1-RELEASE #0 r321309: Fri
Jul 21 02:08:28 UTC 2017
r...@releng2.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC  amd64

root@myrouter:~ # pkg info openbgpd
openbgpd-5.2.20121209_2
Name           : openbgpd
Version        : 5.2.20121209_2

The thing here is that my router has layer 2 access directly to one of
the networks that the edge router BGP announces to my router
(172.20.104.0/22).
When my FreeBSD machine boots it will install a directly connected route
for 172.20.104.0/22 in my routing table but as soon as openbgpd starts
it will
install a 172.20.104.0/22 route with the nexthop of the edge router instead.

How can I prevent openbgpd from overwriting the directly connected route?
Directly connected networks should never be overwritten by a routing
protocol but I suspect this is because of the redistribute.

I've tried messing with metrics, but maybe I to create a rtable and mess
around with that?
Output of some info is below.

Best regards
Tobias

root@myrouter:~ # bgpctl show fib connected | grep 104
*C      48 172.20.104.0/22      link#10

root@myrouter:~ # route get 172.20.104.100
     route to: 172.20.104.100
destination: 172.20.104.0
         mask: 255.255.252.0
      gateway: edgerouter
          fib: 0
    interface: vlan10
        flags: <UP,GATEWAY,DONE,PROTO1,PINNED>
   recvpipe  sendpipe  ssthresh  rtt,msec    mtu        weight expire
         0         0         0         0      1500         1         0

root@myrouter:~ # ifconfig vlan10
vlan10: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST>
metric 0 mtu 1500
options=600703<RXCSUM,TXCSUM,TSO4,TSO6,LRO,RXCSUM_IPV6,TXCSUM_IPV6>
          ether x
          inet 172.20.107.253 netmask 0xfffffc00 broadcast 172.20.107.255
          inet 172.20.107.254 netmask 0xfffffc00 broadcast 172.20.107.255
vhid 2
          nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
          media: Ethernet autoselect (10Gbase-Twinax
<full-duplex,rxpause,txpause>)
          status: active
          vlan: 10 vlanpcp: 0 parent interface: ix1
          carp: MASTER vhid 2 advbase 1 advskew 10
          groups: vlan

root@myrouter:~ # cat /etc/rc.conf
...snip..
ifconfig_vlan10="inet 172.20.107.253 netmask 255.255.252.0 vlan 10
vlandev ix1"
ifconfig_vlan10_alias0="inet vhid 2 advskew 100 pass test123 alias
172.20.107.254/22"

root@myrouter:~ # cat /usr/local/etc/bgpd.conf
...snip...
group "peering ASxxxx" {
    remote-as xxxx
    softreconfig in yes

    neighbor edgerouter {
      announce self
      descr "AS xxxx edgerouter"
      local-address xxxx
      depend on <outside int>
    }
}
...snip...
_______________________________________________
freebsd-net@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "freebsd-net-unsubscr...@freebsd.org"


_______________________________________________
freebsd-net@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "freebsd-net-unsubscr...@freebsd.org"

Reply via email to