/etc/network/interfaces(ifupdown)에서 생성된 결합된 인터페이스를 제거하시겠습니까?

/etc/network/interfaces(ifupdown)에서 생성된 결합된 인터페이스를 제거하시겠습니까?

두 개의 인터페이스를 하나로 바인딩하려고 했는데 bond0, 효과가 만족스럽지 못했습니다. 그런 다음 /etc/network/interfaces에 적용한 모든 변경 사항을 되돌리고 실행했지만 systemctl restart networking.service결합된 인터페이스가 여전히 존재하므로( ifconfig및 명령에 표시됨) 이를 실행 하거나 강제로 취소 ip link해야 합니다 . 서버를 다시 시작하지 않고 인터페이스를 완전히 제거하려면 어떻게 해야 합니까?ip link set bond0 downifconfig 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.

답변1

대부분의 다른 인터페이스와 마찬가지로 결합된 인터페이스를 관리하기 위한 최신 명령은 다음과 같습니다.ip link, 여기와 함께시스템 파일 시스템직접적으로 처리할 수 없는 일부 사항의 경우(rt)웹 링크. 존재하다이 경우:

ip link delete dev bond0

바인딩이 제거될 때 여전히 슬레이브인 인터페이스는 분리되므로 ip link set DEVICE nomaster먼저 분리(사용)할 필요가 없습니다.

하나여분의시스템 파일 시스템방법동일한 작업을 수행하는 것은 다음과 같습니다.

echo -bond0 > /sys/class/net/bonding_masters

답변2

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 down
  • ifenslave -d bond0 eno1
  • ifenslave -d bond0 eno2
  • ̀ rmmod 바인딩`

그 정도면 충분합니다.

관련 정보