Mudanças entre as edições de "Projeto Integrador - 2014.2 - No Pain No Gain"

De MediaWiki do Campus São José
Ir para navegação Ir para pesquisar
Linha 954: Linha 954:
 
* Instalação serviço '''CoovaChilli'''
 
* Instalação serviço '''CoovaChilli'''
  
<syntaxhighlight lang=bash> sudo apt-get install CoovaChilli
+
<syntaxhighlight lang=bash>  
 +
  wget http://ap.coova.org/chilli/coova-chilli-1.0.13.tar.gz
 +
  tar xzf coova-chilli-1.3.0.tar.gz
 +
  cd coova-chilli-1.3.0
 +
  ./configure
 +
  make
 +
  sudo make install
 
</syntaxhighlight>
 
</syntaxhighlight>

Edição das 19h53min de 10 de dezembro de 2014

No pain, no gain.jpg

Início Dia 17/11/2014

Decidimos pelo nome da equipe "No Pain, No Gain".

Escolhemos o Sistema Operacional Centos 6.6, porém só conseguiremos instala-lo no dia 18/11.

  • Informações Técnicas do Servidor:

- Processador Intel Core

- Memória RAM 1GB.

- HD 320GB.

- Placa de Rede Healtek

- Três interfaces de Rede: Onboard(1) Offboard(2)

Dia 18/11/2014

Serviços previstos:

Tivemos palestra com o Engº Patrick Soares, da empresa OI, das 19 às 20:30.

Retornamos ao Projeto Integrador na aula do Professor Fábio, de Instalação.

Tivemos problema quanto a instalação do Sistema Operacional Centos 6.6, mas no fim, conseguimos faze-la com um CD bootável. Para isso, foi preciso trocar o drive de CD da máquina do Servidor.

Instalamos os seguintes Serviços e Servidores: DHCP, DNS, PHP, MYSQL, RADIUS, APACHE

Dia 19/11/2014

Alteramos nosso Sistema Operacional para Ubuntu Server 12.04.5 LTS, pois o Centos 6.6 não era conhecido por todos da equipe e se tornaria mais difícil a sua configuração.

No entanto, tivemos problemas com a instalação do novo SO em nosso Servidor.

Por isso, trocamos nossa máquina Servidora:

  • Informações Técnicas do Servidor:

- Processador Pentium D 1.2Ghz

- Memória RAM 1,5GB.

- HD 80GB.

- Placa de Rede Healtek

- Três interfaces de Rede: Onboard(1) Offboard(2)

Dia 20/11/2014

Conseguimos instalar o Sistema Operacional Ubuntu Server.

Informações do Sistema Operacional:

Ubuntu 12.04.5 LTS Linux nopainnogain 3.2.0-23-generic-pae #36-Ubuntu SMP Tue Apr 10 22:19:09 UTC 2012 i686 i686 i386 GNU/Linux

Dividimos nossas atividades de acordo com a tabela, abaixo:

Tarefa Responsável
Programação Tiago Flores
DNS, WEB Nivaldo
EMAIL, WEBMAIL Joel
DHCP, FIREWALL, SSH Bruna
  • Atualização do Ubuntu Server, utilizando os comandos:
 sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade.
  • Instalação de alguns serviços, utilizando os comandos:
 sudo apt-get install openssh-server
sudo apt-get install isc-dhcp-server
sudo apt-get install bind9
sudo apt-get install mysql-server
sudo apt-get install php5
sudo apt-get install apache2
sudo apt-get install freeradius

- Informações do Bind9:

http://www.isc.org/downloads/bind/

BIND 9.8.1-P1 built with '--prefix=/usr' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--sysconfdir=/etc/bind' '--localstatedir=/var' '--enable-threads' '--enable-largefile' '--with-libtool' '--enable-shared' '--enable-static' '--with-openssl=/usr' '--with-gssapi=/usr' '--with-gnu-ld' '--with-geoip=/usr' '--enable-ipv6' 'CFLAGS=-fno-strict-aliasing -DDIG_SIGCHASE -O2' 'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro' 'CPPFLAGS=-D_FORTIFY_SOURCE=2'
using OpenSSL version: OpenSSL 1.0.1 14 Mar 2012
using libxml2 version: 2.7.8

