Projeto Integrador - 2013.1 - Pois Agora

De MediaWiki do Campus São José
Ir para navegação Ir para pesquisar

Equipe Pois Agora

  • Gabriel Souza
  • Gustavo Silva
  • João Martins
  • Kauly Bohm


08/07/2013

- Decidimos o nome da equipe; (Pois Agora)

- Pensamos Sobre o esqueleto do projeto;

- Pensamos sobre algumas soluções(restabelecimento do serviços; configuração de: DHCP, DNS e SMTP; Backup);

- Pensamos sobre algumas etapas em referência à matéria de programação (teste de portas abertas; teste de serviços rodando);

- Fizemos verificações de comandos para analisar se estes podem ser incluídos no projeto;

09/07/2013

- Instalamos o Ubuntu-server em duas máquinas: filial e matriz;

- Feito a configuração das interfaces eth0 de cada unidade inserindo nas mesmas os IPs válidos disponibilizados com a máscara 255.255.255.192:

vi /etc/network/interfaces </syntaxhighlight> Matriz: auto eth0 iface eth0 inet static address 200.135.37.97 netmask 255.255.255.192 gateway 200.135.37.126 </syntaxhighlight> Filial: auto eth0 iface eth0 inet static

address 200.135.37.101 netmask 255.255.255.192 gateway 200.135.37.126 </syntaxhighlight>

- Restartamos o serviço para validar as informações:
/etc/init.d/networking restart </syntaxhighlight>

- Realizado a instalação do ssh em ambas as máquinas;

aptitude install ssh </syntaxhighlight>

- Passamos o cabeamento no RAC reservado para os IPs válidos;

- Conseguimos acesso com sucesso nos dois servidores via SSH;

teste@iteste:~$ ssh root@200.135.37.97 +-----------------+ |EQUIPE POIS AGORA| | ACESSO RESTRITO | +-----------------+ root@200.135.37.97's password:


teste@iteste:~$ ssh root@200.135.37.101 +-----------------+ |EQUIPE POIS AGORA| | ACESSO RESTRITO | +-----------------+ root@200.135.37.97's password:

</syntaxhighlight>

- Iniciamos a configuração do NTOP;

aptitude install ntop </syntaxhighlight> Colocamos uma senha de administração: ntop -A ******* </syntaxhighlight> service ntop restart </syntaxhighlight>

- Instalamos e configuramos o servidor DNS para resolver os nomes com master e slave. O master fica na matriz e caso a matriz esteja fora por algum motivo o slave que está na filial responde:

Filial e Matriz: aptitude instal bind9 bind9utils </syntaxhighlight> Matriz: vi /etc/bind/named.conf.local

zone "poisagora.sj.ifsc.edu.br" { type master; file "/etc/bind/zones/pa.zone"; };

  1. Zona reversa

zone "37.135.200.in-addr.arpa" { type master; file "/etc/bind/zones/rev.37.135.200.in-addr.arpa"; }; </syntaxhighlight> Filial: vi /etc/bind/named.conf.local

zone "poisagora.sj.ifsc.edu.br" IN { type slave; file "/etc/bind/db.slave"; masters {200.135.37.97;}; };

  1. Zona reversa

zone "37.135.200.in-addr.arpa" { type slave; file "/etc/bind/db.37.135.200"; masters {200.135.37.97;}; }; </syntaxhighlight>

Matriz:

vi /etc/bind/zones/pa.zone

@ IN SOA ns1.poisagora.sj.ifsc.edu.br. admin.ns1.poisagora.sj.ifsc.edu.br. (

                       2013071900 ; Serial
                       28800 ; Refresh
                       3600 ; Retry
                       604800 ; Expire
                       38400 ) ; Default TTL
               NS      ns1.poisagora.sj.ifsc.edu.br.
               MX      10 mta.poisagora.sj.ifsc.edu.br.
               IN      A 200.135.37.97

