0

On my network infrastructure, an Arista switch is the core switch and a pfsense server the gateway. BGP is used to advertise routes for all the internal networks. On Arista switch, I see the BGP configured like that:

router bgp 65009
   vrf XXXXX
      local-as 65008
      router-id 172.X.X.1
      neighbor 172.X.X.2 remote-as 65007
      neighbor 172.X.X.2 maximum-routes 12000
      redistribute connected

My question is "Why may local-as have been configured without neighbor 172.X.X.1? Is there any functional difference if we don't add the neighbor command?" I would expect to see like that:

router bgp 65009
       vrf XXXXX
          neighbor 172.X.X.2 local-as 65008
          router-id 172.X.X.1
          neighbor 172.X.X.2 remote-as 65007
          neighbor 172.X.X.2 maximum-routes 12000
          redistribute connected
  • It's not very clear what exactly you're asking here, can you please try to improve your question? – Teun Vink Nov 19 '19 at 8:44
  • @TeunVink I added a section of what I would expect to see as a configuration regarding BGP. I hope this helps. – user20092013 Nov 19 '19 at 8:57
0

Both options you have mentioned are valid.

Setting local-as per neighbor is just for that reason, keeping each neighbor explicitly configured, in case you had multiple neighbors with different local AS numbers.

neighbor 172.X.X.2 local-as 65008

Setting local-as without an explicit neighbor statement makes more sense when there is more than one neighbor. If you had many neighbors, you only have to specify local-as once, rather than on every single neighbor. This can make configuration a bit easier to maintain as the number of neighbors grow. A potential example of this is in an EBGP underlay in a datacenter.

local-as 65008
neighbor 172.X.X.2 remote-as 65007
neighbor 172.X.X.2 remote-as 65009
neighbor 172.X.X.2 remote-as 65010
neighbor 172.X.X.2 remote-as 65011
neighbor 172.X.X.2 remote-as 65012
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.