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 - My Home Platform View - All Infrastructure

Some ideas Deploy a harverster cluster Deploy a rancher server

TV Mini-serie - Lady in the Lake (2024)

 

Movie - The Gray Man (2022)

  My views Plot In 2003, senior  CIA  official Donald Fitzroy visits a prisoner named Courtland Gentry in Florida. Eight years earlier, Courtland was a minor convicted of killing his abusive father to protect his brother. Fitzroy offers him his freedom in exchange for working as an assassin in the CIA's  Sierra  program, an elite black ops unit, which will allow him to exist in the gray. In 2021, Courtland, now known as  Sierra Six , is working with fellow CIA agent Dani Miranda to assassinate a target named Dining Car suspected of selling off  national security  secrets in  Bangkok  during the national  Songkran  festival. Unable to do so stealthily without harming civilians, he attacks Dining Car directly, mortally wounding him. Before dying, he reveals he was also in the Sierra program as Sierra Four. He hands Six an encrypted drive detailing the corruption of CIA official Denny Carmichael, the lead agent on the assassinatio...