gobgp
gobgp copied to clipboard
RTC with eBGP doesn't filter routes
Trying to apply RT constrained filtering (RFC4684) with eBGP but it appears the filtering doesn't work.
Here is the topology:
r1(as65001) --- r0(as65000) --- r2(as65002)
r0 config:
global:
config:
as: 65000
router-id: 10.10.10.101
neighbors:
- config:
neighbor-address: 10.10.10.11
peer-as: 65001
afi-safis:
- config:
afi-safi-name: l3vpn-ipv4-unicast
enabled: true
- config:
afi-safi-name: rtc
enabled: true
- config:
neighbor-address: 10.10.10.12
peer-as: 65002
afi-safis:
- config:
afi-safi-name: l3vpn-ipv4-unicast
enabled: true
- config:
afi-safi-name: rtc
enabled: true
r1 config:
global:
config:
as: 65001
router-id: 10.10.10.11
neighbors:
- afi-safis:
- config:
afi-safi-name: l3vpn-ipv4-unicast
enabled: true
- config:
afi-safi-name: rtc
enabled: true
config:
neighbor-address: 10.10.10.101
peer-as: 65000
run following commands on r1 to advertise:
gobgp vrf add 1 id 1 rd 111:111 rt both 111:111
gobgp vrf add 2 id 2 rd 222:222 rt both 222:222
gobgp vrf 1 rib add 11.11.11.0/24
gobgp vrf 2 rib add 21.21.21.0/24
r2 config:
global:
config:
as: 65002
router-id: 10.10.10.12
neighbors:
- afi-safis:
- config:
afi-safi-name: l3vpn-ipv4-unicast
enabled: true
- config:
afi-safi-name: rtc
enabled: true
config:
neighbor-address: 10.10.10.101
peer-as: 65000
run following commands on r2 to advertise:
gobgp vrf add 2 id 2 rd 222:222 rt both 222:222
gobgp vrf add 3 id 3 rd 333:333 rt both 333:333
gobgp vrf 2 rib add 22.22.22.0/24
gobgp vrf 3 rib add 32.32.32.0/24
Don't expect RT 333:333 to be shown on r1, but it shows:
$ gobgp global rib -a vpnv4
Network Labels Next Hop AS_PATH Age Attrs
*> 111:111:11.11.11.0/24 [0] 0.0.0.0 00:54:37 [{Origin: ?} {Extcomms: [111:111]}]
*> 222:222:21.21.21.0/24 [0] 0.0.0.0 00:54:37 [{Origin: ?} {Extcomms: [222:222]}]
*> 222:222:22.22.22.0/24 [0] 10.10.10.101 65000 65002 00:54:30 [{Origin: ?} {Extcomms: [222:222]}]
*> 333:333:32.32.32.0/24 [0] 10.10.10.101 65000 65002 00:54:30 [{Origin: ?} {Extcomms: [333:333]}]
$ gobgp global rib -a rtc
Network Next Hop AS_PATH Age Attrs
*> 65001:111:111 0.0.0.0 00:57:05 [{Origin: i}]
*> 65001:222:222 0.0.0.0 00:57:05 [{Origin: i}]
*> 65002:222:222 10.10.10.101 65000 65002 00:56:58 [{Origin: i}]
*> 65002:333:333 10.10.10.101 65000 65002 00:56:58 [{Origin: i}]
routers have correct capabilities advertised:
$ gobgp neighbor 10.10.10.11
BGP neighbor is 10.10.10.11, remote AS 65001
BGP version 4, remote router ID 10.10.10.11
BGP state = established, up for 00:57:54
BGP OutQ = 0, Flops = 0
Hold time is 90, keepalive interval is 30 seconds
Configured hold time is 90, keepalive interval is 30 seconds
Neighbor capabilities:
multiprotocol:
l3vpn-ipv4-unicast: advertised and received
rtc: advertised and received
route-refresh: advertised and received
4-octet-as: advertised and received
Message statistics:
Sent Rcvd
Opens: 1 1
Notifications: 0 0
Updates: 4 5
Keepalives: 116 116
Route Refresh: 0 0
Discarded: 0 0
Total: 121 122
Route statistics:
Advertised: 4
Received: 4
Accepted: 4
$ gobgp neighbor 10.10.10.12
BGP neighbor is 10.10.10.12, remote AS 65002
BGP version 4, remote router ID 10.10.10.12
BGP state = established, up for 00:57:54
BGP OutQ = 0, Flops = 0
Hold time is 90, keepalive interval is 30 seconds
Configured hold time is 90, keepalive interval is 30 seconds
Neighbor capabilities:
multiprotocol:
l3vpn-ipv4-unicast: advertised and received
rtc: advertised and received
route-refresh: advertised and received
4-octet-as: advertised and received
Message statistics:
Sent Rcvd
Opens: 1 1
Notifications: 0 0
Updates: 5 4
Keepalives: 116 116
Route Refresh: 0 0
Discarded: 0 0
Total: 122 121
Route statistics:
Advertised: 4
Received: 4
Accepted: 4