Projeto Integrador - 2013.2 - RRLA Telecom

De MediaWiki do Campus São José
Revisão de 18h53min de 10 de dezembro de 2013 por Ricardo.r (discussão | contribs)
Ir para navegação Ir para pesquisar

== (18/11) ==



RRLA TELECOM


Por não ter o computador em mãos para dar inicio a instalação e configuração, planejamos e organizamos o que será necessário para dar inicio ao projeto:

-Gerência & Programação

  • SSH
  • DHCP: Faixa de IP - ?
  • DNS
  • NTP
  • ROTEAMENTO E NAT
  • APACHE
  • PHP
  • MYSQL
  • SNMP
  • TC
  • CERTIFICADO
  • IDENTIFICAÇÃO
  • AUTENTICAÇÃO
  • ROTAS
  • RADIUS


-Cabeamento

  • Rack's: Quantidade - ?
  • Pacth Panel: Quantidade - ?
  • Conectores: Quantidade - ?
  • Cabos: Quantos metros - ?
  • Adaptadores e Tomadas: Quantidade - ?


-Instalação de Equipamentos

  • Modens: Quantidade - ?
  • Swicths: QUantidade - ?
  • Dslan: Ligações - ?
  • Conexões
  • Vlans
  • Wirelles
  • Conversores de Mídia



== (19/11) ==



Recebemos o computador, feito a montagem do computador e instalação do sistema operacional (UBUNTU).


Terceiro dia (20/11)

INSTALANDO E CONFIGURANDO DHCP

  • aptitude install isc-dhcp-server
  • vi /etc/dhcp/dhcpd.conf

authoritative;

  1. Integração com o Syslog

log-facility local7

  1. Integração com o DNS

ddns-update-style none; option domain=name "rrlatelecom.sj.ifsc.edu.br; option domain=name-servers 127.0.0.1;

  1. Tempos de "aluguel"

default-lease-time 3600; max-lease-time 14400;

  1. abaixo seguira as sub redes
  1. Rede sem fio

subnet 192.168.4.0 netmask 255.255.255.0 {

   range 192.168.1.100 192.168.1.199;
   option routers 192.168.4.254
   domain-name "rrla.sj.ifsc.edu.br";
   domain-name-servers 192.168.4.254;

}

  1. Apartamento 1

subnet 192.168.5.0 netmask 255.255.255.0 {

   range 192.168.5.100 192.168.5.199;
   option routers 192.168.5.254
   domain-name "rrla.sj.ifsc.edu.br";
   domain-name-servers 192.168.5.254;

}


  1. Apartamento 2

subnet 192.168.6.0 netmask 255.255.255.0 {

   range 192.168.6.100 192.168.6.199;
   option routers 192.168.6.254
   domain-name "rrla.sj.ifsc.edu.br";
   domain-name-servers 192.168.6.254;

}

  1. Apartamento 3

subnet 192.168.7.0 netmask 255.255.255.0 {

   range 192.168.7.100 192.168.7.199;
   option routers 192.168.7.254
   domain-name "rrla.sj.ifsc.edu.br";
   domain-name-servers 192.168.7.254;

}

  1. Apartamento 4

subnet 192.168.8.0 netmask 255.255.255.0 {

   range 192.168.8.100 192.168.8.199;
   option routers 192.168.8.254
   domain-name "rrla.sj.ifsc.edu.br";
   domain-name-servers 192.168.8.254;

}


  1. Apartamento 5

subnet 192.168.9.0 netmask 255.255.255.0 {

   range 192.168.9.100 192.168.9.199;
   option routers 192.168.9.254
   domain-name "rrla.sj.ifsc.edu.br";
   domain-name-servers 192.168.9.254;

}

  1. Apartamento 6

subnet 192.168.10.0 netmask 255.255.255.0 {

   range 192.168.10.100 192.168.10.199;
   option routers 192.168.10.254
   domain-name "rrla.sj.ifsc.edu.br";
   domain-name-servers 192.168.10.254;

}

  1. Apartamento 7

subnet 192.168.11.0 netmask 255.255.255.0 {

   range 192.168.11.100 192.168.11.199;
   option routers 192.168.11.254
   domain-name "rrla.sj.ifsc.edu.br";
   domain-name-servers 192.168.11.254;

}

  1. Apartamento 8

subnet 192.168.12.0 netmask 255.255.255.0 { range 192.168.12.100 192.168.12.199;

   option routers 192.168.12.254
   domain-name "rrla.sj.ifsc.edu.br";
   domain-name-servers 192.168.12.254;
}

)



