Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get_bgp_neighbors returns "is_enabled: true" for admin down peers on JunOS #1549

Closed
1 task done
korniand opened this issue Jan 26, 2022 · 2 comments
Closed
1 task done

Comments

@korniand
Copy link

Description of Issue/Question

When running get_bgp_neighbors against a JunOS router, it returns "is_enabled: true" for peers that are actually admin down.

Did you follow the steps from https://github.com/napalm-automation/napalm#faq

(Place an x between the square brackets where applicable)

  • Yes
  • [] No

Setup

napalm version

# pip freeze | grep napalm
napalm==3.3.1

Network operating system version

> show version 
Model: mx204
Junos: 19.4R3.11

Steps to Reproduce the Issue

On a JunOS router:

> configure
# set protocols bgp group EBGP neighbor 192.168.255.1 shutdown 
# commit
# exit
> show configuration protocols bgp group EBGP neighbor 192.168.255.1 
description "Test";
authentication-key "removed"; ## SECRET-DATA
export EBGP_OUT;
peer-as 65101;
shutdown;

> show bgp summary 
Threading mode: BGP I/O
Groups: 2 Peers: 3 Down peers: 1
Table          Tot Paths  Act Paths Suppressed    History Damp State    Pending
inet.0               
                       6          6          0          0          0          0
Peer                     AS      InPkt     OutPkt    OutQ   Flaps Last Up/Dwn State|#Active/Received/Accepted/Damped...
192.168.255.1         65101      52390      57967       0       1     1:16:08 Idle  
192.168.255.252       65001     342520     379127       0       2 16w6d 22:41:07 Establ  inet.0: 3/3/3/0
192.168.255.254       65001     342519     379126       0       2 16w6d 22:41:03 Establ  inet.0: 3/3/3/0

On a Linux box:

# napalm --vendor junos --user USER --password PASS HOST call get_bgp_neighbors
{
    "global": {
        "router_id": "",
        "peers": {
            "192.168.255.1": {
                "local_as": <removed>,
                "remote_as": 65101,
                "remote_id": "",
                "is_up": false,
                "is_enabled": true,     <---- THIS IS INCORRECT
                "uptime": 3658,
                "address_family": {
                    "ipv4": {
                        "received_prefixes": -1,
                        "accepted_prefixes": -1,
                        "sent_prefixes": -1
                    },
                    "ipv6": {
                        "received_prefixes": -1,
                        "accepted_prefixes": -1,
                        "sent_prefixes": -1
                    }
                }
            },
            "192.168.255.252": {
                "local_as": <removed>,
                "remote_as": 65001,
                "remote_id": "192.168.255.252",
                "is_up": true,
                "is_enabled": true,
                "description": "",
                "uptime": 10275957,
                "address_family": {
                    "ipv4": {
                        "received_prefixes": 3,
                        "accepted_prefixes": 3,
                        "sent_prefixes": 6
                    },
                    "ipv6": {
                        "received_prefixes": -1,
                        "accepted_prefixes": -1,
                        "sent_prefixes": -1
                    }
                }
            },
            "192.168.255.254": {
                "local_as": <removed>,
                "remote_as": 65001,
                "remote_id": "192.168.255.252",
                "is_up": true,
                "is_enabled": true,
                "description": "",
                "uptime": 10275953,
                "address_family": {
                    "ipv4": {
                        "received_prefixes": 3,
                        "accepted_prefixes": 3,
                        "sent_prefixes": 6
                    },
                    "ipv6": {
                        "received_prefixes": -1,
                        "accepted_prefixes": -1,
                        "sent_prefixes": -1
                    }
                }
            }
        }
    }
}

Error Traceback

(Paste the complete traceback of the exception between quotes below)

No traceback, just incorrect returned value.
@mirceaulinic mirceaulinic self-assigned this Feb 12, 2022
mirceaulinic added a commit that referenced this issue Feb 13, 2022
To avoid an additional RPC request to check the actual configuration, we
can probably use the Shutdown flag under the BGP extended options:

```xml
<bgp-options>Preference LocalAddress AddressFamily PeerAS Multipath Refresh</bgp-options>
<bgp-options2>VpnApplyExport PeerSpecficLoopsAllowed</bgp-options2>
<bgp-options-extended>GracefulShutdownRcv Shutdown</bgp-options-extended>
```

This should be a more reliable way to check the admin status, instead of
incorrectly deducing the admin state from the operational state.
@mirceaulinic
Copy link
Member

Hey @korniand - could you confirm that #1566 resolves this issue?

@korniand
Copy link
Author

Hi @mirceaulinic
Yes, looks better now.
Thanks a lot for fixing that !

mirceaulinic added a commit that referenced this issue Feb 13, 2022
Fix #1549: Check peer admin status from the BGP options
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants