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

ip of deleted GRE interface remains in running config, removing it returns an error #15081

Closed
2 tasks done
ThomasOberhammer opened this issue Jan 3, 2024 · 4 comments
Closed
2 tasks done
Labels
triage Needs further investigation

Comments

@ThomasOberhammer
Copy link

ThomasOberhammer commented Jan 3, 2024

Describe the bug

When deleting a GRE interfaces using the ip command, the IP of the interface will still be shown in the running configuration. Removing it via the vtysh interface results in an error.

Is this a bug, or does the IP have to be removed in a different way?

  • Did you check if this is a duplicate issue?
  • Did you test it on the latest FRRouting/frr master branch?

To Reproduce

# starting point: system with GRE interface
[netb-sg024-1:~]# ip addr show dev t4_21505
169: t4_21505@NONE: <POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1700 qdisc noqueue state UNKNOWN group default qlen 1000
    link/gre 200.24.1.2 peer 200.13.1.2
    inet 213.156.234.48 peer 213.156.234.41/32 scope global t4_21505
       valid_lft forever preferred_lft forever

[netb-sg024-1:~]# vtysh -c 'sh run' | grep t4_21505 -A 1
interface t4_21505
 ip address 213.156.234.48 peer 213.156.234.41/32

# remove GRE interface
[netb-sg024-1:~]# ip addr flush dev t4_21505
[netb-sg024-1:~]# ip tunnel del t4_21505

# IP is still in running config
[netb-sg024-1:~]# vtysh -c 'sh run' | grep t4_21505 -A 1
interface t4_21505
 ip address 213.156.234.48 peer 213.156.234.41/32

# removing the IP does exit with a non-0 value
[netb-sg024-1:~]# vtysh -c 'configure' -c 'interface t4_21505' -c 'no ip address 213.156.234.48 peer 213.156.234.41/32'; echo $?
1

Expected behavior
IP should be removed from the running configuration without returning an error.

Versions

  • OS Version: custom
  • Kernel: Linux 5.4.238
  • FRR Version: 8.5.3

Additional context
The actual problem is that this breaks the reload script. The command itself works and removes the IP from the running config, but this is still seen as an error.

# remove interface from system and frr config
[netb-sg024-1:~]# ip tunnel del t4_21505
[netb-sg024-1:~]# vim /opt/OSAGfrrouting/etc/zebra.conf # remove the configuration related to the interface

!interface t4_21505
!  ip address 213.156.234.48 peer 213.156.234.41/32

# run the reload script
[netb-sg024-1:~]# /opt/OSAGfrrouting/sbin/frr-reload.py --reload --confdir /opt/OSAGfrrouting/etc --daemon zebra /opt/OSAGfrrouting/etc/zebra.conf --debug
"interface t4_21505 --  no" we failed to remove this command
2024-01-03 11:31:38,136 DEBUG: Running Frr Config (Pass #0)
interface t4_21505
ip address 213.156.234.48 peer 213.156.234.41/32
exit

2024-01-03 11:31:38,233  INFO: Failed to execute interface t4_21505  no ip address 213.156.234.48 peer 213.156.234.41/32
2024-01-03 11:31:38,331  INFO: Failed to execute interface t4_21505  no ip address 213.156.234.48 peer
2024-01-03 11:31:38,408  INFO: Failed to execute interface t4_21505  no ip address 213.156.234.48
2024-01-03 11:31:38,488  INFO: Failed to execute interface t4_21505  no ip address
2024-01-03 11:31:38,565  INFO: Failed to execute interface t4_21505  no ip
2024-01-03 11:31:38,638  INFO: Failed to execute interface t4_21505  no
2024-01-03 11:31:38,638 ERROR: "interface t4_21505 --  no" we failed to remove this command
2024-01-03 11:31:38,638 ERROR:

2024-01-03 11:31:38,720 DEBUG: Running Frr Config (Pass #1)
<no more interface t4_21505>
@ThomasOberhammer ThomasOberhammer added the triage Needs further investigation label Jan 3, 2024
@ThomasOberhammer
Copy link
Author

I have been looking into this using gdb and figured that the non-zero exit code originates from this function which will return 13 (CMD_WARNING_CONFIG_FAILED):
https://github.com/FRRouting/frr/blob/frr-8.5.3/vtysh/vtysh.c#L263

The error itself is most likely coming from here: https://github.com/FRRouting/frr/blob/frr-8.5.3/zebra/interface.c#L4179

@ThomasOberhammer
Copy link
Author

We tested this also with version 9.1, the behaviour is still the same.

Copy link

This issue is stale because it has been open 180 days with no activity. Comment or remove the autoclose label in order to avoid having this issue closed.

@frrbot
Copy link

frrbot bot commented Jul 11, 2024

This issue will be automatically closed in the specified period unless there is further activity.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage Needs further investigation
Projects
None yet
Development

No branches or pull requests

1 participant