$ORIGIN poisagora.sj.ifsc.edu.br. ns1 IN A 200.135.37.97 mta IN A 200.135.37.97 www IN A 200.135.37.97 web IN CNAME www matriz IN A 200.135.37.97 filial IN A 200.135.37.101 slave IN A 200.135.37.101

vi /etc/bind/zones/rev.37.135.200.in-addr.arpa

$ORIGIN 37.135.200.in-addr.arpa. @ IN SOA ns1.poisagora.sj.ifsc.edu.br. admin.ns1.poisagora.sj.ifsc.edu.br. ( 2013071902; 28800; 604800; 604800; 86400 )

       IN      NS      ns1.poisagora.sj.ifsc.edu.br.
       IN      NS      ns2.poisagora.sj.ifsc.edu.br.

97 IN PTR ns1.poisagora.sj.ifsc.edu.br. 97 IN PTR matriz.poisagora.sj.ifsc.edu.br. 97 IN PTR mta.poisagora.sj.ifsc.edu.br. 97 IN PTR www.poisagora.sj.ifsc.edu.br. 101 IN PTR filial.poisagora.sj.ifsc.edu.br.

</syntaxhighlight>

- Instalamos o Apache e editamos a página default com o nome da equipe apenas para testes.

aptitude install apache2 apache2-utils </syntaxhighlight> adicionamos no arquivo: vi /etc/apache2/sites-available/default

ServerName www.poisagora.sj.ifsc.edu.br ServerAlias *.poisagora.sj.ifsc.edu.br ServerAdmin poisagora@poisagora.sj.ifsc.edu.br </syntaxhighlight> vi /var/www/index.html


<html>

<head>

<blink>POISAGORA?</blink>

</head>

<body>

Equipe:
Gabriel
Gustavo
Joao
Kauly <a href="http://200.135.37.97:3000">NTOP</a>

</body> </html>

</syntaxhighlight>

10/07/2013

- Instalamos o postfix e configuramos;

sudo apt-get install postfix mailutils </syntaxhighlight> vi /etc/postfix/main.cf

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu) biff = no append_dot_mydomain = no readme_directory = no smtpd_use_tls=yes smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache myhostname = mta.poisagora.sj.ifsc.edu.br mydomain = poisagora.sj.ifsc.edu.br alias_maps = hash:/etc/aliases alias_database = hash:/etc/aliases myorigin = $mydomain mydestination = $myhostname, localhost, $mydomain relayhost = mynetworks = 127.0.0.0/8 192.168.1.0/24 200.135.37.0/26 mailbox_size_limit = 0 recipient_delimiter = + inet_interfaces = all home_mailbox = Maildir/ message_size_limit = 10240000 mailbox_command =

      1. SASL###

smtpd_sasl_local_domain = smtpd_sasl_auth_enable = yes smtpd_sasl_security_options = noanonymous broken_sasl_auth_clients = yes smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination smtpd_tls_security_level = may smtpd_tls_auth_only = no smtp_tls_note_starttls_offer = yes smtpd_tls_key_file = /etc/ssl/private/smtpd.key smtpd_tls_cert_file = /etc/ssl/certs/smtpd.crt smtpd_tls_CAfile = /etc/ssl/certs/cacert.pem smtpd_tls_loglevel = 1 smtpd_tls_received_header = yes smtpd_tls_session_cache_timeout = 3600s tls_random_source = dev:/dev/urandom inet_protocols = all

</syntaxhighlight>

- Mexemos na configuração do DNS, (MASTER e SLAVE).

- Fizemos prova de IER nas duas últimas aulas;

11/07/2013

- Tivemos explicação sobre cabeamento no projeto integrador;

- Prova nas duas últimas aulas de cabeamento;

12/07/2013

- Configuramos o MUA com autenticação SASL e instalamos e testamos com o MUTT;

Instalando o Mutt: apt-get install mutt </syntaxhighlight>

No home do usuário: vi .muttrc

