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

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...

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 Bank Job [UK] (2008)

  My views Plot In 1971, British Security Services ( MI5 ) have taken interest in a  safety deposit box  in a particular  Lloyd's Bank  branch. Belonging to black militant gangster  Michael X , it contains compromising photos of  Princess Margaret , [ 7 ]  insurance to keep the British authorities off Michael's back. Martine Love, an ex-model romantically involved with MI5 agent Tim Everett, is caught smuggling drugs into the country, and to avoid going to jail, she makes a deal with the authorities to retrieve the photos. Martine approaches her friend Terry, a struggling car salesman with criminal contacts, and tells him that if he can assemble the gang to help her rob the bank, he will be richly rewarded, but does not tell him about the photos in the deposit box. Terry's team includes his close friends Eddie (one of his employees), Dave, and Kevin, as well as trusted criminal associates Bambas and Guy Singer. While scouting the bank, Dave runs i...