Como configurar o Linux privado incorporado

3

Estou tentando configurar uma vlan entre 2 SOCs Linux embarcados em IPTV STB sem fio (set-top box) usando o vconfig. A conexão física entre os SOCs é um switch Marvell 88E60xx. A questão é que a vlan precisa ser privada. Se houver mais de um IPTV STB, um RPC (chamada de procedimento remoto) obtém uma resposta do STB errado e os endereços IP estáticos que utilizo são duplicados na rede. Eu vejo isso no Wireshark.

Duplicate IP address detected for 1.1.1.1 (28:c8:7a:b5:ad:50) - also in use by 28:c8:7a:b5:ad:10 (frame 171)

Eu suspeito que estou faltando 1 ou 2 etapas de configuração, mas esta é a minha primeira tentativa de configurar uma vlan. É assim que eu configuro a vlan no SOC que controla o WiFi

vconfig add br0 12
ip link set br0.12 up
ifconfig br0.12 1.1.1.2 netmask 255.255.255.248

É assim que eu configuro a vlan no SOC que controla o IPTV

ifconfig eth0 0.0.0.0 multicast up
vconfig add eth0 0
ifconfig eth0.0 0.0.0.0 multicast up
brctl addbr br0
brctl addif br0 eth0.0
brctl addbr br6
brctl stp br6 0 # spanning tree protocol off
brctl setfd br6 0 # set bridge forward delay to 0 seconds
vconfig add eth0 12
ifconfig eth0.12 0.0.0.0 multicast up
brctl addif br6 eth0.12
ifconfig br6 1.1.1.1 up

Este é o ifconfig no SOC que controla o WiFi

br0       Link encap:Ethernet  HWaddr 28:C8:7A:B5:AD:11
          inet addr:192.168.1.230  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: /64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:10266 errors:0 dropped:0 overruns:0 frame:0
          TX packets:130 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:1032197 (1008.0 KiB)  TX bytes:10459 (10.2 KiB)

br0.12    Link encap:Ethernet  HWaddr 28:C8:7A:B5:AD:11
          inet addr:1.1.1.2  Bcast:1.1.1.7  Mask:255.255.255.248
          inet6 addr: /64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:178 errors:0 dropped:0 overruns:0 frame:0
          TX packets:124 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:11585 (11.3 KiB)  TX bytes:9991 (9.7 KiB)

eth1_0    Link encap:Ethernet  HWaddr 28:C8:7A:B5:AD:13
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:9910 errors:0 dropped:0 overruns:0 frame:0
          TX packets:47291704 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:512
          RX bytes:927138 (905.4 KiB)  TX bytes:1386129256 (1.2 GiB)
          Interrupt:20

wifi0     Link encap:Ethernet  HWaddr 28:C8:7A:B5:AD:11
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:47372174 errors:26 dropped:0 overruns:0 frame:0
          TX packets:19386 errors:4 dropped:4 overruns:0 carrier:0
          collisions:0 txqueuelen:1536
          RX bytes:2526373464 (2.3 GiB)  TX bytes:1626473 (1.5 MiB)

Este é o ifconfig no SOC que controla o IPTV

br6       Link encap:Ethernet  HWaddr 28:C8:7A:B5:AD:10
          inet addr:1.1.1.1  Bcast:1.255.255.255  Mask:255.0.0.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:87 errors:0 dropped:0 overruns:0 frame:0
          TX packets:120 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:5801 (5.6 KiB)  TX bytes:8981 (8.7 KiB)

eth0      Link encap:Ethernet  HWaddr 28:C8:7A:B5:AD:10
          inet addr:10.70.246.245  Bcast:10.70.246.255  Mask:255.255.255.240
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:46704864 errors:140 dropped:0 overruns:0 frame:226
          TX packets:19531 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:128
          RX bytes:433498829 (413.4 MiB)  TX bytes:821667 (802.4 KiB)
          Interrupt:46

eth0.0    Link encap:Ethernet  HWaddr 28:C8:7A:B5:AD:10
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

eth0.12   Link encap:Ethernet  HWaddr 28:C8:7A:B5:AD:10
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:87 errors:0 dropped:0 overruns:0 frame:0
          TX packets:120 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:6149 (6.0 KiB)  TX bytes:9461 (9.2 KiB)

Este é um cat / proc / net / vlan / * no SOC que controla o WiFi

br0.12  VID: 12  REORDER_HDR: 1  dev->priv_flags: 1
         total frames received          266
          total bytes received        16535
      Broadcast/Multicast Rcvd            0

      total frames transmitted          191
       total bytes transmitted        20024
            total headroom inc            0
           total encap on xmit          191
Device: br0
INGRESS priority mappings: 0:0  1:0  2:0  3:0  4:0  5:0  6:0 7:0
 EGRESS priority mappings:
VLAN Dev name    | VLAN ID
Name-Type: VLAN_NAME_TYPE_RAW_PLUS_VID_NO_PAD
br0.12         | 12  | br0

Este é um cat / proc / net / vlan / * no SOC que controla o IPTV

VLAN Dev name    | VLAN ID
Name-Type: VLAN_NAME_TYPE_RAW_PLUS_VID_NO_PAD
eth0.0         | 0  | eth0
eth0.12        | 12  | eth0
eth0.0  VID: 0   REORDER_HDR: 1  dev->priv_flags: 1
         total frames received            0
          total bytes received            0
      Broadcast/Multicast Rcvd            0

      total frames transmitted            0
       total bytes transmitted            0
            total headroom inc            0
           total encap on xmit            0
Device: eth0
INGRESS priority mappings: 0:0  1:0  2:0  3:0  4:0  5:0  6:0 7:0
EGRESSS priority Mappings:
eth0.12  VID: 12         REORDER_HDR: 1  dev->priv_flags: 1
         total frames received          183
          total bytes received        17613
      Broadcast/Multicast Rcvd            6

      total frames transmitted          252
       total bytes transmitted        18699
            total headroom inc           39
           total encap on xmit          252
Device: eth0
INGRESS priority mappings: 0:0  1:0  2:0  3:0  4:0  5:0  6:0 7:0
EGRESSS priority Mappings:
    
por jacknad 18.12.2015 / 15:49

1 resposta

0

Consegui isolar a vlan desligando o arp assim:

ifconfig br6 -arp #turn off arp

e definindo arp assim

arp -s 1.1.1.2 $WMAC

e fazendo algo semelhante no outro lado da ponte como este

ifconfig br0 -arp #turn off arp
ifconfig br0.12 -arp #turn off arp

e

arp -s 1.1.1.1 $EMAC
    
por 29.12.2015 / 23:26