et certificate_file=~/.mutt_certificates set mbox_type=Maildir # Usar Maildir set folder=imaps://filial@mta.poisagora.sj.ifsc.edu.br # onde eu mantenho minhas pastas set spoolfile=imaps://filial@mta.poisagora.sj.ifsc.edu.br/INBOX # onde os novos mails ficam set smtp_url=smtp://filial@mta.poisagora.sj.ifsc.edu.br set from="filial@poisagora.sj.ifsc.edu.br" set realname="Filial" set smtp_authenticators="plain:login"

set ascii_chars # use ASCII instead of ACS chars for threads set autoedit # go to the editor right away when composing set noconfirmappend # don't ask me if i want to append to mailboxes set delete=yes # purge deleted messages without asking set edit_headers # let me edit the message header when composing set editor="vi" # editor to use when composing messages </syntaxhighlight>

Configurando autenticação SASL: cat /etc/postfix/sasl/smtpd.conf pwcheck_method: saslauthd mech_list: plain login </syntaxhighlight>

Gerando os certificados: touch smtpd.key chmod 600 smtpd.key openssl genrsa 1024 > smtpd.key openssl req -new -key smtpd.key -x509 -days 3650 -out smtpd.crt openssl req -new -x509 -extensions v3_ca -keyout cakey.pem -out \ cacert.pem -days 3650 sudo mv smtpd.key /etc/ssl/private/ sudo mv smtpd.crt /etc/ssl/certs/ sudo mv cakey.pem /etc/ssl/private/ sudo mv cacert.pem /etc/ssl/certs/ </syntaxhighlight>

Instalando os pacotes SASL: sudo apt-get install libsasl2-2 sasl2-bin libsasl2-modules mkdir /var/spool/postfix/var/run/saslauthd root@Matriz:/var/spool/postfix/var/run/saslauthd# cat /etc/default/saslauthd

START=yes NAME="saslauthd" MECHANISMS="shadow" #Pega senha do usuário no sistema. THREADS=5 OPTIONS="-c -m /var/spool/postfix/var/run/saslauthd" PWDIR="/var/spool/postfix/var/run/saslauthd" PARAMS="-m ${PWDIR}" PIDFILE="${PWDIR}/saslauthd.pid" </syntaxhighlight>

Instalando servidor IMAP: apt-get install courier-imap apt-get install courier-imap-ssl </syntaxhighlight>

- Instalamos o SAMBA, porém não terminamos de configurar;

Matriz: aptitude install samba smbfs </syntaxhighlight> Filial aptitude install smbfs smbclient </syntaxhighlight>

- Instalamos o OpenVPN, porém não terminamos de configurar;

aptitude install openvpn bridge-utils </syntaxhighlight>

- Configuramos a BIOS dos servidores para que eles liguem automaticamente, quando tiver queda de energia;

15/07/2013

- Terminamos de configurar o OpenVPN;

- Arquivo de configuração VPN - servidor (/etc/openvpn/server.conf): vi /etc/openvpn/server.conf

up "/etc/openvpn/up.sh br0 tap0 1500" down "/etc/openvpn/down.sh br0 tap0" local 200.135.37.97 port 1194 proto udp dev tap0 ca ca.crt cert servidor.crt key servidor.key # This file should be kept secret dh dh1024.pem ifconfig-pool-persist ipp.txt server-bridge 10.10.10.1 255.255.255.0 10.10.10.100 10.10.10.150 push "redirect-gateway def1" push "dhcp-option DNS 200.135.37.97" keepalive 10 120 tls-auth ta.key 0 # This file is secret comp-lzo user nobody group nogroup persist-key persist-tun status openvpn-status.log verb 3 </syntaxhighlight>

- Arquivo de configuração VPN - cliente (/etc/openvpn/client.conf): vi /etc/openvpn/client.conf

up "/etc/openvpn/up.sh br0 tap0 1500" down "/etc/openvpn/down.sh br0 tap0" local 200.135.37.97 port 1194 proto udp dev tap0 ca ca.crt cert servidor.crt key servidor.key # This file should be kept secret dh dh1024.pem ifconfig-pool-persist ipp.txt server-bridge 10.10.10.1 255.255.255.0 10.10.10.100 10.10.10.150 push "redirect-gateway def1" push "dhcp-option DNS 200.135.37.97" keepalive 10 120 tls-auth ta.key 0 # This file is secret comp-lzo user nobody group nogroup persist-key persist-tun status openvpn-status.log verb 3 </syntaxhighlight> - Como ficou o /etc/network/interfaces na matriz (servidor): auto lo eth0 br0 iface lo inet loopback