- Informações do Mysql:

http://mysql.org

mysqld Ver 5.5.40-0ubuntu0.12.04.1 for debian-linux-gnu on i686 ((Ubuntu)) </syntaxhighlight>

- Informações do PHP5:

http://www.php.net

PHP 5.3.10-1ubuntu3.15 with Suhosin-Patch (cli) (built: Oct 29 2014 12:16:30) Copyright (c) 1997-2012 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies </syntaxhighlight>

- Informações do Apache:

http://www.apache.org Server version: Apache/2.2.22 (Ubuntu) Server built: Jul 22 2014 14:37:02 Server's Module Magic Number: 20051115:30 Server loaded: APR 1.4.6, APR-Util 1.3.12 Compiled using: APR 1.4.6, APR-Util 1.3.12 Architecture: 32-bit Server MPM: Prefork

 threaded:     no
   forked:     yes (variable process count)

Server compiled with....

-D APACHE_MPM_DIR="server/mpm/prefork"
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
-D APR_USE_SYSVSEM_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D DYNAMIC_MODULE_LIMIT=128
-D HTTPD_ROOT="/etc/apache2"
-D SUEXEC_BIN="/usr/lib/apache2/suexec"
-D DEFAULT_PIDLOG="/var/run/apache2.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_LOCKFILE="/var/run/apache2/accept.lock"
-D DEFAULT_ERRORLOG="logs/error_log"
-D AP_TYPES_CONFIG_FILE="mime.types"
-D SERVER_CONFIG_FILE="apache2.conf"

</syntaxhighlight>

- Informações do Freeradius:

http://www.freeradius.org

freeradius: FreeRADIUS Version 2.1.10, for host i686-pc-linux-gnu, built on Feb 24 2014 at 15:16:51 </syntaxhighlight>

Dia 21/11/2014

Tivemos quatro aulas de Cabeamento com o Professor Saul, onde pudemos realizar as seguintes atividades:

- Instalação DSLAM na sala de RedesI

- Separamos o Patch Panel, Organizadores de cabos, Switch, Bandejas do Armário e

- Definimos os 4 Pontos de Tomada (Rede e Câmera).

Dia 24/11/2014

- Configuramos o Postfix:

 sudo apt-get install postfix

Quando a tela de configuração do tipo de servidor aparecer escolher a opção SITE DA INTERNET.

No campo, Nome de email do sistema: nopainnogain.sj.ifsc.edu.br.


Arquivo /etc/postfix fazer uma copia do arquivo main.cf

cp main.cf main.cf.original </syntaxhighlight>

  1. vi main.cf

</syntaxhighlight>

Apagar tudo que está no arquivo e copiar o que está abaixo e alterar apenas o que está em negrito para a configuração.

# See /usr/share/postfix/main.cf.dist for a commented, more complete version

  1. Debian specific: Specifying a file name will cause the first
  2. line of that file to be used as the name. The Debian default
  3. is /etc/mailname.
  4. myorigin = /etc/mailname

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu) biff = no

  1. appending .domain is the MUA's job.

append_dot_mydomain = no

  1. Uncomment the next line to generate "delayed mail" warnings
  2. delay_warning_time = 4h

readme_directory = no

  1. TLS parameters

smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key smtpd_use_tls=yes smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

  1. SASL

smtp_sasl_auth_enable=yes smtp_sasl_security_options = noanonymous smtp_sasl_password_maps = hash:/etc/postfix/saslpass

  1. See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
  2. information on enabling SSL in the smtp client.