</syntaxhighlight>


Quarto dia (21/11)

Não foi feito nada, pois tinha prova de Gerência de redes.


Quinto dia (22/11)

ROTEAMENTO E NAT

  • vi /etc/network/interfaces


auto lo iface lo inet loopback

auto eth0 iface eth0 inet manual

auto ppp0 iface ppp0 inet manual

       pre-up pppd call rrla
       post-down killall -9 pppd


  1. Rede Interna

auto eth1 iface eth1 inet manual

  1. Rede sem fio

auto vlan4 iface vlan4 inet static

   address 192.168.4.254
   netmask 255.255.255.0
   vlan-raw-device eth1


  1. Vlan para Moradores
  2. Apartamento 1

auto vlan5 iface vlan5 inet static

   address 192.168.5.254
   netmask 255.255.255.0
   vlan-raw-device eth1
  1. Apartamento 2

auto vlan6 iface vlan6 inet static

   address 192.168.6.254
   netmask 255.255.255.0
   vlan-raw-device eth1


  1. Apartamento 3

auto vlan7 iface vlan7 inet static

   address 192.168.7.254
   netmask 255.255.255.0
   vlan-raw-device eth1


  1. Apartamento 4

auto vlan8 iface vlan8 inet static

   address 192.168.8.254
   netmask 255.255.255.0
   vlan-raw-device eth1


  1. Apartamento 5

auto vlan9 iface vlan9 inet static

   address 192.168.9.254
   netmask 255.255.255.0
   vlan-raw-device eth1


  1. Apartamento 6

auto vlan10 iface vlan10 inet static

   address 192.168.10.254
   netmask 255.255.255.0
   vlan-raw-device eth1



  1. Apartamento 7

auto vlan11 iface vlan11 inet static

   address 192.168.11.254
   netmask 255.255.255.0
   vlan-raw-device eth1



  1. Apartamento 8

auto vlan12 iface vlan12 inet static

   address 192.168.12.254
   netmask 255.255.255.0
   vlan-raw-device eth1



</syntaxhighlight>



  • vi /usr/local/sbin/eth1.up

  1. !/bin/bash

sysctl -w net.ipv4.ip_forward=1 iptables -t nat -F iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE </syntaxhighlight>

  • vi /usr/local/sbin/eth1.down

  1. !/bin/bash

sysctl -w net.ipv4.ip_forward=0 iptables -t nat -F

</syntaxhighlight>


Sexto dia (25/11)

NTP

  • aptitude install ntpdate
  • vi /etc/ntp.conf


server a.ntp.br server b.ntp.br server c.ntp.br server d.ntp.br

</syntaxhighlight>

  • service isc-dhcp-server


DNS


  • aptitude install bind9
  • vi /etc/bind/named.conf.options

options {

       listen-on { any; };
       allow-query { any; };
       allow-query-cache { any; };
       allow-recursion {
               127.0.0.0/8;
               192.168.1.0/24;
               200.135.37.0/24;
       };

};


</syntaxhighlight>


  • vi /etc/bind/named.conf.local

zone "rrlatelecom.sj.ifsc.edu.br" {

       type master;
       file "/etc/bind/rrlatelecom.sj.ifsc.edu.br";

}; zone "1.168.192 in-addr.arpa" {

       type master;
       file "/etc/bind/37.135.200 in-addr.arpa";

};


</syntaxhighlight>

  • vi /etc/bind/rrlatelecom.sj.ifsc.edu.br

$TTL 86400 @ IN SOA ns1.rrlatelecom.sj.ifsc.edu.br. dns-domain.rrlatelecom.sj.ifsc.edu.br. (

       2013112800      ;serial
               1d      ;refresh
               1h      ;retry
               1w      ;expire
               1d      ;negative cache TTL

) @ IN NS ns1.rrlatelecom.sj.ifsc.edu.br.

ns1 IN A 200.137.35.97 www IN CNAME ns1.rrlatelecom.sj.ifsc.edu.br. blog IN CNAME ns1.rrlatelecom.sj.ifsc.edu.br. site IN CNAME ns1.rrlatelecom.sj.ifsc.edu.br. ntp IN CNAME ns1.rrlatelecom.sj.ifsc.edu.br. arquivos IN CNAME ns1.rrlatelecom.sj.ifsc.edu.br.


