liberte seu roteador sem fio!

45
Liberte seu roteador sem fio! Rodrigo Troian - @rtroian Rodrigo Troian - @rtroian [email protected] [email protected] (ver. 0.0 – fisl12 - 2011) (ver. 0.1 – Hack'n Rio - 2012) (ver. 0.2 – Software Freedom Day - 2012)

Upload: rodrigo-troian

Post on 24-May-2015

1.255 views

Category:

Self Improvement


4 download

DESCRIPTION

Palestra demonstrativa de como trocar o sistema operacional do roteador wireless e agregar funções ao mesmo.

TRANSCRIPT

Page 1: Liberte seu roteador sem fio!

Liberte seu roteador sem fio!

Rodrigo Troian - @rtroianRodrigo Troian - @[email protected]@softwarelivre.org

(ver. 0.0 – fisl12 - 2011)(ver. 0.1 – Hack'n Rio - 2012)

(ver. 0.2 – Software Freedom Day - 2012)

Page 2: Liberte seu roteador sem fio!

Intro...curiosidade com sistemas embarcados livres

pesquisa para redes em malha

interesse em servidores de baixo consumo

Page 3: Liberte seu roteador sem fio!

fluxo

WiFi

Hardware

Distros

OpenWRT

NAS

Perguntas

Page 4: Liberte seu roteador sem fio!

WiFi X Wireless

WiFi - apenas comunicações 802.11 (a,b,g,n,s,..)

Wireless - qualquer coisa eletro eletrônica sem fio!!!

Page 5: Liberte seu roteador sem fio!

Wireless Landscapediferentes tecnologias para diferentes distâncias

Page 6: Liberte seu roteador sem fio!

Canais WiFi

Page 7: Liberte seu roteador sem fio!

Hardware

Semelhante ao padrão PC, mantidas as proporcões...

Page 8: Liberte seu roteador sem fio!

Hardware Database

Page 9: Liberte seu roteador sem fio!

Hardware Database

Page 10: Liberte seu roteador sem fio!

Chipset / Proc.

Atheros

Broadcom

...

ARM

MIPS

...

Page 11: Liberte seu roteador sem fio!

MemóriasBIOS - ROM (hardware básico)

NVRAM (boot loader)

FLASH (sistema operacional, sistema de arquivos)

RAM (sistema em execução, tabela roteamento, ...)

Page 12: Liberte seu roteador sem fio!

Antenas

área (360) X alcance (45)área (360) X alcance (45)

Page 13: Liberte seu roteador sem fio!

USB

antenas

adaptadores 3g

hd externo

som usb

...

Page 14: Liberte seu roteador sem fio!

Distros linux no router, porquê?

acesso ssh ao shell :D

multiplas WLAN

VLANS

protocolos variados

NAS/DAS

... ou oquê os fabricantes esquecem de colocar ...

Page 15: Liberte seu roteador sem fio!

dd-wrt

free e comercial

Page 16: Liberte seu roteador sem fio!

TOMATO

free

Page 17: Liberte seu roteador sem fio!

AirOS - ubiquiti

hardware próprio

Page 18: Liberte seu roteador sem fio!

Gargoyle

free

Page 19: Liberte seu roteador sem fio!

Freifunk

open-wrt based

Page 20: Liberte seu roteador sem fio!

Freifunk - Mesh

open-wrt based

Page 21: Liberte seu roteador sem fio!

OpenWRT

web interface XWRT

Page 22: Liberte seu roteador sem fio!

OpenWRT

web interface LUCI

Page 23: Liberte seu roteador sem fio!

versões OpenWRT

White Russian (2.2)

Kamikaze (2.4)

BackFire (2.6)

Page 24: Liberte seu roteador sem fio!

Instalando

0. verificar a compatibilidade – site DD-WRT e do OpenWRT

1. identificar o processador e arquitetura – idem acima :)

2. identificando a versão do OpenWRT

3. fazer download dos arquivos corretos, verificar MD5SUMs'

4. verificar necessidade de troca boot loader

5. instalar sistema base

6. configurar serviços básicos (senha, dhcp, wireles, segurança)

7. aproveitar!

Page 25: Liberte seu roteador sem fio!

identificando

Page 26: Liberte seu roteador sem fio!

extensões de firmware

bin (kernel e sistema de arquivos) instalação nova

trx (kernel e sistema de arquivos) atualização

equipos mais antigos:

lzma (imagem kernel)

squashfs (sistema de arquivos)

Page 27: Liberte seu roteador sem fio!

baixando

Page 28: Liberte seu roteador sem fio!

instalando...

mesmo fabricante

dir 300 X dir 615

redboot X uboot

mesmo modelo

LinkSys WRT54G

(v. 1-4 X 5-8)

hardware...

Page 29: Liberte seu roteador sem fio!

usando!

Page 30: Liberte seu roteador sem fio!

comandos...

Page 31: Liberte seu roteador sem fio!

gerenciador de pacotes

Page 32: Liberte seu roteador sem fio!

novas funcionalidades

Page 33: Liberte seu roteador sem fio!

http://en.wikipedia.org/wiki/Network-attached_storage

resumidamente: um servidor de rede com disco compartilhado...

HD + bittorrent + ftp + samba

NAS - Conceito

Page 34: Liberte seu roteador sem fio!

NAS - Hardware

roteador wireless N + 5 portas Giga + USB 2.0 - (TP-Link TL-WR1043ND)

HD externo 1 TB + usb 2.0 + fonte  (HD Samsung + Case Generico)

detalhes equipo:

http://wiki.openwrt.org/toh/tp-link/tl-wr1043nd

Page 35: Liberte seu roteador sem fio!

NAS - instalando HD

pacotes (opkg install ou via web)

usbutils (reconhecimento dispositivos)

kmod-usb-storage ( armazenamento USB)

kmod-scsi-generic (HD em geral)

kmod-fs-ext3 (sistema de arquivos)

block-hotplug (auto montagem HD)

Page 36: Liberte seu roteador sem fio!

dmesg - conferindo! usb 1-1: configuration #1 chosen from 1 choice

Initializing USB Mass Storage driver...

scsi0 : SCSI emulation for USB Mass Storage devices

usbcore: registered new interface driver usb-storage

USB Mass Storage support registered.

usb-storage: device found at 5

usb-storage: waiting for device to settle before scanning

scsi 0:0:0:0: Direct-Access ST310005 28AS PQ: 0 ANSI: 2 CCS

sd 0:0:0:0: Attached scsi generic sg0 type 0

sd 0:0:0:0: [sda] 1953525168 512-byte logical blocks: (1.00 TB/931 GiB)

sd 0:0:0:0: [sda] Write Protect is off

sd 0:0:0:0: [sda] Mode Sense: 28 00 00 00

sd 0:0:0:0: [sda] Assuming drive cache: write through

usb-storage: device scan complete

Page 37: Liberte seu roteador sem fio!

nova partição

Page 38: Liberte seu roteador sem fio!

NAS - bittorrent

open source com baixo uso de recursos

controle via web, terminal ou cliente

encriptação, DHT, links magneticos...

instalação por pacotes (transmission-daemon e transmission-web)

Page 39: Liberte seu roteador sem fio!

transmission bitorrent

Page 40: Liberte seu roteador sem fio!

SWAP ativando

dd if=/dev/zero of=/mnt/media/swap count=262144

mkswap /mnt/media/swap

swapon /mnt/media/swap

Page 41: Liberte seu roteador sem fio!

SWAP conferindo

Page 42: Liberte seu roteador sem fio!

SAMBA e FTP

acesso interno

pacote samba3

criar usuario (sem shell)

configurar

root@OpenWrt:/etc/init.d# ./samba enable

acesso externo

pacote wsftpd

criar usuario (com shell)

configurar

root@OpenWrt:/etc/init.d# ./vsftpd enable

Page 43: Liberte seu roteador sem fio!

exemplo de smb.conf

agora é só ajustar o smb.conf e pronto!

Page 44: Liberte seu roteador sem fio!

perguntas,

Page 45: Liberte seu roteador sem fio!

Liberte seu roteador sem fio!

(versão 0.0 – fisl12 - 2011)(versão 0.1 – Hack'n Rio - 2012)

(versão 0.2 – Software Freedom Day - 2012)

Rodrigo Troian - @rtroianRodrigo Troian - @[email protected]@softwarelivre.org

Obrigado!