myhostname = hostname_do_seu_servidor alias_maps = hash:/etc/aliases alias_database = hash:/etc/aliases myorigin = /etc/mailname mydestination = nopainnogain.sj.ifsc.edu.br, hostname_do_seu_servidor, localhost.localdomain, localhost relayhost = smtp.nopainnogain.sj.ifsc.edu.br mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 mailbox_size_limit = 0 recipient_delimiter = + inet_interfaces = all </syntaxhighlight>

Salvar o arquivo.

Ainda na pasta do postfix (/etc/postfix), criar um arquivo chamado saslpass com o editor de texto e adicionar a seguinte linha

smtp.seudominio.com.brcontadeemail@seudominio.com.br:senhadaconta </syntaxhighlight>

Salvar o arquivo e voltar para a pasta do postfix.

Compilar o arquivo.

 sudo postmap /etc/postfix/saslpass
sudo postfix reload

Por último alterar o arquivo aliases que está em /etc/ adicionando um alias para root o arquivo deve ficar igual ao exemplo abaixo. # See man 5 aliases for format postmaster: root root: seu_email@dominio.com.br </syntaxhighlight>

Sair do arquivo e executar os seguintes comandos:

 sudo newaliases
sudo postfix reload

Testamos o Email de acordo com o texto, abaixo: > sudo service postfix restart > telnet localhost 25 220 ger ESMTP postfix (Ubuntu) helo mail 250 ger mail from: aluno@ifsc.edu.br 250 2.1.0 OK rcpt to: postmaster@gar.edu.br 250 2.1.5 OK data 354 End data with <CR><LF>.<CR><LF> subject: Teste blabla . 250 2.0.0 OK: queued as 71259CCA3 quit 221 2.0.0 Bye Connection closed by foreign host > </syntaxhighlight>

Dia 25/11/2014

Arquivo: /etc/network/interfaces

  1. The loopback network interface

auto lo eth1 eth1:0 eth0 eth0.10 eth0.20 eth0.30 iface lo inet loopback

  1. Configuração IP Principal (Modem)

iface eth1 inet static

    address 200.135.37.121
    netmask 255.255.255.192
    gateway 200.135.37.126
  1. Configuração IP Secundário (Optica)

iface eth1:0 inet static

       address 200.135.37.122
       netmask 255.255.255.192
       gateway 200.135.37.126
  1. Configuração para Vlan

iface eth0 inet static address 192.168.1.21 netmask 255.255.255.0 gateway 192.168.1.1

  1. Teste Vlan10

iface eth0.10 inet static address 192.168.10.1 netmask 255.255.255.128


  1. Teste Vlan20

iface eth0.20 inet static address 192.168.20.1 netmask 255.255.255.128

  1. Teste Vlan30

iface eth0.30 inet static address 192.168.30.1 netmask 255.255.255.128 </syntaxhighlight>

- Configuramos o DNS:

Arquivo: /etc/bind/named.conf.local

// // Do any local configuration here //

// Consider adding the 1918 zones here, if they are not used in your // organization //include "/etc/bind/zones.rfc1918";

//Zona de pesquisa direta zone "nopainnogain.sj.ifsc.edu.br" {

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

};

//Zona de pesquisa reversa zone "37.135.200.in-addr.arpa" {

      type master;
      file "/etc/bind/db.192"; 

</syntaxhighlight>

Arquivo: /etc/bind/db.nopainnogain.sj.ifsc.edu.br

BIND data file for local loopback interface

$TTL 604800 @ IN SOA nopainnogain.sj.ifsc.edu.br. root.nopainnogain.sj.ifsc.edu.br. (

                             2         ; Serial
                        604800         ; Refresh
                         86400         ; Retry
                       2419200         ; Expire
                        604800 )       ; Negative Cache TTL
               IN      A       200.135.37.121

@ IN NS ns.nopainnogain.sj.ifsc.edu.br. @ IN A 200.135.37.121 @ IN AAAA ::1 ns IN A 200.135.37.121 www IN CNAME 200.135.37.121 </syntaxhighlight>

