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

Movies - Deadpool & Wolverine (2024)

 

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

 

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