Cubietruck Roteador 3G

 

Cubietruck Roteador 3G – Bridge / Hotspot

Neste artigo, vou mostrar como configurar a Cubietruck para funcionar como um Access Point em modo bridge, de forma que a sua rede possa compartilhar o acesso à Internet do 3G com as máquinas da sua casa ou trabalho.

A distribuição utilizada será o Debian, que está instalado em uma Cubietruck. O módulo usado pela placa é o bcmdhd.

Modem Utilizado:

Huawei 1750

Link da Imagem para SD Card
http://cubie.nobrainz.de/downloads/CTDebian_1.9_hdmi.zip

Instalação do hostapd:
Para instalar o hostapd no Debian, utilize os comandos:

# apt-get update
# apt-get install hostapd
# apt-get install bridge-utils
Pacotes necessários para o modem 3G:
sudo aptitude install usb-modeswitch wvdial

Crie o arquivo /etc/wvdial.conf com o seguinte conteudo

[Dialer claro]
Init2 = ATZ
Init3 = ATE0V1&D2&C1S0=0+IFC=2,2
Init5 = AT+CGDCONT=1,”IP”,”claro.com.br”;
Modem Type = Analog Modem
Baud = 460800
New PPPD = yes
Modem = /dev/ttyUSB0
ISDN = 0
Phone = *99#
Dial Command = ATDT
Username = claro
Password = claro
Stupid Mode = 1
Auto DNS = 0
Check DNS = 0
DNS = 8.8.8.8

Servidor de DHCP:

vim /etc/network/interfaces

#Conteúdo das interfaces
auto wlan0
iface wlan0 inet static
address 192.168.0.254
netmask 255.255.255.0

root@Cubian:~# apt-get install isc-dhcp-server

root@Cubian:~# cd /etc/default
root@Cubian:~# vim isc-dhcp-server

#Conteúdo do isc-dhcp-server

# Defaults for isc-dhcp-server initscript
# sourced by /etc/init.d/isc-dhcp-server
# installed at /etc/default/isc-dhcp-server by the maintainer scripts

#
# This is a POSIX shell fragment
#

# Path to dhcpd’s config file (default: /etc/dhcp/dhcpd.conf).
DHCPD_CONF=/etc/dhcp/dhcpd.conf

# Path to dhcpd’s PID file (default: /var/run/dhcpd.pid).
DHCPD_PID=/var/run/dhcpd.pid

# Additional options to start dhcpd with.
# Don’t use options -cf or -pf here; use DHCPD_CONF/ DHCPD_PID instead
#OPTIONS=””

# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
# Separate multiple interfaces with spaces, e.g. “eth0 eth1?.
INTERFACES=”wlan0″

root@Cubian:~# cd /etc/dhcpd/

root@Cubian:~# vim dhcpd.conf

#Conteúdo do dhcpd.conf
ddns-update-style none;
default-lease-time 600;
max-lease-time 7200;
authoritative;

subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.100 192.168.0.199;
option routers 192.168.0.254;
option domain-name-servers 8.8.8.8,8.8.8.4;
option broadcast-address 192.168.0.255;
}
apt-get install isc-dhcp-server

Configuração do Firewall:

vim /etc/init.d/firewall

#Conteudo do Firewall

#This will CLEAR ALL RULES !!!
iptables -F
#Enable NAT (through the ppp0 interface)
iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE

#then we need to enable routing:
echo “1” > /proc/sys/net/ipv4/ip_forward
3G e firewall na inicialização:

vim /etc/rc.local

#Conteudo do rc.local
/etc/init.d/firewall
wvdial claro

Reinicie o Sistema:

#reboot

 

Para baixar a versão em PDF, clique no link abaixo:

http://www.lojamundi.com.br/download/cubietruck-roteador-3g/cubietruck-roteador-3g.pdf

Posted in: Cubieboard Tags: cubietruckroteador3g

ENTRE EM CONTATO COM A LOJAMUNDI.

Assine nossa Newsletter! É gratuito!

Cadastre seu nome e email para receber novidades e materiais gratuitos da Lojamundi.