Arquivo: /etc/bind/db.192

BIND reverse data file for local loopback interface

$TTL 604800 @ IN SOA nopainnogain.sj.ifsc.edu.br. root.napainnogain.sj.ifsc.edu.br. (

                             2         ; Serial
                        604800         ; Refresh
                         86400         ; Retry
                       2419200         ; Expire
                        604800 )       ; Negative Cache TTL

@ IN NS ns. 121 IN PTR ns.nopainnogain.sj.ifsc.edu.br. </syntaxhighlight>

- Arquivo: /etc/resolv.conf

  1. Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
  2. DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN

nameserver 200.135.37.121 nameserver 192.168.1.21 nameserver 8.8.8.8 </syntaxhighlight>

- Configuramos o Apache:

NameVirtualHost *:80

<VirtualHost *:80> DocumentRoot "/var/www/cli" ServerName www.nopainnogain.sj.ifsc.edu.br </virtualhost> Alias /webmail "/usr/share/squirrelmail/" DirectoryIndex index.php </syntaxhighlight>

Dia 26/11/2014

- Configuramos o DHCP:

Arquivo: /etc/dhcp/dhcpd.conf

  1. Tempos de Aluguel

default-lease-time 600; max-lease-time 7200;

  1. VLAN1 ETH0.10

subnet 192.168.10.0 netmask 255.255.255.0 { range 192.168.10.2 192.168.10.126; option broadcast-address 192.168.10.255; option routers 192.168.10.1; option domain-name-servers 192.168.1.21;

  1. option domain-name "nopainnogain.sj.ifsc.edu.br";

}

  1. VLAN2 ETH0.20

subnet 192.168.20.0 netmask 255.255.255.0 { range 192.168.20.2 192.168.20.126; option broadcast-address 192.168.20.255; option routers 192.168.20.1; option domain-name-servers 192.168.1.21;

  1. option domain-name "nopainnogain.sj.ifsc.edu.br";

}

  1. VLAN3 ETH0.30

subnet 192.168.30.0 netmask 255.255.255.0 { range 192.168.30.2 192.168.30.126; option broadcast-address 192.168.30.255; option routers 192.168.30.1; option domain-name-servers 192.168.1.21;

  1. option domain-name "nopainnogain.sj.ifsc.edu.br";

}

host nopainnogain { hardware ethernet 00:1a:4d:97:a4:63; fixed-address 200.135.37.121; option host-name "nopainnogain"; } </syntaxhighlight>

- Editamos a Interface que vai atender ao DHCP:

Arquivo: /etc/default/isc-dhcp-server

INTERFACES="eth1 eth1:0 eth0 eth0.10 eth0.20 eth0.30"

  1. eth0.10 VLAN1
  2. eth0.20 VLAN2
  3. eth0.30 VLAN3
  4. eth1:0 IP Secundário

</syntaxhighlight>

Para Teste de funcionalidade do DHCP, utilizamos a configuração, abaixo:

Dia 27/11/2014

- Configurando o Webmail

instalando apt-get install squirrelmail

adicionar as duas linhas abaixo no arquivo "/etc/apache2/httpd.conf": Alias /webmail "/usr/share/squirrelmail/" DirectoryIndex index.php

ir no diretório: "/usr/share/squirrelmail"

depois: "squirrelmail-configure"

vai abrir essa janela de configuração: </syntaxhighlight>

Img-336453ab.png.optimized.jpg

opção 1 define o nome da empresa: No Pain No Gain

opção 2 o dominio do servidor: nopainnogain.sj.ifsc.edu.br ainda na opção 2 configurar: 3. Sendmail or SMTP : SMTP A. Update IMAP Settings : localhost:143 (other) B. Update SMTP Settings : localhost:25 acessar a opção D e configurar o servidor IMAP conforme o dominio: nopainnogain.sj.ifsc.edu.br

S para salvar e Q para sair

