Interromper respostas duplicadas de eco icmp ao fazer a ponte para uma interface fictícia?

Interromper respostas duplicadas de eco icmp ao fazer a ponte para uma interface fictícia?

Recentemente configurei uma ponte br0com membros como eth0(real if) e dummy0( dummy.ko if).

Quando faço ping nesta máquina, recebo respostas duplicadas como:

  # ping SERVERA
  PING SERVERA.domain.local (192.168.100.115) 56(84) bytes of data.
  64 bytes from SERVERA.domain.local (192.168.100.115): icmp_seq=1 ttl=62 time=113 ms
  64 bytes from SERVERA.domain.local (192.168.100.115): icmp_seq=1 ttl=62 time=114 ms (DUP!)
  64 bytes from SERVERA.domain.local (192.168.100.115): icmp_seq=2 ttl=62 time=113 ms
  64 bytes from SERVERA.domain.local (192.168.100.115): icmp_seq=2 ttl=62 time=113 ms (DUP!)

Usando tcpdumpon SERVERA, consegui ver as respostas de eco do icmp sendo enviadas de eth0e br0da seguinte maneira (estranhamente, dois pacotes de solicitação de eco chegam "de" minha caixa do Windows myhost):

  23:19:05.324192 IP myhost.domain.local > SERVERA.domain.local: ICMP echo request, id 512, seq 43781, length 40
  23:19:05.324212 IP SERVERA.domain.local > myhost.domain.local: ICMP echo reply, id 512, seq 43781, length 40
  23:19:05.324217 IP myhost.domain.local > SERVERA.domain.local: ICMP echo request, id 512, seq 43781, length 40
  23:19:05.324221 IP SERVERA.domain.local > myhost.domain.local: ICMP echo reply, id 512, seq 43781, length 40
  23:19:05.324264 IP SERVERA.domain.local > myhost.domain.local: ICMP echo reply, id 512, seq 43781, length 40
  23:19:05.324272 IP SERVERA.domain.local > myhost.domain.local: ICMP echo reply, id 512, seq 43781, length 40

Vale a pena notar que os testes revelam que os hosts no mesmo switch físico não veem DUP icmp echo responses(um host na mesma VLAN em outro switch vê um dup icmp echo response).

Eu li que isso pode ser devido à ARPtabela de um switch, mas não consigo encontrar nenhuma informação diretamente relacionada bridges, apenas bonds. Tenho a sensação de que meu problema está na pilha do Linux, não no switch, mas estou aberto a qualquer sugestão.

O sistema está executando o kernel centos6/el6 2.6.32-71.29.1.el6.i686.

Como faço para impedir que respostas de eco ICMP sejam enviadas duplicadas ao lidar com uma interface de ponte/interfaces em ponte?

Obrigado,

Matt

[editar]

Nota rápida: foi recomendado no #linux:

[08:53] == mbrownnyc [gateway/web/freenode/] has joined ##linux
[08:57] <lkeijser> mbrownnyc: what happens if you set arp_ignore to 1 for the dummy interface?
[08:59] <lkeijser> also set arp_announce to 2 for that interface
[09:24] <mbrownnyc> lkeijser: I set arp_annouce to 2, arp_ignore to 2 in /etc/sysctl.conf and rebooted the machine... verifying that the bits are set after boot... the problem is still present

Eu fiz isso e fiquei vazio. O mesmo problema dup.

Deixarei de incluir a interface fictícia na ponte como:

