Description

This article describes the reason for getting the error message Invalid loop count configured while committing a configuration.

Symptoms

In BGP when configuring the local-as loops < count > , the message error: configuration check-out failed is displayed and you cannot commit the configuration.

set routing-instances VPN-A instance-type vrf
set routing-instances VPN-A route-distinguisher 150.1.1.1:100
set routing-instances VPN-A vrf-target target:100:100
set routing-instances VPN-A protocols bgp group test-1 neighbor 192.168.1.1 peer-as 20909
set routing-instances VPN-A protocols bgp group test-1 neighbor 192.168.1.1 local-as 64512
set routing-instances VPN-A protocols bgp group test-1 neighbor 192.168.1.1 local-as loops 2
set routing-instances VPN-B instance-type vrf
set routing-instances VPN-B route-distinguisher 150.1.1.1:200
set routing-instances VPN-B vrf-target target:200:200
set routing-instances VPN-B protocols bgp group test-2 neighbor 192.168.1.1 peer-as 20101
set routing-instances VPN-B protocols bgp group test-2 neighbor 192.168.1.1 local-as 64512
*** local-as loops not specified -- defaults to 1 ***

lab@MX480# commit check 
warning: Could not connect to re0 : No route to host
warning: Cannot connect to other RE, ignoring it
[edit routing-instances VPN-B protocols bgp group test-2 neighbor 192.168.1.1]
  'local-as'
    Invalid loop count configured
error: configuration check-out failed

[edit]
lab@MX480# show routing-instances | display set                    
set routing-instances VPN-A instance-type vrf
set routing-instances VPN-A route-distinguisher 150.1.1.1:100
set routing-instances VPN-A vrf-target target:100:100
set routing-instances VPN-A protocols bgp group test-1 neighbor 192.168.1.1 peer-as 20909
set routing-instances VPN-A protocols bgp group test-1 neighbor 192.168.1.1 local-as 64512
set routing-instances VPN-A protocols bgp group test-1 neighbor 192.168.1.1 local-as loops 2
set routing-instances VPN-B instance-type vrf
set routing-instances VPN-B route-distinguisher 150.1.1.1:200
set routing-instances VPN-B vrf-target target:200:200
set routing-instances VPN-B protocols bgp group test-2 neighbor 192.168.1.1 peer-as 20101
set routing-instances VPN-B protocols bgp group test-2 neighbor 192.168.1.1 local-as 64512
set routing-instances VPN-B protocols bgp group test-2 neighbor 192.168.1.1 local-as loops 3

[edit]
lab@MX480# commit check 

[edit routing-instances VPN-B protocols bgp group test-2 neighbor 192.168.1.1]
  'local-as'
    Invalid loop count configured
error: configuration check-out failed

[edit]
lab@MX480#

Solution

This is expected behavior in BGP because once you set the loops count for an AS number, it must be the same loop count for that AS number, wherever it is set (whether in the same routing instance or different routing instances).

This rule applies to the AS number in global routing-options as well.

Once you configure the same loop count for the AS number 64512, you can commit this configuration.

set routing-instances VPN-A instance-type vrf
set routing-instances VPN-A route-distinguisher 150.1.1.1:100
set routing-instances VPN-A vrf-target target:100:100
set routing-instances VPN-A protocols bgp group test-1 neighbor 192.168.1.1 peer-as 20909
set routing-instances VPN-A protocols bgp group test-1 neighbor 192.168.1.1 local-as 64512
set routing-instances VPN-A protocols bgp group test-1 neighbor 192.168.1.1 local-as loops 2
set routing-instances VPN-B instance-type vrf
set routing-instances VPN-B route-distinguisher 150.1.1.1:200
set routing-instances VPN-B vrf-target target:200:200
set routing-instances VPN-B protocols bgp group test-2 neighbor 192.168.1.1 peer-as 20101
set routing-instances VPN-B protocols bgp group test-2 neighbor 192.168.1.1 local-as 64512
set routing-instances VPN-B protocols bgp group test-2 neighbor 192.168.1.1 local-as loops 2
 
[edit]
lab@MX480# commit check 

configuration check succeeds 

For additional information, check loops (Autonomous System)

Former Article Id

BGP "Invalid loop count configured" message during commit

Modification History

2022-06-21: Update IP addresses with a private one as per RFC 1918

Related Information

loops (Autonomous System)