Digitando http://192.168.1.21/webmail aparecerá a tela abaixo: </syntaxhighlight> Img-7993fef2.png

Dia 28/11/2014

Na aula de Cabeamento, demos continuidade à parte da infraestrutura do Projeto.

Segue principais atividades realizadas neste dia:

- Cabeamento que sai do Dslam (Lab. Redes) para o Patch Penel (próximo da Porta), 2 entradas (ADSL + Telefone) e 1 saída (SHDL);

- Duas Fusões de Fibra Óptica na entrada do Dio, (restam outras duas).

01 12 2014 19 48 10.jpg

01 12 2014 19 51 38.jpg

01 12 2014 19 50 10.jpg

- Passagem de Cabo de Fibra;

- Teste em todas tomadas, Rj45 Fêmea. Estão OK;

01 12 2014 20 02 59.jpg

- Instalação dos espelhos com molduras para as quatro tomadas;

- Fixação da bandeja para CFTV no Ármario.

Dia 01/12/2014

- Escolhemos as configurações do Firewall - IPTABLES.

Obs: Essa configuração será apenas para consulta. Pois a real ainda não está feita.

  1. PLACA DE REDE ETH0 > link de internet operadora 1
  2. PLACA DE REDE ETH1 > link de internet operadora 2
  3. PLACA DE REDE ETH2 > rede interna

Acesse as configurações padrões e insira esta abaixo:

  1. vi /etc/network/interface

Exemplo de configuração das placas:

                        1. INICIO############

auto lo iface lo inet loopback

                        1. link de internet operadora 1############

auto eth0 iface eth0 inet static address XXX.XXX.XXX.XXX netmask XXX.XXX.XXX.XXX gateway XXX.XXX.XXX.XXX

                        1. link de internet operadora 2############

auto eth1 iface eth1 inet static address XXX.XXX.XXX.XXX netmask XXX.XXX.XXX.XXX gateway XXX.XXX.XXX.XXX

                        1. link da rede interna############

auto eth2 iface eth2 inet static address XXX.XXX.XXX.XXX netmask XXX.XXX.XXX.XXX gateway XXX.XXX.XXX.XXX

                        1. FINAL############

Após as devidas configurações nas placas de redes, temos que baixar todos os pacotes necessários para a instalação de qualquer programa no sistema, com o usuário administrador “ROOT”, damos o seguinte comando:

  1. apt-get update && apt-get install vim

Após as atualizações damos inicio a configuração do script do firewall, vamos utilizar um script já pré configurado, mas antes temos que criar o arquivo e dar as permissões para execução:

  1. vi /etc/init.d/firewall

Permissões e colocar o script para executar como programa:

  1. chmod 777 /etc/init.d/firewall
  1. chmod +x /etc/init.d/firewall

Vamos agora inserir o script pré configurado com o seguinte comando:

  1. vi /etc/init.d/firewall

Agora vamos inserir o script:

                        1. INICIO############
  1. !/bin/bash
                        1. INTERFACES DOS LINKS DE INTERNET############

LINK01="eth0" LINK02="eth1"

                        1. INTERFACE DA REDE INTERNA############

INTERNA="eth2"

                        1. FAIXA DA REDE INTERNA############

REDEINTERNA="XXX.XXX.XXX.XXX/XX"

                        1. IP DA INTERFACE ETH0############

IP_LINK01="XXX.XXX.XXX.XXX/XX"

                        1. IP DA INTERFACE ETH1############

IP_LINK02="XXX.XXX.XXX.XXX./XX"

                        1. PORTAS LIBERADAS############

PORTAS_TCP="22,3128,80,21,3390,139,445,443,81,110,587,3389"

                        1. PORTAS_UDP="53,137,138,30606,3299"############

PORTAS_INTERNAS="20,21,22,3389,110,143,993,995,25,465,53,85,443,119"

                        1. PORTA PARA ACESSO REMOTO VIA TS############

PORTA_TS="3389"

                        1. PORTA TS DOS SERVIDORES############