iface eth0 inet static

pre-up iptables-restore < /etc/iptables.up.rules

address 200.135.37.97 netmask 255.255.255.192 gateway 200.135.37.126

iface br0 inet static address 10.10.10.1 netmask 255.255.255.0 bridge_ports eth2

  1. bridge_fd 9
  2. bridge_hello 2
  3. bridge_maxage 12
  4. bridge_stp off

iface eth2 inet manual up ip link set $IFACE up promisc on down ip link set $IFACE down promisc off </syntaxhighlight>

Necessário ativar o IP Forwarding além do NAT na matriz: echo 1 > /proc/sys/net/ipv4/ip_forward iptables -t nat -A POSTROUTING -o * -j MASQUERADE

  • No lugar do asterisco devemos inserir a interface na qual está configurado o IP que o cliente vai se conectar.

</syntaxhighlight>

- Instalamos e configuramos o DHCP;

install dhcp3-server </syntaxhighlight> MATRIZ:

vi /etc/dhcp3/dhcpd.conf

shared-network LOCAL-NET {

       option domain-name "poisagora.sj.ifsc.edu.br";
       option domain-name-servers 10.10.10.1, 200.135.37.97;
       subnet 10.10.10.0 netmask 255.255.255.0 {
               option routers 10.10.10.1;
               range 10.10.10.1 10.10.10.99;
       }

} </syntaxhighlight> Restartamos o serviço para aplicar as configurações: /etc/init.d/dhcp3-server start </syntaxhighlight>

FILIAL:

vi /etc/dhcp3/dhcpd.conf

ddns-update-style none;

  1. option domain-name "poisagora.sj.ifsc.edu.br";
  2. option domain-name-servers 10.10.10.1, 200.135.37.101;

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

log-facility local7;

shared-network LOCAL-NET { option domain-name "poisagora.sj.ifsc.edu.br"; option domain-name-servers 10.10.10.1, 200.135.37.101; subnet 10.0.0.0 netmask 255.255.255.0 { option routers 10.0.0.1; range 10.0.0.10 10.0.0.30;

} } </syntaxhighlight>

Criamos uma nova rede (10.0.0.0), no qual uma interface do servidor filial irá entregar IPs à estações de trabalho. Nesse caso subimos uma interface virtual para ilustrar como ficaria: </syntaxhighlight> eth0:1 Link encap:Ethernet HWaddr 00:1d:7d:82:85:2a

         inet addr:10.0.0.1  Bcast:10.0.0.255  Mask:255.255.255.0
         UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
         Interrupt:21 

</syntaxhighlight>

16/07/2013

- Terminamos de configurar o SAMBA;

Configuração do samba: root@Matriz: cat /etc/samba/smb.conf [global] workgroup = POISAGORA server string = Servidor de Usuarios load printers = no printcap cache time = 60 printing = cups log file = /var/log/samba/%m.log log level = 1 debug level = 2 max log size = 50 hosts allow = 200.135.37. 127. map to guest = bad user security = user encrypt passwords = yes smb passwd file = /etc/samba/smbpasswd dns proxy = no

  1. =========================== Share Definitions ==============================

[homes] #Todas as pastas do diretório /home compartilhadas# browseable = no writable = yes public = yes </syntaxhighlight>

Criando usuário no Samba:

  1. smbpasswd -a usuario
  2. O usuário utilizado no Samba já deve estar criado no Linux também.

</syntaxhighlight>

