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

Movie - Bastille Day | The Take (2016)

  My views Plot On the eve of  Bastille Day  in  Paris , American drifter and  pickpocket  Michael Mason steals a woman's handbag, not knowing that it contains  explosives . After taking the cash from the bag, he discards it, caught unwittingly on  CCTV  as he does so. The bag then detonates and kills four people. Upon being captured by  CIA  agent Sean Briar, who is being reprimanded for irresponsible conduct on the job, Mason protests that he is not a  terrorist  and tells Briar that the bag contained a cellphone owned by a woman named Zoé. The bomb was set up by a group of  corrupt policemen , all of them members in the  French special police RAPID unit  led by Rafi Bertrand, who intend to pull a robbery at the  Bank of France . Zoé was told to plant the bomb at the office of the  French Nationalist Party  (as part of a diversion for the heist), but after seeing the night cleaning crew arri...

Movie - The Gorge (2025)

  My views For 80 years everything was ok ... until they sent a woman For sure is DTV ... really bad Inside the gorge is clearly designed and written by a gamer Plot Two elite  snipers  receive identical missions: travel to an undisclosed location and guard the West and East sides of a deep gorge for one year without any contact with the outside world nor their counterpart on the opposite side. Levi Kane, a former  U.S. Marine  and current  private contractor  accepts the offer to guard the West tower. Drasa, a  Lithuanian  covert operative frequently employed by the  Kremlin , agrees to guard the East side. Upon arriving, Levi relieves his predecessor, J.D., a  British   Royal Marine  of duty and asks for specifics about the mission. J.D. explains that in addition to the towers on the East and West, there are automated turret defenses to the North and South, a powerful signal ‘ cloak ,’ and  explosives on the walls ...