fedora-sysv / initscripts

📜 Scripts to bring up network interfaces and legacy utilities in Fedora.
GNU General Public License v2.0
45 stars 52 forks source link

ipvlan interface cannot recover correctly after using `ifdown bond0;ifup bond0` #383

Closed gaoxingwang closed 1 year ago

gaoxingwang commented 2 years ago

Config bonding and ipvlan interface. After ifdown bond0;ifup bond0, ipvlan interface cannot recover correctly. It seems that ifdown-eth script deletes the slave interface by echo "-${DEVICE}" > /sys/class/net/${MASTER}/bonding/slaves 2>/dev/null, and ipvlan interface will not recover from NO-CARRIER state. It does not happen when replacing ifdown bond0;ifup bond0 by ifconfig bond0 down;ifconfig bond0 up.

To reproduce the problem, perform the following steps:

Step 1: Configure bond0 and its slave by using the following file:

ifcfg-bond0 file:

DEVICE=bond0
TYPE=Bond
NM_CONTROLLED="no"
IPADDR=
NETMASK=
IPV6INIT="yes"
IPV6_AUTOCONF="no"
IPV6_DEFROUTE="no"
IPV6_FAILURE_FATAL="no"
IPV6ADDR=
MTU=1500
USERCTL=no
BOOTPROTO=none
ONBOOT="yes"
BONDING_MASTER=yes
BONDING_OPTS="mode=2 xmit_hash_policy=layer2"
LINKDELAY=1

config slave ifcfg-ens8 file:

DEVICE=ens8
BOOTPROTO="none"
NM_CONTROLLED="no"
STARTMODE="onboot"
PEERDNS="no"
ONBOOT=yes
MASTER=bond0
SLAVE=yes
MTU=1500

restart network service:

systemctl restart network

Step 2: Run the following command to add ipvlan:

ip link add link bond0 name ipvlan type ipvlan mode l2 ifconfig ipvlan up

Step 3:

ifdown bond0 ifup bond0

result: ipvlan came to be NO-CARRIER image

gaoxingwang commented 1 year ago

Recent Developments:

The problem has been fixed.

Communicated with the kernel community and confirmed that the ipvlan module is defective. The up event in the kernel does not trigger the ipvlan status update. Submit a patch to add the up notification event to modify the ipvlan status.

Link to the kernel patch: https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=57fb346cc7d0

jamacku commented 1 year ago

Thank you for update. It's good to hear, that issue has been resolved.