Montando diretório no cliente: root@Filial:/home/filialpoisagora# mount -t cifs -o username=root //200.135.37.97/filial /home/filial Password: root@Filial:/home/filialpoisagora# df -h Filesystem Size Used Avail Use% Mounted on /dev/sda1 71G 997M 67G 2% / none 493M 224K 493M 1% /dev none 498M 0 498M 0% /dev/shm none 498M 60K 497M 1% /var/run none 498M 0 498M 0% /var/lock none 498M 0 498M 0% /lib/init/rw none 71G 997M 67G 2% /var/lib/ureadahead/debugfs //200.135.37.97/filial

                     144G  1,2G  136G   1% /home/filial

</syntaxhighlight>

- Testamos o DHCP no servidor da MATRIZ;

17/07/2013

- Mudamos os arquivo de Hosts;

Inluimos na:

Matriz: vi /etc/hosts

10.10.10.100 filial </syntaxhighlight> Filial vi /etc/hosts

10.10.10.1 matriz </syntaxhighlight>

- Configuramos o acesso ao ssh sem senha entre matriz<->filial;

Matriz: ssh-keygen -t dsa -f ~/.ssh/id_dsa cat ~/.ssh/id_dsa.pub | ssh root@filial 'cat - >> ~/.ssh/authorized_keys' cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys </syntaxhighlight> Filial: ssh-keygen -t dsa -f ~/.ssh/id_dsa cat ~/.ssh/id_dsa.pub | ssh root@matriz 'cat - >> ~/.ssh/authorized_keys' cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys </syntaxhighlight>

18 e 19/07/2013

- Utilizamos o Iptables para estabelecer algumas regras:

  • Utilizamos as mesmas regras na filial e matriz.

root@Matriz:/etc# iptables-save

  1. Generated by iptables-save v1.4.4 on Tue Jul 30 19:14:30 2013
  • mangle
PREROUTING ACCEPT [558977:69104787]
INPUT ACCEPT [548575:67191946]
FORWARD ACCEPT [10154:1875000]
OUTPUT ACCEPT [688043:157207437]
POSTROUTING ACCEPT [700565:159655493]

COMMIT

  1. Completed on Tue Jul 30 19:14:30 2013
  2. Generated by iptables-save v1.4.4 on Tue Jul 30 19:14:30 2013
  • filter
INPUT DROP [383:71494]
FORWARD ACCEPT [2706:743354]
OUTPUT ACCEPT [59683:7370828]

-A INPUT -i eth0 -p udp -m udp --dport 53 -j ACCEPT (DNS) -A INPUT -i eth0 -p tcp -m tcp --dport 22 -j ACCEPT (SSH) -A INPUT -i eth0 -p tcp -m tcp --dport 25 -j ACCEPT (SMTP) -A INPUT -i eth0 -p udp -m udp --dport 1194 -j ACCEPT (VPN) -A INPUT -i eth0 -p tcp -m tcp --dport 1194 -j ACCEPT (VPN) -A INPUT -i eth0 -p tcp -m tcp --dport 80 -j ACCEPT (HTTP) -A INPUT -s 200.135.37.64/26 -j ACCEPT (acesso totalmente liberado à rede em questão) -A INPUT -s 10.10.10.0/24 -j ACCEPT (acesso liberado à rede da VPN) -A INPUT -p icmp -j ACCEPT (PING) -A INPUT -i lo -j ACCEPT (loopback) -A INPUT -p tcp -m tcp --dport 53 -j ACCEPT (respostas de DNS, ou seja, liberamos tudo que chega na porta 53) -A INPUT -i eth0 -p udp -m udp --sport 53 -j ACCEPT (respostas de DNS, ou seja, liberamos tudo que vem com origem na porta 53) COMMIT

  1. Completed on Tue Jul 30 19:14:30 2013
  2. Generated by iptables-save v1.4.4 on Tue Jul 30 19:14:30 2013
  • nat
PREROUTING ACCEPT [3786:313589]
POSTROUTING ACCEPT [14144:1054927]
OUTPUT ACCEPT [19756:1493903]

-A POSTROUTING -o eth0 -j MASQUERADE COMMIT

  1. Completed on Tue Jul 30 19:14:30 2013

</syntaxhighlight>

20/07/2013

