Projeto Integrador - 2014.2 - No Pain No Gain

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, FIREWALL | Tiago Flores |
DNS, WEB | Nivaldo |
EMAIL, WEBMAIL | Joel |
DHCP, 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:
mysqld Ver 5.5.40-0ubuntu0.12.04.1 for debian-linux-gnu on i686 ((Ubuntu))
</syntaxhighlight>
- Informações do PHP5:
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:
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>
- 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
- Debian specific: Specifying a file name will cause the first
- line of that file to be used as the name. The Debian default
- is /etc/mailname.
- myorigin = /etc/mailname
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
- appending .domain is the MUA's job.
append_dot_mydomain = no
- Uncomment the next line to generate "delayed mail" warnings
- delay_warning_time = 4h
readme_directory = no
- 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
- SASL
smtp_sasl_auth_enable=yes
smtp_sasl_security_options = noanonymous
smtp_sasl_password_maps = hash:/etc/postfix/saslpass
- See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
- 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
- The loopback network interface
auto lo eth0 eth0.10 eth0.20 eth0.30 eth1
iface lo inet loopback
- Configuração IP Principal
iface eth1 inet static
address 200.135.37.121
netmask 255.255.255.192
gateway 200.135.37.126
- Configuração IP Secundário
iface eth1:0 inet static
address 200.135.37.122
netmask 255.255.255.192
- Configuração para Vlan
iface eth0 inet static
address 192.168.1.21
netmask 255.255.255.0
- Teste Vlan10
iface eth0.10 inet static
address 192.168.10.1
netmask 255.255.255.128
- Teste Vlan20
iface eth0.20 inet static
address 192.168.20.1
netmask 255.255.255.128
- Teste Vlan30
iface eth0.30 inet static
address 192.168.30.1
netmask 255.255.255.128
auto vlan30
iface vlan20 inet manual
vlan-raw-device eth0
auto vlan20
iface vlan30 inet manual
vlan-raw-device eth0
auto vlan10
iface vlan10 inet manual
vlan-raw-device eth0
</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
- Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
- 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
- Tempos de Aluguel
default-lease-time 600;
max-lease-time 7200;
- 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;
- option domain-name "nopainnogain.sj.ifsc.edu.br";
}
- 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;
- option domain-name "nopainnogain.sj.ifsc.edu.br";
}
- 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;
- 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"
- eth0.10 VLAN1
- eth0.20 VLAN2
- eth0.30 VLAN3
- eth1:0 IP Secundário
</syntaxhighlight>
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>
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>
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).
- Passagem de Cabo de Fibra;
- Teste em todas tomadas, Rj45 Fêmea. Estão OK;
- Instalação dos espelhos com molduras para as quatro tomadas;
- Fixação da bandeja para CFTV no Ármario.
Dia 01/12/2014
- Programação.
Já estão Prontos: Cadastro + Listagem.
Faltando apenas: Exclusão + Alterar Usuário.
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.
Dia 04/12/2014
- Início da Configuração no Switch Catalyst 2960-S das Vlans.
Dia 05/12/2014
Continuamos configurando as Vlans no Switch Catalyst 2960-S.
Configurando Senhas de Acesso:
- 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
- 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
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.
- Vlans 20 e 30 OK.
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
- Configuração do Access Point, Passo a Passo:
- Configuração do Modem, Passo a Passo:
Dia 11/12/2014
- Esquema do Cabeamento
- Configurações do Chilli - IPTABLES
root@nopainnogain# cat iptables
- Generated by iptables-save v1.4.12 on Thu Dec 11 21:45:20 2014
- nat
- PREROUTING ACCEPT [3013:246807]
- INPUT ACCEPT [383:24225]
- OUTPUT ACCEPT [543:42732]
- POSTROUTING ACCEPT [543:42732]
-A POSTROUTING -s 192.168.0.0/16 -o eth1 -j MASQUERADE
COMMIT
- Completed on Thu Dec 11 21:45:20 2014
- Generated by iptables-save v1.4.12 on Thu Dec 11 21:45:20 2014
- mangle
- PREROUTING ACCEPT [21386:2665336]
- INPUT ACCEPT [18110:2150403]
- FORWARD ACCEPT [959:249396]
- OUTPUT ACCEPT [14653:2879551]
- POSTROUTING ACCEPT [15612:3128947]
-A FORWARD -p tcp -m tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
-A FORWARD -p tcp -m tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
-A FORWARD -p tcp -m tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
-A FORWARD -p tcp -m tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
COMMIT
- Completed on Thu Dec 11 21:45:20 2014
- Generated by iptables-save v1.4.12 on Thu Dec 11 21:45:20 2014
- filter
- INPUT ACCEPT [17683:2082655]
- FORWARD ACCEPT [0:0]
- OUTPUT ACCEPT [14653:2879551]
-A INPUT -i eth0.30 -j DROP
-A INPUT -d 192.168.30.1/32 -i tun3 -p icmp -j ACCEPT
-A INPUT -d 192.168.30.1/32 -i tun3 -p udp -m udp --dport 53 -j ACCEPT
-A INPUT -d 192.168.30.1/32 -i tun3 -p udp -m udp --dport 67:68 -j ACCEPT
-A INPUT -d 255.255.255.255/32 -i tun3 -p udp -m udp --dport 67:68 -j ACCEPT
-A INPUT -d 192.168.30.1/32 -i tun3 -p tcp -m tcp --dport 4300 -j ACCEPT
-A INPUT -d 192.168.30.1/32 -i tun3 -p tcp -m tcp --dport 3300 -j ACCEPT
-A INPUT -i eth0.20 -j DROP
-A INPUT -d 192.168.20.1/32 -i tun2 -p icmp -j ACCEPT
-A INPUT -d 192.168.20.1/32 -i tun2 -p udp -m udp --dport 53 -j ACCEPT
-A INPUT -d 192.168.20.1/32 -i tun2 -p udp -m udp --dport 67:68 -j ACCEPT
-A INPUT -d 255.255.255.255/32 -i tun2 -p udp -m udp --dport 67:68 -j ACCEPT
-A INPUT -d 192.168.20.1/32 -i tun2 -p tcp -m tcp --dport 4200 -j ACCEPT
-A INPUT -d 192.168.20.1/32 -i tun2 -p tcp -m tcp --dport 3200 -j ACCEPT
-A INPUT -i eth0.10 -j DROP
-A INPUT -d 192.168.10.1/32 -i tun1 -p icmp -j ACCEPT
-A INPUT -d 192.168.10.1/32 -i tun1 -p udp -m udp --dport 53 -j ACCEPT
-A INPUT -d 192.168.10.1/32 -i tun1 -p udp -m udp --dport 67:68 -j ACCEPT
-A INPUT -d 255.255.255.255/32 -i tun1 -p udp -m udp --dport 67:68 -j ACCEPT
-A INPUT -d 192.168.10.1/32 -i tun1 -p tcp -m tcp --dport 4100 -j ACCEPT
-A INPUT -d 192.168.10.1/32 -i tun1 -p tcp -m tcp --dport 3100 -j ACCEPT
-A INPUT -i eth0 -j DROP
-A INPUT -d 192.168.1.21/32 -i tun0 -p icmp -j ACCEPT
-A INPUT -d 192.168.1.21/32 -i tun0 -p udp -m udp --dport 53 -j ACCEPT
-A INPUT -d 192.168.1.21/32 -i tun0 -p udp -m udp --dport 67:68 -j ACCEPT
-A INPUT -d 255.255.255.255/32 -i tun0 -p udp -m udp --dport 67:68 -j ACCEPT
-A INPUT -d 192.168.1.21/32 -i tun0 -p tcp -m tcp --dport 4990 -j ACCEPT
-A INPUT -d 192.168.1.21/32 -i tun0 -p tcp -m tcp --dport 3990 -j ACCEPT
-A INPUT -d 192.168.1.21/32 -i tun0 -j DROP
-A INPUT -d 192.168.10.1/32 -i tun1 -j DROP
-A INPUT -d 192.168.20.1/32 -i tun2 -j DROP
-A INPUT -d 192.168.30.1/32 -i tun3 -j DROP
-A FORWARD -i tun3 -o eth1 -j ACCEPT
-A FORWARD -i tun3 ! -o eth1 -j DROP
-A FORWARD -p tcp -m tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
-A FORWARD -o tun3 -j ACCEPT
-A FORWARD -i tun3 -j ACCEPT
-A FORWARD -o eth0.30 -j DROP
-A FORWARD -i eth0.30 -j DROP
-A FORWARD -i tun2 -o eth1 -j ACCEPT
-A FORWARD -i tun2 ! -o eth1 -j DROP
-A FORWARD -p tcp -m tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
-A FORWARD -o tun2 -j ACCEPT
-A FORWARD -i tun2 -j ACCEPT
-A FORWARD -o eth0.20 -j DROP
-A FORWARD -i eth0.20 -j DROP
-A FORWARD -i tun1 -o eth1 -j ACCEPT
-A FORWARD -i tun1 ! -o eth1 -j DROP
-A FORWARD -p tcp -m tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
-A FORWARD -o tun1 -j ACCEPT
-A FORWARD -i tun1 -j ACCEPT
-A FORWARD -o eth0.10 -j DROP
-A FORWARD -i eth0.10 -j DROP
-A FORWARD -i tun0 -o eth1 -j ACCEPT
-A FORWARD -i tun0 ! -o eth1 -j DROP
-A FORWARD -p tcp -m tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
-A FORWARD -o tun0 -j ACCEPT
-A FORWARD -i tun0 -j ACCEPT
-A FORWARD -o eth0 -j DROP
-A FORWARD -i eth0 -j DROP
COMMIT
- Completed on Thu Dec 11 21:45:20 2014
root@nopainnogain:/home/bruna# cat iptables
- Generated by iptables-save v1.4.12 on Thu Dec 11 21:45:20 2014
- nat
- PREROUTING ACCEPT [3013:246807]
- INPUT ACCEPT [383:24225]
- OUTPUT ACCEPT [543:42732]
- POSTROUTING ACCEPT [543:42732]
-A POSTROUTING -s 192.168.0.0/16 -o eth1 -j MASQUERADE
COMMIT
- Completed on Thu Dec 11 21:45:20 2014
- Generated by iptables-save v1.4.12 on Thu Dec 11 21:45:20 2014
- mangle
- PREROUTING ACCEPT [21386:2665336]
- INPUT ACCEPT [18110:2150403]
- FORWARD ACCEPT [959:249396]
- OUTPUT ACCEPT [14653:2879551]
- POSTROUTING ACCEPT [15612:3128947]
-A FORWARD -p tcp -m tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
-A FORWARD -p tcp -m tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
-A FORWARD -p tcp -m tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
-A FORWARD -p tcp -m tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
COMMIT
- Completed on Thu Dec 11 21:45:20 2014
- Generated by iptables-save v1.4.12 on Thu Dec 11 21:45:20 2014
- filter
- INPUT ACCEPT [17683:2082655]
- FORWARD ACCEPT [0:0]
- OUTPUT ACCEPT [14653:2879551]
-A INPUT -i eth0.30 -j DROP
-A INPUT -d 192.168.30.1/32 -i tun3 -p icmp -j ACCEPT
-A INPUT -d 192.168.30.1/32 -i tun3 -p udp -m udp --dport 53 -j ACCEPT
-A INPUT -d 192.168.30.1/32 -i tun3 -p udp -m udp --dport 67:68 -j ACCEPT
-A INPUT -d 255.255.255.255/32 -i tun3 -p udp -m udp --dport 67:68 -j ACCEPT
-A INPUT -d 192.168.30.1/32 -i tun3 -p tcp -m tcp --dport 4300 -j ACCEPT
-A INPUT -d 192.168.30.1/32 -i tun3 -p tcp -m tcp --dport 3300 -j ACCEPT
-A INPUT -i eth0.20 -j DROP
-A INPUT -d 192.168.20.1/32 -i tun2 -p icmp -j ACCEPT
-A INPUT -d 192.168.20.1/32 -i tun2 -p udp -m udp --dport 53 -j ACCEPT
-A INPUT -d 192.168.20.1/32 -i tun2 -p udp -m udp --dport 67:68 -j ACCEPT
-A INPUT -d 255.255.255.255/32 -i tun2 -p udp -m udp --dport 67:68 -j ACCEPT
-A INPUT -d 192.168.20.1/32 -i tun2 -p tcp -m tcp --dport 4200 -j ACCEPT
-A INPUT -d 192.168.20.1/32 -i tun2 -p tcp -m tcp --dport 3200 -j ACCEPT
-A INPUT -i eth0.10 -j DROP
-A INPUT -d 192.168.10.1/32 -i tun1 -p icmp -j ACCEPT
-A INPUT -d 192.168.10.1/32 -i tun1 -p udp -m udp --dport 53 -j ACCEPT
-A INPUT -d 192.168.10.1/32 -i tun1 -p udp -m udp --dport 67:68 -j ACCEPT
-A INPUT -d 255.255.255.255/32 -i tun1 -p udp -m udp --dport 67:68 -j ACCEPT
-A INPUT -d 192.168.10.1/32 -i tun1 -p tcp -m tcp --dport 4100 -j ACCEPT
-A INPUT -d 192.168.10.1/32 -i tun1 -p tcp -m tcp --dport 3100 -j ACCEPT
-A INPUT -i eth0 -j DROP
-A INPUT -d 192.168.1.21/32 -i tun0 -p icmp -j ACCEPT
-A INPUT -d 192.168.1.21/32 -i tun0 -p udp -m udp --dport 53 -j ACCEPT
-A INPUT -d 192.168.1.21/32 -i tun0 -p udp -m udp --dport 67:68 -j ACCEPT
-A INPUT -d 255.255.255.255/32 -i tun0 -p udp -m udp --dport 67:68 -j ACCEPT
-A INPUT -d 192.168.1.21/32 -i tun0 -p tcp -m tcp --dport 4990 -j ACCEPT
-A INPUT -d 192.168.1.21/32 -i tun0 -p tcp -m tcp --dport 3990 -j ACCEPT
-A INPUT -d 192.168.1.21/32 -i tun0 -j DROP
-A INPUT -d 192.168.10.1/32 -i tun1 -j DROP
-A INPUT -d 192.168.20.1/32 -i tun2 -j DROP
-A INPUT -d 192.168.30.1/32 -i tun3 -j DROP
-A FORWARD -i tun3 -o eth1 -j ACCEPT
-A FORWARD -i tun3 ! -o eth1 -j DROP
-A FORWARD -p tcp -m tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
-A FORWARD -o tun3 -j ACCEPT
-A FORWARD -i tun3 -j ACCEPT
-A FORWARD -o eth0.30 -j DROP
-A FORWARD -i eth0.30 -j DROP
-A FORWARD -i tun2 -o eth1 -j ACCEPT
-A FORWARD -i tun2 ! -o eth1 -j DROP
-A FORWARD -p tcp -m tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
-A FORWARD -o tun2 -j ACCEPT
-A FORWARD -i tun2 -j ACCEPT
-A FORWARD -o eth0.20 -j DROP
-A FORWARD -i eth0.20 -j DROP
-A FORWARD -i tun1 -o eth1 -j ACCEPT
-A FORWARD -i tun1 ! -o eth1 -j DROP
-A FORWARD -p tcp -m tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
-A FORWARD -o tun1 -j ACCEPT
-A FORWARD -i tun1 -j ACCEPT
-A FORWARD -o eth0.10 -j DROP
-A FORWARD -i eth0.10 -j DROP
-A FORWARD -i tun0 -o eth1 -j ACCEPT
-A FORWARD -i tun0 ! -o eth1 -j DROP
-A FORWARD -p tcp -m tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
-A FORWARD -o tun0 -j ACCEPT
-A FORWARD -i tun0 -j ACCEPT
-A FORWARD -o eth0 -j DROP
-A FORWARD -i eth0 -j DROP
COMMIT
- Completed on Thu Dec 11 21:45:20 2014