PORTA_TS_SERVIDOR01="XXXX"

                        1. PORTA PARA ACESSO REMOTO VIA SSH############

PORTA_SSH_EXTERNO="XXXX" PORTA_SSH_INTERNO="22" IP_SERVER_SSH="XXX.XXX.XXX.XXX"

                        1. IP DO SERVIDOR 01############

IP_SERVIDOR01="XXX.XXX.XXX.XX"

                        1. IPS LIBERADOS DO PROXY############

IPS_LIBERADOS="XXX.XXX.XXX.XXX/XXX.XXX.XXX"

                        1. SERVIDOR SQUID .SERVIDOR PROXY.############

IP_SQUID="XXX.XXX.XXX.XXX"

                        1. INICIO DAS REGRAS############
                        1. Inicia as Configurações############

iniciar(){

                        1. Zerando as regras############

iptables -Z iptables -X iptables -F INPUT iptables -F OUTPUT iptables -F FORWARD iptables -F POSTROUTING -t nat iptables -F PREROUTING -t nat iptables -F -t nat iptables -t nat -F iptables -t mangle -F echo "Limpando as regras ...................................[ OK ]"

                        1. Ativa modulos no Kernel############

modprobe ip_conntrack modprobe ip_conntrack_ftp modprobe ip_nat_ftp modprobe ipt_LOG modprobe ipt_REJECT modprobe ipt_MASQUERADE modprobe ip_tables modprobe iptable_filter modprobe nf_conntrack_ipv4 echo "Modulos Ativados .....................................[ OK ]"

                        1. CRIA IDA E VOLTA DO ACESSO NAS CHAINS INPUT, OUTPUT E FORWARD############

iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT iptables -A OUTPUT -m state --state RELATED,ESTABLISHED -j ACCEPT iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT

                        1. ATRIBUINDO SEGURANCA############

echo 1 > /proc/sys/net/ipv4/tcp_syncookies

  1. Rejeitar requisicao de ICMP Echo destinado a Broadcasts e Multicasts

echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts

                        1. Proteção Contra IP Spoofing############

echo 1 > /proc/sys/net/ipv4/conf/all/rp_filter

                        1. Ativando proteção contra responses bogus############

echo 1 > /proc/sys/net/ipv4/icmp_ignore_bogus_error_responses

                        1. Permite o redirecionamento seguro dos pacotes############

echo 0 > /proc/sys/net/ipv4/conf/all/accept_redirects

                        1. Protege contra port scanners avançadas############

iptables -A FORWARD -p tcp --tcp-flags SYN,ACK,FIN,RST RST -m limit --limit 1/s -j ACCEPT

                        1. Protege contra ping da morte############

iptables -A FORWARD -p icmp --icmp-type echo-request -m limit --limit 1/s -j ACCEPT

                        1. Protege contra os ataques do tipo "Syn-flood, DoS, etc"############

iptables -A FORWARD -p tcp -m limit --limit 1/s -j ACCEPT

                        1. Logar os pacotes mortos por inatividade############

iptables -A FORWARD -m limit --limit 3/minute --limit-burst 3 -j LOG

  1. Protege contra pacotes que podem procurar e obter informacoes da rede interna

iptables -A FORWARD --protocol tcp --tcp-flags ALL SYN,ACK -j DROP

                        1. Bloqueando traceroute############

iptables -A INPUT -p udp -s 0/0 -i $INTERNA --dport 33435:33525 -j DROP

                        1. Proteções contra ataques############

iptables -A INPUT -m state --state INVALID -j DROP

                        1. Bloqueia qualquer tentativa de conexão de fora para dentro por TCP############

iptables -A INPUT -i $INTERNA -p tcp --syn -j DROP

                        1. Mesmo assim fechar todas as portas abaixo de 32000############

iptables -A INPUT -i $INTERNA -p tcp --dport :32000 -j DROP

                        1. Proteções contra ataques############

iptables -A INPUT -m state --state INVALID -j DROP

                        1. FIM DA SEGURANCA############
                        1. Liberando encaminhamento de pacotes############

echo 1 > /proc/sys/net/ipv4/ip_forward

                        1. PREROUTING############
                        1. ESTA REGRA LIBERA O IPS DO PROXY############

iptables -t nat -A PREROUTING -s $IPS_LIBERADOS -p tcp --dport 80 -j ACCEPT

                        1. REGRA PARA ACESSO VIA TERMINAL SERVER############
                        2. SERVIDOR 01############

iptables -t nat -A PREROUTING -d $IP_LINK01 -p tcp -m tcp --dport $PORTA_TS_SERVIDOR01 -j DNAT --to-destination $IP_SERVIDOR01:$PORTA_TS 

                        1. REGRA PARA ACESSO VIA PROTOCOLO SSH############

iptables -t nat -A PREROUTING -d $IP_LINK01 -p tcp -m tcp --dport $PORTA_SSH_EXTERNO -j DNAT --to-destination $IP_SERVER_SSH:$PORTA_SSH_INTERNO


                        1. Regras FORWARD PORTAS LIBERADAS PARA REDE INTERNA############

iptables -A FORWARD -s $REDEINTERNA -p tcp -m multiport --dports $PORTAS_INTERNAS -j ACCEPT

                        1. REGRA COMPARTILHAMENTO DOS LINKS############
                        1. INTERNET NOS LINKS EXTERNO PARA REDE INTERNA############

iptables -t nat -A POSTROUTING -o $LINK01 -j MASQUERADE iptables -t nat -A POSTROUTING -o $LINK02 -j MASQUERADE echo "Compartilhamento de Internet Ativados ................[ OK ]"

                        1. REGRAS DE LIBERACAO DE PORTAS############
                        1. REGRAS DE LIBERACAO DE PORTAS TCP############

iptables -A INPUT -p tcp -m multiport --dports $PORTAS_TCP -j ACCEPT iptables -A OUTPUT -p tcp -m multiport --dports $PORTAS_TCP -j ACCEPT iptables -A FORWARD -p tcp -m multiport --dports $PORTAS_TCP -j ACCEPT

                        1. REGRAS DE LIBERACAO DE PORTAS UDP############

iptables -A INPUT -p udp -m multiport --dports $PORTAS_UDP -j ACCEPT iptables -A OUTPUT -p udp -m multiport --dports $PORTAS_UDP -j ACCEPT iptables -A FORWARD -p udp -m multiport --dports $PORTAS_UDP -j ACCEPT

                        1. FIM LIBERACAO DE PORTAS############
                        1. REGRA PARA SERVIDOR PROXY "SQUID SERVIDOR SEPARADO"############

iptables -t nat -A PREROUTING -i $INTERNA -p tcp --dport 80 -j DNAT --to-destination $IP_SQUID:3128

                        1. Manter Conexar estabelecidas############

iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT

                        1. Liberando o Trafego na Interface loopback############

iptables -A INPUT -i lo -j ACCEPT

                        1. REGRA QUE BLOQUEIA TUDO O QUE NAO ESTA ACIMA############

echo "Bloqueando tudo que restou.." iptables -A INPUT -p tcp -j DROP iptables -A INPUT -p udp -j DROP iptables -A FORWARD -i $LINK01 -p tcp -j DROP iptables -A FORWARD -i $LINK01 -p udp -j DROP iptables -A FORWARD -i $LINK02 -p tcp -j DROP iptables -A FORWARD -i $LINK02 -p udp -j DROP


echo "Firewall iniciando!" } parar(){ iptables -F -t nat }