- Instalação de equipamentos de rede, descrição de ADSL e instalação;

- O modem ADSL faz a conversão do sinal digital para sinal analógico para transmissão em distâncias grandes com um par de cabos. Conectamos a outra ponta do cabo do modem no DSLAN que faz a conversão do sinal analógico para o digital e é conectado ao servidor PPPOE. O modem foi configurado em modo bridging para não fazer nat, e o ip ser atribuido no cliente pppoe. O cliente faz autenticação no servidor pppoe com login e senha.

21/07/2013

- Criamos e aplicamos os Scripts de SLA;

Aplicamos regras na crontab que rodam scripts verificadores a cada tempo definido, para garantir que os serviços voltem a funcionar no período estabelecido. Os scripts verificam se o programa está rodando, caso não esteja ele restarta-o. Matriz: crontab -e

  1. m h dom mon dow command
  • * * * * /etc/sla/estabelecer_vpn_matriz.sh
  • /3 * * * * /etc/sla/restabelecer_dns.sh
  • /3 * * * * /etc/sla/restabelecer_postfix.sh
  • /3 * * * * /etc/sla/restabelecer_dhcp.sh

</syntaxhighlight>

vi /etc/sla/estabelecer_vpn_matriz.sh

  1. !/bin/bash

if [ "$(netstat --program|grep open| wc -l)" -eq "0" ]

       then
              pkill openvpn > /dev/null 2> /dev/null
              cd /etc/openvpn
              service openvpn restart > /dev/null 2> /dev/null

fi sleep 30 if [ "$(netstat --program|grep open| wc -l)" -eq "0" ]

       then
              pkill openvpn > /dev/null 2> /dev/null
              cd /etc/openvpn
              service openvpn restart > /dev/null 2> /dev/null

fi </syntaxhighlight>

vi /etc/sla/restabelecer_dns.sh

  1. !/bin/bash

if [ "$(netstat --program|grep named| wc -l)" -eq "0" ]

       then
              pkill named > /dev/null 2> /dev/null
              service bind9 restart > /dev/null 2> /dev/null

fi </syntaxhighlight>

vi /etc/sla/restabelecer_postfix.sh

  1. !/bin/bash

if [ "$(netstat --program|grep master| wc -l)" -eq "0" ]

       then
              service postfix stop > /dev/null 2> /dev/null
              service postfix restart > /dev/null 2> /dev/null

fi </syntaxhighlight> vi /etc/sla/restabelecer_dhcp.sh

  1. !/bin/bash

if [ "$(netstat --program|grep dhcpd3| wc -l)" -eq "0" ]

       then
              pkill dhcpd3 > /dev/null 2> /dev/null
              /etc/init.d/dhcp3-server start > /dev/null 2> /dev/null

fi </syntaxhighlight>

Filial: crontab -e

  1. m h dom mon dow command
  • * * * * /etc/sla/estabelecer_vpn.sh
  • /3 * * * * /etc/sla/restabelecer_postfix.sh
  • /3 * * * * /etc/sla/restabelecer_dns.sh

</syntaxhighlight> vi /etc/sla/estabelecer_vpn.sh

  1. !/bin/bash

/sbin/route add -host 200.135.37.101 gw 200.135.37.126 /sbin/route del default gw 200.135.37.126 > /dev/null 2> /dev/null /sbin/route add default gw 10.10.10.1 > /dev/null 2> /dev/null

if [ "$(nmap -p22 10.10.10.1|grep open| wc -l)" -eq "0" ]

       then
               pkill openvpn > /dev/null 2> /dev/null
               cd /etc/openvpn
               service openvpn restart > /dev/null 2> /dev/null

fi

sleep 30

/sbin/route add -host 200.135.37.101 gw 200.135.37.126 /sbin/route del default gw 200.135.37.126 > /dev/null 2> /dev/null /sbin/route add default gw 10.10.10.1 > /dev/null 2> /dev/null

