Hello,
According to the meaning of the word we can know:
display bgp routing-table peer x.x.x.x received-routes means the routes received from peer x.x.x.x.
display bgp routing-table peer x.x.x.x received-routes active means routes which received from peer x.x.x.x and be selected as the best route.
Note: This 'active' means the route is selected as the best route in BGP routing-table, not means the route can be active state in IP routing-table.
display bgp routing-table peer x.x.x.x accepted-routes means the routes which can match the inbound filter of peer x.x.x.x. The filter include all the configuration which could filter the routes, such as route-policy, ip-prefix, filter-policy, as-path-filter, etc.
We know the routes which cannot match the inbound filter will be dropped, acturally we cannot see them in routing-table. So, what's the difference between 'received routes' and 'accepted-routes".
The difference will be shown when the peer configure 'peer x.x.x.x keep-all-routes'.
Firstly, introduce the function of 'keep-all-routes'.
In the early stage, BGP does not support refresh capability. If change the inbound filter and want remote peer re-advertise routes again, there is no way to do it but down / up the peer.
But, rebuild the peer session will cause service interruption. So, the peer can use 'keep-all-routes'.
After configure 'peer x.x.x.x keep-all-routes', when all the received routes from the peer will be reserved, no matter the routes can match the filter or not. The routes which cannot match the filter will not have 'valid' sign.
When modify the inbound filter, BGP can re-filter all the reserved routes, need not request remote peer.
In this condition, when the peer configures 'keep-all-routes', 'received-routes' means all the received routes, 'accepted-routes' just means the routes which can match the inbound filter.
For example,
peer 12.1.1.2 configured keep-all-routes.
There are 5 routes received from peer 12.1.1.2.
Among them, 123.1.1.1/32, 123.1.1.2/32, 123.1.1.3/32 can not match the inbound filter, they do not have 'valid' sign (*).
123.1.1.4/32 and 123.1.1.5/32 can match the inbound filter.
<Huawei>display bgp routing-table
BGP Local router ID is 1.1.1.1
Status codes: * - valid, > - best, d - damped,
h - history, i - internal, s - suppressed, S - Stale
Origin : i - IGP, e - EGP, ? - incomplete
Total Number of Routes: 7
Network NextHop MED LocPrf PrefVal Path/Ogn
*>i 123.1.1.1/32 13.1.1.3 0 100 0 ?
i 12.1.1.2 0 100 0 ?
i 123.1.1.2/32 12.1.1.2 0 100 0 ?
i 123.1.1.3/32 12.1.1.2 0 100 0 123i
*>i 123.1.1.4/32 12.1.1.2 0 100 0 ?
*>i 123.1.1.5/32 13.1.1.3 0 110 0 i
* i 12.1.1.2 0 100 0 ?
Check 'display bgp routing-table peer 12.1.1.2 received-routes', all 5 routes can be seen.
<Huawei>display bgp rou peer 12.1.1.2 received-routes
BGP Local router ID is 1.1.1.1
Status codes: * - valid, > - best, d - damped,
h - history, i - internal, s - suppressed, S - Stale
Origin : i - IGP, e - EGP, ? - incomplete
Total Number of Routes: 5
Network NextHop MED LocPrf PrefVal Path/Ogn
i 123.1.1.1/32 12.1.1.2 0 100 0 ?
i 123.1.1.2/32 12.1.1.2 0 100 0 ?
i 123.1.1.3/32 12.1.1.2 0 100 0 123i
*>i 123.1.1.4/32 12.1.1.2 0 100 0 ?
* i 123.1.1.5/32 12.1.1.2 0 100 0 ?
Check 'display bgp routing-table peer 12.1.1.2 accepted-routes', it can show only the 2 routes which can match the filter.
<Huawei>display bgp rou peer 12.1.1.2 accepted-routes
BGP Local router ID is 1.1.1.1
Status codes: * - valid, > - best, d - damped,
h - history, i - internal, s - suppressed, S - Stale
Origin : i - IGP, e - EGP, ? - incomplete
Total Number of Routes: 2
Network NextHop MED LocPrf PrefVal Path/Ogn
*>i 123.1.1.4/32 12.1.1.2 0 100 0 ?
* i 123.1.1.5/32 12.1.1.2 0 100 0 ?
Check 'display bgp routing-table peer 12.1.1.2 received-routes active'.
Because another route 123.1.1.5/32 from peer 13.1.1.3 is the best route, route 123.1.1.5/32 from peer 12.1.1.2 is not the best route, so cannot be seen in 'received-routes active' .
<Huawei>display bgp rou peer 12.1.1.2 received-routes active
BGP Local router ID is 1.1.1.1
Status codes: * - valid, > - best, d - damped,
h - history, i - internal, s - suppressed, S - Stale
Origin : i - IGP, e - EGP, ? - incomplete
Total Number of Routes: 1
Network NextHop MED LocPrf PrefVal Path/Ogn
*>i 123.1.1.4/32 12.1.1.2 0 100 0 ?