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

ospf: all router neighbors reported as neighbor on every interface #635

Closed
jovatn opened this issue Sep 16, 2024 · 0 comments · Fixed by #650
Closed

ospf: all router neighbors reported as neighbor on every interface #635

jovatn opened this issue Sep 16, 2024 · 0 comments · Fixed by #650
Assignees
Labels
bug Something isn't working triage Pending investigation & classification (CCB)

Comments

@jovatn
Copy link
Contributor

jovatn commented Sep 16, 2024

Current Behavior

Tested on Infix 24.06.0 in GNS3, but bug ought to exist in 24.08.0 as well.

By reading out interface neighbors from ietf-ospf.yang, you should be able to list neighbor(s) per interface

    container neighbors {
      config false;
      description
        "All neighbors for the interface.";
      list neighbor {
        key "neighbor-router-id";
        description
          "List of interface OSPF neighbors.";
        leaf neighbor-router-id {
          type rt-types:router-id;
          description
            "Neighbor's Router ID.";
        }
        uses neighbor-state;
      }
    }

However, infix lists all neighbors of the device as neighbors on every interface (even the loopback).

Look at router "r6" in the picture below.
Screenshot from 2024-09-16 09-13-00

On its interface "eth0" it should list r4 as neighbor, which happens to have router-id 10.1.1.4, but it lists r3 (10.1.1.3) and r5 (10.1.1.5) as well. And it does so on every OSPF interface (eth0, eth1, eth2 and lo).

admin@R6:~$ sysrepocfg -X -d operational -fjson -x "/ietf-routing:routing/ietf-routing:control-plane-protocols"
{
  "ietf-routing:routing": {
    "control-plane-protocols": {
      "control-plane-protocol": [
        {
          "type": "ietf-ospf:ospfv2",
          "name": "default",
          "ietf-ospf:ospf": {
            "address-family": "ipv4",
            "router-id": "10.1.1.6",
...
            "areas": {
              "area": [
                {
                  "area-id": "0.0.0.0",
                  "area-type": "normal-area",
                  "interfaces": {
                    "interface": [
                      {
                        "name": "eth0",
                        "interface-type": "point-to-point",
                        "passive": false,
                        "enabled": true,
                        "state": "point-to-point",
                        "neighbors": {
                          "neighbor": [
                            {
                              "neighbor-router-id": "10.1.1.4",
                              "address": "10.1.1.4",
                              "dr-router-id": "0.0.0.0",
                              "bdr-router-id": "0.0.0.0",
                              "state": "full",
                              "dead-timer": 35695
                            },
                            {
                              "neighbor-router-id": "10.1.1.3",
                              "address": "10.1.1.3",
                              "dr-router-id": "0.0.0.0",
                              "bdr-router-id": "0.0.0.0",
                              "state": "full",
                              "dead-timer": 35138
                            },
                            {
                              "neighbor-router-id": "10.1.1.5",
                              "address": "10.1.1.5",
                              "dr-router-id": "0.0.0.0",
                              "bdr-router-id": "0.0.0.0",
                              "state": "full",
                              "dead-timer": 36525
                            }
                          ]
                        }
                      },
                      {
                        "name": "eth1",
                        "interface-type": "point-to-point",
  ...

Compare this with CLI status output

admin@R6:/> show ospf neighbor 

Neighbor ID     Pri State           Up Time         Dead Time Address         Interface                        RXmtL RqstL DBsmL
10.1.1.4          1 Full/-          42m49s            30.010s 10.1.1.4        eth0:10.1.1.6                        0     0     0
10.1.1.3          1 Full/-          42m50s            39.453s 10.1.1.3        eth1:10.1.1.6                        0     0     0
10.1.1.5          1 Full/-          42m49s            30.840s 10.1.1.5        eth2:10.1.1.6                        0     0     0

admin@R6:/> 

Expected Behavior

admin@R6:~$ sysrepocfg -X -d operational -fjson -x "/ietf-routing:routing/ietf-routing:control-plane-protocols"
{
  "ietf-routing:routing": {
    "control-plane-protocols": {
      "control-plane-protocol": [
        {
          "type": "ietf-ospf:ospfv2",
          "name": "default",
          "ietf-ospf:ospf": {
            "address-family": "ipv4",
            "router-id": "10.1.1.6",
...
            "areas": {
              "area": [
                {
                  "area-id": "0.0.0.0",
                  "area-type": "normal-area",
                  "interfaces": {
                    "interface": [
                      {
                        "name": "eth0",
                        "interface-type": "point-to-point",
                        "passive": false,
                        "enabled": true,
                        "state": "point-to-point",
                        "neighbors": {
                          "neighbor": [
                            {
                              "neighbor-router-id": "10.1.1.4",
                              "address": "10.1.1.4",
                              "dr-router-id": "0.0.0.0",
                              "bdr-router-id": "0.0.0.0",
                              "state": "full",
                              "dead-timer": 35695
                          }
                          ]
                        }
                      },
                      {
                        "name": "eth1",
                        "interface-type": "point-to-point",
  ...

Steps To Reproduce

  1. Setup Infix 24.06.0 on (at least) three devices in GNS3 and connect them (R1 <=> R2 <=> R3)
  2. Setup OSPF, preferably by point-to-point links
  3. Check in CLI that they get ospf connectivity ('show ospf neighbor') on R2, and verify that R2 has a neighbor on two different interfaces.
  4. Use sysrepocfg to extract yang-model of operational state on R2, sysrepocfg -X -d operational -fjson -x "/ietf-routing:routing/ietf-routing:control-plane-protocols
  5. You should see that " lists R1 and R3 as neighbors on both sides.
@jovatn jovatn added bug Something isn't working triage Pending investigation & classification (CCB) labels Sep 16, 2024
@troglobit troglobit changed the title ospf: all router neighbors reported as neighbor on every interface (yang) ospf: all router neighbors reported as neighbor on every interface Sep 16, 2024
@mattiaswal mattiaswal self-assigned this Sep 24, 2024
@mattiaswal mattiaswal mentioned this issue Sep 24, 2024
13 tasks
mattiaswal added a commit that referenced this issue Sep 24, 2024
mattiaswal added a commit that referenced this issue Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage Pending investigation & classification (CCB)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants