1 / 12

Laboratório 7

Laboratório 7. Sistemas embarcados Período 2010.2. Roteiro. Configuração da Emulação de Ethernet via USB. Visão Geral. console do OMAP (minicom). serial RS 232. USB. telnetd. Barramento de Ethernet simulado. Estação 2. Configuração da Estação 2.

phila
Télécharger la présentation

Laboratório 7

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Laboratório 7 Sistemas embarcados Período 2010.2

  2. Roteiro • Configuração da Emulação de Ethernet via USB

  3. Visão Geral console do OMAP (minicom) serial RS 232 USB telnetd Barramento de Ethernet simulado Estação 2

  4. Configuração da Estação 2 • Configure a Estação 2 para reconhecer uma interface USB para emulação de Ethernet: • sudo vi /etc/network/interfaces • Adicione ao final do arquivo: auto usb0 iface usb0 inet static address 192.168.2.15 netmask 255.255.255.0 network 192.168.2.0 broadcast 192.168.2.255 up iptables -t nat -A POSTROUTING -o eth0 -s 192.168.2.15 -j MASQUERADE up echo 1 > /proc/sys/net/ipv4/ip_forward down iptables -t nat -D POSTROUTING -o eth0 -s 192.168.2.15 -j MASQUERADE down echo 0 > /proc/sys/net/ipv4/ip_forward Endereço IP para a interface USB (modifique-o conforme a sua rede)

  5. Configuração da Estação 2 • Se ainda não instalados: • sudo apt-get install telnetd • sudo apt-get install netkit-inetd • Iniciar o serviço inetd • sudo /etc/init.d/inetd start • Permitir acesso ao serviço telnet: • sudo vi /etc/hosts.allow • Adicionar ao final do arquivo a linha: ALL: ALL

  6. Porta USB do módulo H2 • Remova o cabo Ethernet da Estação 2 • Ligue o cabo USB entre OMAP e Estação 2 Cabo USB qua acompanha o kit OMAP plug mini “B” telnetd plug padrão “A” Estação 2

  7. Reconhecimento da conexão USB • Observe no console do OMAP: / $ tps65010: battery charging udc: USB reset done, gadget ether udc: USB reset done, gadget ether udc: USB reset done, gadget ether udc: USB reset done, gadget ether usb0: full speed config #1: 8 mA, Ethernet Gadget, using CDC Ethernet

  8. Reconhecimento da conexão USB • No console da estação 2: • dmesg [17180326.332000] usb 3-2: new full speed USB device using uhci_hcd and address 2 [17180326.512000] usb 3-2: configuration #1 chosen from 2 choices [17180326.724000] usb0: register 'cdc_ether' at usb-0000:00:1d.2-2, CDC Ethernet Device, 1a:86:ea:b3:c1:8c [17180326.724000] usbcore: registered new driver cdc_ether [17180326.848000] ip_tables: (C) 2000-2006 Netfilter Core Team [17180326.852000] Netfilter messages via NETLINK v0.30. [17180326.868000] ip_conntrack version 2.4 (8189 buckets, 65512 max) - 224 bytes per conntrack [17180337.128000] usb0: no IPv6 routers present

  9. Reconhecimento da conexão USB • No console da estação 2: • ifconfig ... usb0 Encapsulamento do Link: Ethernet Endereço de HW 0E:0E:91:C2:F5:E9 inet end.: 192.168.2.15 Bcast:192.168.2.255 Masc:255.255.255.0 endereço inet6: fe80::c0e:91ff:fec2:f5e9/64 Escopo:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Métrica:1 pacotes RX:0 erros:0 descartados:0 excesso:0 quadro:0 Pacotes TX:0 erros:4 descartados:0 excesso:0 portadora:0 colisões:0 txqueuelen:1000 RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

  10. Configuração do OMAP • No console do OMAP: • ifconfig usb0 up 192.168.2.16 • ifconfig ... usb0 Link encap:Ethernet HWaddr BA:A4:E9:14:A4:9B inet addr:192.168.2.16 Bcast:192.168.2.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:38 errors:0 dropped:0 overruns:0 frame:0 TX packets:45 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:3290 (3.2 KiB) TX bytes:3029 (2.9 KiB)

  11. Teste • No console do OMAP: • ping 192.168.2.15 • No console da estação 2: • ping 192.168.2.16 • No console da estação 1 (esperamos obter Destination Host Unreachable): • ping 192.168.2.15 • ping 192.168.2.16

  12. Teste • No console do OMAP: • telnet 192.168.2.15 • Faça login na Estação 2

More Related