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

zebra: IP address is not assigned if interface is up #16344

Closed
2 tasks done
glazychev-art opened this issue Jul 4, 2024 · 12 comments
Closed
2 tasks done

zebra: IP address is not assigned if interface is up #16344

glazychev-art opened this issue Jul 4, 2024 · 12 comments
Assignees
Labels
triage Needs further investigation

Comments

@glazychev-art
Copy link

Description

Hello,
I've found a problem with zebra interface settings. IP address is not assigned after interface down and up.

Version

FRRouting 9.1.1

How to reproduce

Steps to reproduce:

  1. Run frr with frr.conf:
interface dum1
 ipv6 address fc00:1::1/64
exit
  1. ip link add name dum1 type dummy
  2. Make sure, that fc00:1::1/64 has been assigned
  3. ip link set dev dum1 down
  4. ip link set dev dum1 up
  5. fc00:1::1/64 is not assigned

Expected behavior

IP address is assigned

Actual behavior

IP address is not assigned

Additional context

I looked at zebra/interface.c. Most likely there is a problem with ZEBRA_INTERFACE_ACTIVE flag.
Is it valid to unset ZEBRA_INTERFACE_ACTIVE in case of interface down?

Checklist

  • I have searched the open issues for this bug.
  • I have not included sensitive information in this report.
@glazychev-art glazychev-art added the triage Needs further investigation label Jul 4, 2024
@Santhosh93M
Copy link

Hi,
I've tried to reproduce the issue with FRRouting 9.1.1 where the IP address is not reassigned after interface down and up, but I couldn't. I followed the mentioned steps exactly. Can anyone confirm if there are any additional steps or specific scenarios to trigger this bug?

@glazychev-art
Copy link
Author

Hi @Santhosh93M ,
thanks for your reply.

No other steps.
Are you using IPv6 to reproduce?
Does the interface has the IPv6 address after you set it down?

@Santhosh93M
Copy link

Santhosh93M commented Jul 18, 2024

Hi @glazychev-art ,

Yes, I'm using IPv6 for reproducing. When I assign an IPv6 address, it gets assigned to the interface after using the command sysctl net.ipv6.conf.all.disable_ipv6=0. However, when I bring the interface up, the IPv6 address is still assigned to that interface.

When I set the interface down, the IPv6 address is not assigned, which is expected behavior in Linux. Even without FRR, the IPv6 address vanishes when the interface is down and reappears when I set the interface up again. Please refer the image i attached below and tell me can i consider this as a frr bug ?

image

@glazychev-art
Copy link
Author

@Santhosh93M

When I set the interface down, the IPv6 address is not assigned, which is expected behavior in Linux.

You are right

When you run FRR and then create dum1 - you see that the interface has been up and IPv6 address (fc00:1::1/64) from the config has been assigned to it. Right?

Please refer the image i attached below and tell me can i consider this as a frr bug ?

If I get you right, you use the same frr.conf file:

interface dum1
 ipv6 address fc00:1::1/64
exit

But on the picture, I don't see fc00:1::1/64 for dum1 after you set it up. Isn't this a bug?

@Santhosh93M
Copy link

Hi @glazychev-art ,

When you run FRR and then create dum1 - you see that the interface has been up and IPv6 address (fc00:1::1/64) from the config has been assigned to it. Right?

Yes, I followed the steps mentioned here with FRR, but I used a different IPv6 address, which is why you can't see the address 'fc00:1::1/64'. I want to point out that this issue also occurs in Linux itself without FRR. Additionally, I would like to understand the significance of showing the IPv6 address when the interface is set to down.

@glazychev-art
Copy link
Author

@Santhosh93M
The problem is not that there is no IPv6 address when the interface is down.
The problem is that after up---down---up the IPv6 is not assigned again.

@Santhosh93M
Copy link

Hi @glazychev-art ,

The problem is not that there is no IPv6 address when the interface is down. The problem is that after up---down---up the IPv6 is not assigned again.

Yes, I understand, but what I'm trying to say is that after Up--down--Up, the IPv6 address is still assigned. It is only when the interface is down that the IPv6 address is not assigned.

@glazychev-art
Copy link
Author

@Santhosh93M
Looking at your image above, I don't see any assigned IPv6 for dum1 when interface UP.
fe80::a8ff:29ff:fe1c:5abb/64 - is a local link address, it was added by default.

@Santhosh93M
Copy link

Hi @glazychev-art ,

I would like to share my observation on this. Could you please review the following?

Adding Ipv6 address manually in Linux wihtout frr

ubuntu@ubuntuser:~$ ip addr show

26: veth2@veth3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9500 qdisc noqueue state UP group default qlen 1000
    link/ether e6:f6:e1:9b:a1:76 brd ff:ff:ff:ff:ff:ff

Assigning IPv6 Address

