Thanks.
Could you commit the configuration with 11.1/24 & 13.1/24 as prefix-list members? 11.1/24 and 13.1/24 are host-IPs in the subnet-range, so the following error should have been seen
jcluser@vMX_NV# replace pattern 11.0/24 with 11.1/24
error: host portion is not zero (192.168.11.0/24)[edit policy-options prefix-list bgp-out]
'192.168.11.0/24'
could not rename to '192.168.11.1/24'
Also, when using prefix-lists, the prefix should exist precisely in the same way in the routing-table, and 11.1/24 will not appear as such in the routing-table.
The configuration otherwise seems to work fine for me, although we should add "from protocol ospf" in the term1 of the export-policy to be more specific.
bgp {
group external-peer {
type external;
export bgp-export;
peer-as 200;
neighbor 23.23.23.3;
}
}
prefix-list bgp-out {
192.168.11.0/24;
192.168.13.0/24;
}
policy-statement bgp-export {
term term1 {
from {
prefix-list bgp-out;
}
then accept;
}
term reject-all {
then reject;
}
}
=====================================================================================
jcluser@vMX_NV# run show route advertising-protocol bgp 23.23.23.3
inet.0: 12 destinations, 13 routes (12 active, 0 holddown, 0 hidden)
Prefix Nexthop MED Lclpref AS path
* 192.168.11.0/24 Self 1 I
* 192.168.13.0/24 Self 1 I
jcluser@vMX_NV# run show route 192.168.11.0
inet.0: 12 destinations, 13 routes (12 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
192.168.11.0/24 *[OSPF/10] 01:00:36, metric 1
> to 12.12.12.1 via ge-0/0/0.0
[edit]
jcluser@vMX_NV# run show route 192.168.13.0
inet.0: 12 destinations, 13 routes (12 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
192.168.13.0/24 *[OSPF/10] 01:00:41, metric 1
> to 12.12.12.1 via ge-0/0/0.0
------------------------------
Sheetanshu Shekhar
------------------------------
Original Message:
Sent: 08-10-2022 01:52
From: Malcolm Wood
Subject: Filtering OSPF routes into BGP
routing-options {
autonomous-system 100;
}
protocols {
bgp {
group external-peers {
type external;
export bgp-export;
peer-as 200;
neighbor 85.54.10.2;
}
}
ospf {
area 0.0.0.0 {
interface em1.0;
}
}
}
policy-options {
prefix-list bgp-out {
192.168.11.1/24;
192.168.13.1/24;
}
policy-statement bgp-export {
term term1 {
from {
prefix-list bgp-out;
}
then accept;
}
term reject-all {
then reject;
}
}
------------------------------
Malcolm Wood
Original Message:
Sent: 08-10-2022 01:43
From: Sheetanshu Shekhar
Subject: Filtering OSPF routes into BGP
Hi Malcom,
Can you please share your OSPF, BGP and policy configurations?
Regards
Sheetanshu
------------------------------
Sheetanshu Shekhar
Original Message:
Sent: 08-09-2022 19:06
From: Malcolm Wood
Subject: Filtering OSPF routes into BGP
I'm coming from a Cisco background and this is my first foray into Juniper. I have OSPF and BGP running on my juniper router and want to filter specific routes from OSPF into BGP. I have been beating my head against the wall to try to figure out how to filter the routes correctly. I can redistribute the OSPF routes with no issues, but any time I tried to apply some type of other filter to block certain routes, it seems to break it. Any help would be much appreciated.
------------------------------
Malcolm Wood
------------------------------