case "$1" in "start") iniciar ;; "stop") parar ;; "restart") parar; iniciar ;;

  • ) echo "Use os parâ ou stop"

esac

                        1. FIM DAS REGRAS############

OBSERVAÇÂO: Após configurar o firewall temos que colocar o script para iniciar no boot do sistema com o seguinte comando:

  1. update-rc.d firewall defaults

</syntaxhighlight>

PROGRAMAÇÃO

- O aluno Tiago já está adiantando a parte de Programação.

Já estão Prontos: Cadastro + Listagem.

Faltando apenas: Exclusão + Alterar Usuário.

01 12 2014 22 07 56.jpg

Dia 02/12/2014

Atividades:

- Terminamos as duas Fusões de Fibra Óptica que faltavam.

- Instalação do Patch Panel no Armário do Redes: Meios.

- Teste nas Fibras Ópticas, estão OK.

Dia 03/12/2014

Tivemos problemas quanto a configuração das Vlans. Mas, já atualizamos o diário.

OK3.jpg

Dia 04/12/2014

- Início da Configuração no Switch Catalyst 2960-S das Vlans.

OK2.jpg

Dia 05/12/2014

Continuamos configurando as Vlans no Switch Catalyst 2960-S.

Configurando Senhas de Acesso:

Bruna.jpg

