Skip to main content

Linux Fedora 17 network bond

Instruções para ativar a utilização de portas de rede (NIC-Network Interface Card) em conjunto.

No meu caso, a minha instalação do Fedora foi feita para utilizar a console. O conjunto de instruções a seguir desativam o NetworkManager e forçam a utilização do antigo e simples serviço de rede (network).


  1. Desativar o NetworkManager

    systemctl stop NetworkManager.service
    systemctl disable NetworkManager.service
  2. Criar o arquivo de configuração que carrega o módulo de agregamento de rede (bonding). Criar o arquivo /etc/modprobe.d/bonding.conf com o conteúdo abaixo. Esta configuração irá criar uma interface virtual chamada bonding0. Para criar mais de um conjunto separado de portas de rede agregadas, basta adicionar mais linhas apenas mudando o nome da interface virtual.

    alias bond0 bonding
  3. Criar o aqruivo de configuação da interface virtual de rede. Estas configurações devem ficar no arquivo /etc/sysconfig/network-scripts/ifcfg-bond0.

    DEVICE=bond0
    IPADDR=10.1.x.x
    NETWORK=10.1.0.0
    NETMASK=255.255.0.0
    USERCTL=no
    BOOTPROTO=none
    ONBOOT=yes
    BONDING_OPTS="mode=1 miimon=100"
    NM_CONTROLLED="no"
  4. Renomear o arquivo de configuração das portas de rede para arquivos no formato ifcfg-ethn. Por exemplo, no meu computador, eu mudei o nome do arquivo /etc/sysconfig/network-scripts/ifcfg-p2p1 para /etc/sysconfig/network-scripts/ifcfg-eth0
  5. Atualizar o conteúdo do arquivo de configuração da porta de rede. No meu exemplo, o arquivo em questão é o /etc/sysconfig/network-scripts/ifcfg-eth0. É importante que a variável DEVICE contenha o nome correto da interface de rede a ser utilizada.

    DEVICE=p2p1
    SLAVE=yes
    MASTER=bond0
    NM_CONTROLLED=no
    USERCTL=no
    BOOTPROTO=none
  6. Fazer o mesmo para todas as interfaces que irão compoor um conjunto agregado
  7. Habilitar e ativar o serviço de rede. É importante notar que cuidados devem ser tomados com o switch de rede utilizado para contornar possíveis problemas de protocolo, segurança, VLAN etc.

    systemctl enable network.service
    systemctl start network.service
  8. O resultado final deve ser algo parecido com

    # ifconfig -a

    bond0: flags=5187<UP,BROADCAST,RUNNING,MASTER,MULTICAST>  mtu 1500
           inet 10.1.0.1  netmask 255.255.0.0  broadcast 10.1.255.255
            inet6 fe80::a00:27ff:feb3:6e6c  prefixlen 64  scopeid 0x20<link>
            ether 08:00:27:b3:6e:6c  txqueuelen 0  (Ethernet)
            RX packets 0  bytes 0 (0.0 B)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 143  bytes 10860 (10.6 KiB)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
    ...
    p2p1: flags=6211<UP,BROADCAST,RUNNING,SLAVE,MULTICAST>  mtu 1500
            ether 08:00:27:b3:6e:6c  txqueuelen 1000  (Ethernet)
            RX packets 0  bytes 0 (0.0 B)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 143  bytes 10860 (10.6 KiB)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

    p7p1: flags=6211<UP,BROADCAST,RUNNING,SLAVE,MULTICAST>  mtu 1500
            ether 08:00:27:b3:6e:6c  txqueuelen 1000  (Ethernet)
            RX packets 0  bytes 0 (0.0 B)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 0  bytes 0 (0.0 B)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
    ...
É muito importante notar que se não houver SLAVE na linha de definição da interface de rede, então a configuração está errada.

Visto que as interfaces de rede no meu computador receberam os nomes p2p1 e p7p1, os arquivos de configuração são:

/etc/sysconfig/network-scripts/ifcfg-eth0

NM_CONTROLLED="no"
BOOTPROTO="none"
DEVICE="p2p1"
ONBOOT="yes"
USERCTL=no
SLAVE=yes
MASTER=bond0

/etc/sysconfig/network-scripts/ifcfg-eth1

NM_CONTROLLED="no"
BOOTPROTO="none"
DEVICE="p7p1"
ONBOOT="yes"
USERCTL=no
MASTER=bond0
SLAVE=yes

/etc/sysconfig/network-scripts/ifcfg-bond0

DEVICE=bond0
IPADDR=10.1.0.1
NETWORK=10.1.0.0
NETMASK=255.255.0.0
USERCTL=no
BOOTPROTO=none
ONBOOT=yes
BONDING_OPTS="mode=1 miimon=100"

Comments

Popular posts from this blog

IT - Which Is Faster: find | cpio -pdvm OR rsync?

To determine which is faster between find | cpio -pdvm and rsync for copying a large directory tree locally, we need to consider several factors: the nature of the operation, the tools' design, the system environment, and the specific use case. Let’s break this down based on the information provided in the web results and general knowledge about these tools. Overview of the Tools find | cpio -pdvm : find : Recursively lists all files and directories in a given path. cpio : A tool for copying files into or out of a cpio or tar archive. In this case, with the -pdvm options: -p : Pass-through mode (copy files from one directory tree to another). -d : Create directories as needed. -v : Verbose mod...

IT - Troubleshooting Kodi DLNA Visibility Issues After Windows Updates: A Deep Dive Into Conflicts, Fixes, and Lessons Learned

Title: Troubleshooting Kodi DLNA Visibility Issues After Windows Updates: A Deep Dive Into Conflicts, Fixes, and Lessons Learned Subtitle: How I Diagnosed and Solved Intermittent Kodi Visibility Problems on a Samsung Smart TV After Windows OS Updates and Media Server Conflicts Introduction Home media streaming should be seamless, but anyone who has integrated Kodi into a smart home setup knows that stability isn't always guaranteed. Recently, I encountered a frustrating issue: Kodi, running perfectly on my Windows 10 Pro desktop, suddenly became invisible to my Samsung Smart TV via DLNA. The journey to resolve this seemingly simple visibility issue turned into a deep technical rabbit hole involving Windows Media Server, Universal Media Server, Jellyfin, NordVPN, and the very internals o... The System Setup Before diving into the problem, it's essential to understand my hardware and software setup: Operating System: Windows 10 Pro (build 2009) Media Server: Kodi (...

Movie - The Wizard of Oz (1939)

  My views Plot In rural  Kansas ,  Dorothy Gale  lives on a farm owned by her Uncle Henry and Aunt Em, and wishes she could be somewhere else. Dorothy's neighbor, Almira Gulch, who had been bitten by Dorothy's dog, Toto, obtains a sheriff's order authorizing her to seize Toto. Toto escapes and returns to Dorothy, who runs away to protect him. Professor Marvel, a charlatan fortune-teller, convinces Dorothy that Em is heartbroken, which prompts Dorothy to return home. She returns just as a  tornado  approaches the farm. Unable to get into the locked storm cellar, Dorothy takes cover in the farmhouse and is knocked unconscious. She seemingly awakens to find the house moving through the air, with her and Toto still inside it. The house comes down in an unknown land, and Dorothy is greeted by a good witch named  Glinda , who floats down in a bubble and explains that Dorothy has landed in Munchkinland in the  Land of Oz , and that the Munchkins are cel...