</syntaxhighlight>

  • chmod 0755 /usr/local/sbin/eth1
  • ifdown eth0
  • ifdown eth1
  • ifup eth1
  • ifup eth0
  • service ntp restart
  • service bind9 restart

INSTALANDO E CONFIGURANDO BANCO DE DADOS

  • aptitude install apache2
  • aptitude install mysql-server
  • mysql -u root -p

senha:*************

  1. show databases;
  2. create database clientes;
  3. GRANT ALL PRIVILEGES ON clientes.* TO ‘webmaster ‘@’localhost’IDENTIFIED BY ‘senha’;
  4. FLUSH PRIVILEGES;

</syntaxhighlight>



Sétimo dia (26/11)


Tentamos configurar o banco de dados, mas nosso servidor estava com problema de DNS, então não conseguimos instalar os aplicativos necessários para configurar graficamente.


Oitavo dia (27/11)


Resolvemos o problema do DNS, desinstalando e instalando o bind9.

Instalamos os seguintes aplicativos:

xorg blackbox firefox cadaver

</syntaxhighlight>

  • aptitude install xorg blackbox firefox cadaver

Sendo assim, conseguimos acessar as configurações do roteador ADSL para testar o link.

No terminal:

  • ifconfig eth0 10.1.1.2

Para ficar na mesma faixa do roteador ADSL.

  • startx

Graficamente...com o botão direito do mouse escolha a opção xterm; Inicie o Firefox;

  • firefox

No navegador firefox coloque o o endereço de ip do roteador ADSL (10.1.1.1)






Após testarmos o link, começamos a configurar o PPPoE:

  • aptitude install pppoe


Configuramos o roteador ADSL em modo bridge. Isto tornou necessário executar um cliente PPPoE:

Criamos o arquivo:

  • vi /etc/ppp/peers/rrla com o seguinte conteúdo:

pty "/usr/sbin/pppoe -I eth0 -T 80 -m 1452 -C IER" 200.135.37.97: noipdefault usepeerdns defaultroute hide-password lcp-echo-interval 20 lcp-echo-failure 3 connect /bin/true noauth persist mtu 1492 noaccomp user rrla default-asyncmap



</syntaxhighlight>

Depois criamos o arquivo:

  • vi /etc/ppp/chap-secrets com o seguinte conteúdo:

rrla * --------- ou seja,

usuario1 * senha1

</syntaxhighlight>


Depois ativamos o enlace PPPoE, executando:

  • sudo pppd call rrla

Observamos que foi criada a interface ppp0.



Quando o computador é o cliente PPPoE, é possível monitorar as trocas de mensagens ocorridas durante o estabelecimento do enlace. Isso pode ser feito da seguinte forma:

Desativar o enlace PPPoE com este comando:

  • killall pppd

Execute o wireshark:

  • sudo wireshark

... e inicie a captura na interface eth0. Reative o enlace PPPoE:

  • sudo pppd call rrla

Visualizar no wireshark as mensagens trocadas entre seu computador e o AC.




Nono dia (28/11)


Feito alguns teste com o modem, mas o AC (Access Point) estava com problemas.




Décimo dia (29/11)


Orgzanizamos os cabos nos Rack's.




Décimo primeiro dia (2/12)


RADIUS é uma tecnologia de autenticação, autorização e contabilidade, usada para validar credenciais, autorizar certas credenciais em um recurso de rede e manter registros de tempo, detalhes da conexão e duração do acesso, respectivamente.


Instalamos o FreeRadius.

  • aptitude install freeradius
  • aptitude install freeradius freeradius-mysql freeradius-mysqlserver



Décimo segundo dia (3/12)



Criamos tabelas no banco de dados através do PHPMYADMIN, para efetuar testes com nossa página criada no NETBEANS.

Criando tabelas através do PHPMyAdmin:

  • aptitude install phpmyadmin
  • cp -r /usr/share/phpmyadmin/ /var/www/phpmyadmin

Reinicie o computador para deixar todos os pacotes 100% configurados.

Após reiniciar o computador abra o navegador do UBUNTU e entre no endereço http://localhost/phpmyadmin Aparecerá a página de login do PHPMyAdmin.

Segue abaixo um exemplo de criação de tabelas:

http://wiki.sj.ifsc.edu.br/index.php/Arquivo:Captura_de_tela_2013-11-26_%C3%A0s_20.22.27.png



Exemplo de criação de página:


http://wiki.sj.ifsc.edu.br/images/f/ff/ExemploPHP2.zip