- Exemplo de Configuração - Porta do Switch nas Vlans.

nopainnogain#enable
nopainnogain(config)#conf terminal
nopainnogain(config)#int Gi0/2 
nopainnogain(config-if)#switchport mode access
nopainnogain(config-if)#switchport access vlan 10
nopainnogain(config-if)#end

Bruna2.jpg

- Configuração da Porta Gi0/1 para mode trunk

nopainnogain#enable
nopainnogain(config)#conf terminal
nopainnogain(config)#int Gi0/1
nopainnogain(config-if)#switchport mode trunk
nopainnogain(config-if)#switchport trunk allowed vlan add 10,20,30
nopainnogain(config-if)#end

Status da Interface Gi0/1 - Trunk

nopainnogain#show interfaces Gi0/1 switchport

OKA.jpg

Para Salvar as Configurações feitas:

nopainnogain#wr mem

Dia 08/12/2014

Continuamos o trabalho iniciado no dia 05/12.

Dia 09/12/2014

Teste do funcionamento do DHCP e das Vlans no Switch.

- A interface ETH0 foi conectada na porta Trunk Gi0/1.

- Um cabo de rede foi conectado em uma das portas vínculadas às Vlans e no Computador para teste.

- Gi0/2 a Gi0/6 - Vlan 10

- Gi0/7 a Gi0/11 - Vlan 20

- Gi0/12 a Gi0/16 - Vlan 30

- Demos o Comando 'dhclient -v eth1' no Computador.

- Os testes foram executados com Sucesso, nossas Vlans foram configuradas corretamente.

- Vlan 10 OK.

OK.jpg


- Vlans 20 e 30 OK.

OK1.jpg


PROBLEMA

Através do Professor Casagrande, recebemos uma notícia não muito agradável à Equipe.

Todo nosso trabalho, até o momento, de Cabeamento foi desinstalado do laboratório de Meios por outra TURMA.

Ou seja, perdemos toda a parte de Infraestrutura que havíamos feito.

Nesse caso, não sabemos qual será a medida adotada pelos Professores para reverter esse cenário.

Pois, o trabalho de Cabeamento foi feito em 3 semenas. Como podemos resolver isso faltando apenas 3 dias para a apresentação do Projeto?!?!

Fica aqui registrado nosso descontentamento perante a situação.

Dia 10/12/2014

Acabamos de saber pelo Professor Saul que não será preciso refazer a parte do Cabeamento do Projeto.

Segundo o Profº, nós já fomos avaliados durante todos os dias que trabalhamos em cima da Infraestrutura do Projeto.

Dessa forma, passamos a trabalhar, agora, apenas no Servidor.

  • Instalação serviço CoovaChilli
 
  wget http://ap.coova.org/chilli/coova-chilli-1.0.13.tar.gz
  tar xzf coova-chilli-1.3.0.tar.gz
  cd coova-chilli-1.3.0
  ./configure
  make
  sudo make install