ubuntu@ubuntuser:~$ sudo ip -6 addr add fc00:1::1/64 dev veth2
ubuntu@ubuntuser:~$ ip addr show

26: veth2@veth3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9500 qdisc noqueue state UP group default qlen 1000
    link/ether e6:f6:e1:9b:a1:76 brd ff:ff:ff:ff:ff:ff
    inet6 fc00:1::1/64 scope global
       valid_lft forever preferred_lft forever
    inet6 fe80::e4f6:e1ff:fe9b:a176/64 scope link
       valid_lft forever preferred_lft forever

Bringing Interface Down

ubuntu@ubuntuser:~$ sudo ip link set dev veth2 down
ubuntu@ubuntuser:~$ ip addr show

26: veth2@veth3: <BROADCAST,MULTICAST> mtu 9500 qdisc noqueue state DOWN group default qlen 1000
    link/ether e6:f6:e1:9b:a1:76 brd ff:ff:ff:ff:ff:ff

Bringing Interface Up

ubuntu@ubuntuser:~$ sudo ip link set dev veth2 up
ubuntu@ubuntuser:~$ ip addr show

26: veth2@veth3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9500 qdisc noqueue state UP group default qlen 1000
    link/ether e6:f6:e1:9b:a1:76 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::e4f6:e1ff:fe9b:a176/64 scope link
       valid_lft forever preferred_lft forever

Note: When we add an IPv6 address to a Linux system without configuring frr , the IPv6 address disappears after toggling the interface.

FRR with Write Memory Command


frr.conf :
interface dum1
 ipv6 address fc00:1::1/64
write memory
exit

Adding Dummy Interface and Checking Address

frr@50f1f23a4282:/$ sudo ip link add name dum1 type dummy
frr@50f1f23a4282:/$ ip addr

2: dum1: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default qlen 1000
    link/ether a2:a6:f1:37:28:81 brd ff:ff:ff:ff:ff:ff
    inet6 fc00:1::1/64 scope global
       valid_lft forever preferred_lft forever
    inet6 fe80::a0a6:f1ff:fe37:2881/64 scope link
       valid_lft forever preferred_lft forever

Toggling Dummy Interface

frr@1237b3628226:/$ sudo ip link set dev dum1 down
frr@1237b3628226:/$ ip addr

2: dum1: <BROADCAST,NOARP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
    link/ether a2:a6:f1:37:28:81 brd ff:ff:ff:ff:ff:ff

frr@1237b3628226:/$ sudo ip link set dev dum1 up
frr@1237b3628226:/$ ip addr

2: dum1: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default qlen 1000
    link/ether a2:a6:f1:37:28:81 brd ff:ff:ff:ff:ff:ff
    inet6 fc00:1::1/64 scope global
       valid_lft forever preferred_lft forever
    inet6 fe80::a0a6:f1ff:fe37:2881/64 scope link
       valid_lft forever preferred_lft forever

Note: When we configure FRR to add an IPv6 address, the address remains persistent even after toggling the interface, unlike manually adding the IPv6 address without configuring frr.

FRR Without Write Memory Command

frr.conf :
interface dum1
 ipv6 address fc00:1::1/64
exit

Adding Dummy Interface and Checking Address

frr@50f1f23a4282:/$ sudo ip link add name dum1 type dummy
frr@50f1f23a4282:/$ ip addr

2: dum1: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default qlen 1000
    link/ether 56:5e:70:cb:0c:b5 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::545e:70ff:fecb:cb5/64 scope link
       valid_lft forever preferred_lft forever

frr@e0a4d5d4d566:/$ sudo ip link set dev dum1 down
frr@e0a4d5d4d566:/$ ip addr

2: dum1: <BROADCAST,NOARP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
    link/ether 56:5e:70:cb:0c:b5 brd ff:ff:ff:ff:ff:ff

frr@e0a4d5d4d566:/$ sudo ip link set dev dum1 up
frr@e0a4d5d4d566:/$ ip addr

2: dum1: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default qlen 1000
    link/ether 56:5e:70:cb:0c:b5 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::545e:70ff:fecb:cb5/64 scope link
       valid_lft forever preferred_lft forever

Note: The IPv6 address is not retained if we don’t use the write memory command, even after creating a dummy interface and toggling it.

@Santhosh93M
Copy link

Hi @glazychev-art ,

The IPv6 address assignment issue is correctly working in the current FRR version even without the write memory command. The problem occurs only in FRR Routing 9.1.1, where the IPv6 address is not getting assigned after toggling.

Can you please verify if this issue has been resolved now, or guide me on how to address it?

@glazychev-art
Copy link
Author

@Santhosh93M
Thank you!
You are right, I've checked it on the current stable/10.0 and it works as expected.
Is it possible to find this code change?

@glazychev-art
Copy link
Author

I guess, it was this PR - #15055

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

3 participants