[09:31] == mbrownnyc [gateway/web/freenode/] has joined #Netfilter
[09:31] <mbrownnyc> Hello all... I'm wondering, is it correct that even with an interface in PROMISC that the kernel will drop /some/ packets before they reach applications?
[09:31] <whaffle> What would you make think so?
[09:32] <mbrownnyc> I ask because I am receiving ICMP echo replies after configuring a bridge with a dummy interface in order for ipt_netflow to see all packets, only as reported in it's documentation: http://ipt-netflow.git.sourceforge.net/git/gitweb.cgi?p=ipt-netflow/ipt-netflow;a=blob;f=README.promisc
[09:32] <mbrownnyc> but I do not know if PROMISC will do the same job
[09:33] <mbrownnyc> I was referred here from #linux.  any assistance is appreciated
[09:33] <whaffle> The following conditions need to be met: PROMISC is enabled (bridges and applications like tcpdump will do this automatically, otherwise they won't function).
[09:34] <whaffle> If an interface is part of a bridge, then all packets that enter the bridge should already be visible in the raw table.
[09:35] <mbrownnyc> thanks whaffle PROMISC must be set manually for ipt_netflow to function, but
[09:36] <whaffle> promisc does not need to be set manually, because the bridge will do it for you.
[09:36] <whaffle> When you do not have a bridge, you can easily create one, thereby rendering any kernel patches moot.
[09:36] <mbrownnyc> whaffle: I speak without the bridge
[09:36] <whaffle> It is perfectly valid to have a "half-bridge" with only a single interface in it.
[09:36] <mbrownnyc> whaffle: I am unfamiliar with the raw table, does this mean that PROMISC allows the raw table to be populated with packets the same as if the interface was part of a bridge?
[09:37] <whaffle> Promisc mode will cause packets with {a dst MAC address that does not equal the interface's MAC address} to be delivered from the NIC into the kernel nevertheless.
[09:37] <mbrownnyc> whaffle: I suppose I mean to clearly ask: what benefit would creating a bridge have over setting an interface PROMISC?
[09:38] <mbrownnyc> whaffle: from your last answer I feel that the answer to my question is "none," is this correct?
[09:39] <whaffle> Furthermore, the linux kernel itself has a check for {packets with a non-local MAC address}, so that packets that will not enter a bridge will be discarded as well, even in the face of PROMISC.
[09:46] <mbrownnyc> whaffle: so, this last bit of information is quite clearly why I would need and want a bridge in my situation
[09:46] <mbrownnyc> okay, the ICMP echo reply duplicate issue is likely out of the realm of this channel, but I sincerely appreciate the info on the kernels inner-workings
[09:52] <whaffle> mbrownnyc: either the kernel patch, or a bridge with an interface. Since the latter is quicker, yes
[09:54] <mbrownnyc> thanks whaffle

[editar2]

Depois de remover a ponte e remover o módulo fictício do kernel, eu só tinha uma única interface relaxando, solitária. Ainda recebi respostas duplicadas de eco icmp... na verdade, recebi uma quantia aleatória:http://pastebin.com/2LNs0GM8

A mesma coisa não acontece em alguns outros hosts no mesmo switch, então tem a ver com a própria caixa do Linux. Provavelmente acabarei reconstruindo-o na próxima semana. Então... você sabe... a mesma coisa ocorrerá novamente.

[editar3] Adivinha? Reconstruí a caixa e ainda estou recebendo respostas de eco ICMP duplicadas. Deve ser a infraestrutura de rede, embora as tabelas ARP não contenham múltiplas entradas.

[editar 4] Que ridículo.

A máquina era uma sonda de rede, então eu estava (entrada e saída) espelhando uma porta de uplink para um nó que era a NIC. Então, o fluxo (deve ter) sido assim:

  1. ICMP echo requestentra através do mirrored uplink port.
  2. (o real) ICMP echo requesté recebido pela NIC
  3. (o espelhado) ICMP echo requesté recebido pela NIC
  4. ICMP echo replyé enviado para ambos.

Tenho vergonha de mim mesmo, mas agora eu sei. Foi sugerido #networkingisolar o tráfego espelhado para uma interface que não possui IP habilitado. Outra solução é criar uma VLAN administrativa e remover o espelhamento de pacotes para a VLAN administrativa (infelizmente, não é uma opção no meu switch).

Responder1

Eu vejo. O que você está procurando é um vínculo. O que você tem com sua ponte são múltiplas interfaces que agem de forma independente nos pacotes que recebem, tendo herdado o endereço da interface da ponte. Isso é bom quando você conecta dois switches de rede por meio de sua máquina. Quando você conecta os dois ao mesmo switch, você vê esse comportamento de múltiplas respostas.

Os títulos, por outro lado, oferecem um comportamento que garante que apenas um carro do título irá lidar com o tráfego. Isso pode ser por meio de failover ativo/passivo, ligação com o switch ou rotação por meio de placas, dependendo de como você configura a interface de ligação.

Sua troca não faz parte da equação aqui, já que você só tem um cabo conectado à interface de ligação.

Responder2

Fiz um clone da VM (com VMware) e tive o mesmo problema. A placa de rede, da nova VM, tinha novo endereço MAC. Tem como consertar, (já fiz isso no passado) mas porque estava com pressa. Excluí a nova VM e quando clonei novamente, com o endereço MAC antigo, estava tudo bem.

informação relacionada