if [ "$(nmap -p22 10.10.10.1|grep open| wc -l)" -eq "0" ]

       then
               pkill openvpn > /dev/null 2> /dev/null
               cd /etc/openvpn
               service openvpn restart > /dev/null 2> /dev/null

/sbin/route add -host 200.135.37.101 gw 200.135.37.126 /sbin/route del default gw 200.135.37.126 > /dev/null 2> /dev/null /sbin/route add default gw 10.10.10.1 > /dev/null 2> /dev/null

fi </syntaxhighlight> vi /etc/sla/restabelecer_dns.sh

  1. !/bin/bash

if [ "$(netstat --program|grep named| wc -l)" -eq "0" ]

       then
              pkill named > /dev/null 2> /dev/null
              service bind9 restart > /dev/null 2> /dev/null

fi </syntaxhighlight> vi /etc/sla/restabelecer_postfix.sh

  1. !/bin/bash

if [ "$(netstat --program|grep master| wc -l)" -eq "0" ]

       then
              service postfix stop > /dev/null 2> /dev/null
              service postfix restart > /dev/null 2> /dev/null

fi </syntaxhighlight>

- Criamos e aplicamos os scripts de Backup;

Na crontab aplicamos regras para serem aplicadas ao meio dia e meia noite. O script de backup simplismente salva os arquivos compactados com a hora e data incluso no nome no diretório de backup. O script verificador serve para garantir que tenhamos no máximo os 30 backups mais recentes. Na filial o script envia por ssh com configuração para não pedir senha no diretório de backup.

Matriz: crontab -e

0 12 * * * /etc/sla/script_backup_matriz.sh 0 0 * * * /etc/sla/script_backup_matriz.sh 0 1 * * * /etc/sla/verificador_backup.sh 0 13 * * * /etc/sla/verificador_backup.sh </syntaxhighlight> vi /etc/sla/script_backup_matriz.sh

  1. !/bin/bash

tar -cf /backups/matriz/backup_$(date "+%H%d%m%Y").tar.gz /etc /home </syntaxhighlight> vi /etc/sla/verificador_backup.sh

  1. !/bin/bash

if [ "$(ls -lt /backups/matriz | wc -l)" -ge "31" ] then

               rm -f $(ls -lt /backups/matriz | tail -n 1 | cut -d" " -f8)

fi if [ "$(ls -lt /backups/filial | wc -l)" -ge "31" ] then

               rm -f $(ls -lt /backups/filial | tail -n 1 | cut -d" " -f8)

fi </syntaxhighlight>

Filial: crontab -e

0 12 * * * /etc/sla/script_backup_filial.sh 0 0 * * * /etc/sla/script_backup_filial.sh </syntaxhighlight> vi /etc/sla/script_backup_filial.sh

  1. !/bin/bash

tar zcvf - /etc /home | ssh matriz cat ">" /backups/filial/backup_$(date "+%H%d%m%Y").tar.gz </syntaxhighlight>

25/07/2013

- Instalmos e configuramos o PPPoE;

aptitude install pppoe </syntaxhighlight>

Descomentamos a linha e adicionamos o ip abaixo dela:

Matriz: vi /etc/ppp/peers/dsl-provider

  1. pty "/usr/sbin/pppoe -I eth0 -T 80 -m 1452"

200.135.37.97: </syntaxhighlight> Filial: vi /etc/ppp/peers/dsl-provider

  1. pty "/usr/sbin/pppoe -I eth0 -T 80 -m 1452"

200.135.37.101: </syntaxhighlight> Fizemos a conexão com o servidor pppoe com o comando, colocando nosso login e senha quando perguntado: pppoeconf </syntaxhighlight>

26/07/2013

- Trabalhamos na parte da planta do cabeamento;

29/07/2013

- Tiramos dúvida quanto a aplicação de regras de cabeamento para aplicarmos no projeto;

- Editamos a wiki;

30/07/2013

- Editamos a wiki;

- Começamos a fazer os slides para apresentação;

31/07/2013

- Entregamos a planta de Cabeamento;

IMG 20130731 201202.jpg Imagempoisagora2.jpg Imagempoisagora3.jpg