我尝试将两个接口连接成一个,创建了bond0,结果发现它不能令人满意。然后,我恢复对/etc/network/interfaces所做的所有更改并运行systemctl restart networking.service,但是键接口仍然存在(显示在ifconfig和ip link命令中),我不得不运行ip link set bond0 down或ifconfig bond0 down来强制将其踢出。如何在不重新启动服务器的情况下完全删除此接口?
我在演Debian Buster。该文件最初是这样的:
auto eno1
iface eno1 inet static
# regular network settings like address, netmask, gateway etc.
auto eno2
iface eno2 inet static
# regular network settings like address, netmask, gateway etc.我将两个接口转换成一个键,将其转换为:
auto eno1
iface eno1 inet manual
bond-master bond0
auto eno2
iface eno2 inet manual
bond-master bond0
auto bond0
iface bond0 inet static
# regular network settings like address, netmask, gateway etc.发布于 2019-12-05 17:32:50
与大多数其他接口一样,管理键接口的现代命令是ip link,这里是随同系统,用于可能没有通过(rt)netlink直接处理的少数事情。在这个案例中:
ip link delete dev bond0任何仍然被奴役的接口,当移除键时都会被分离,所以没有必要先分离它(使用ip link set DEVICE nomaster)。
要这样做的替代方案sysfs方法是:
echo -bond0 > /sys/class/net/bonding_masters发布于 2019-12-05 16:38:37
键合接口由ifenslave(8)命令行实用程序管理。
下面是该手册的摘录:
NAME
ifenslave -- Attach and detach slave network devices to a bonding device.
SYNOPSIS
ifenslave [-acdfhuvV] [--all-interfaces] [--change-active] [--detach] [--force] [--help] [--usage] [--verbose] [--version] master slave ...
DESCRIPTION
ifenslave is a tool to attach and detach slave network devices to a bonding device. A bonding device will act like a normal Ethernet network device to the kernel,
but will send out the packets via the slave devices using a simple round-robin scheduler. This allows for simple load-balancing, identical to "channel bonding" or
"trunking" techniques used in switches.
The kernel must have support for bonding devices for ifenslave to be useful.
OPTIONS
-a, --all-interfaces
Show information about all interfaces.
-c, --change-active
Change active slave.
-d, --detach
Removes slave interfaces from the bonding device.要完全删除bond0,我会:
ifconfig bond0 downifenslave -d bond0 eno1ifenslave -d bond0 eno2这应该是值得的。
https://unix.stackexchange.com/questions/555745
复制相似问题