osrg / gobgp

BGP implemented in the Go Programming Language
https://osrg.github.io/gobgp/
Apache License 2.0
3.66k stars 699 forks source link

Replace-peer-as not working #2853

Open RajdeepMondal opened 3 weeks ago

RajdeepMondal commented 3 weeks ago

I have three routers R1, R2 and R3 connected in series. R1 runs ExaBGP while R2 and R3 both run GoBGP v3.13.0.

R1 is in AS 64512. R2 is in the confederation AS 1 and sub AS 256 R3 is in AS 256. R1's ExaBGP configuration is as follows:

process announce-routes {
   run python exabgp/example.py;
   encoder json;
}

neighbor 3.0.0.2 {
   router-id 3.0.0.3;
   local-address 3.0.0.3;
   local-as 64512;
   peer-as 768;

   api {
       processes [announce-routes];
   }
}

Here are the configurations for R2 and R3. R2:

global:
  config:
    router-id: 192.168.255.1
    as: 768
neighbors:
- config:
    neighbor-address: 3.0.0.3
    peer-as: 64512
  transport:
    config:
      local-address: 3.0.0.2
  afi-safis:
  - config:
      afi-safi-name: ipv4-unicast
- config:
    neighbor-address: 4.0.0.3
    peer-as: 512
    remove-private-as: all
  transport:
    config:
      local-address: 4.0.0.2
  afi-safis:
  - config:
      afi-safi-name: ipv4-unicast
  as-path-options:
    config:
      replace-peer-as: true

R3:

global:
  config:
    router-id: 192.168.255.2
    as: 512
neighbors:
- config:
    neighbor-address: 4.0.0.2
    peer-as: 768
  transport:
    config:
      local-address: 4.0.0.3
  afi-safis:
  - config:
      afi-safi-name: ipv4-unicast

I advertise the route 100.0.0.0/8 next-hop self as-path [1 3 4 65412 10] from R1 to R2. The route installed in R2 has the AS path 1 3 4 65412 10 as expected. But R3 receives this route with the AS path 768 1 3 4 10.

Expected behavior: Since I have set the replace-peer-as flag to True in R2's configuration, R2 should remove the AS number 65412 from the route's AS path and replace it with 768. Thus R3 should receive a route with the AS path 768 1 3 4 768 10.