Mudanças entre as edições de "PJI11103-2016-2-felipe"
Linha 114: | Linha 114: | ||
DNAT tcp -- anywhere 192.168.1.111 tcp dpt:2222 to:10.16.2.2:22 | DNAT tcp -- anywhere 192.168.1.111 tcp dpt:2222 to:10.16.2.2:22 | ||
DNAT tcp -- anywhere 192.168.1.111 tcp dpt:2224 to:10.16.1.2:22 | DNAT tcp -- anywhere 192.168.1.111 tcp dpt:2224 to:10.16.1.2:22 | ||
+ | |||
+ | iptables -t nat -A PREROUTING -d 192.168.1.111 -p tcp --dport 2222 -j DNAT --to 10.16.2.2:22 | ||
+ | iptables -t nat -A PREROUTING -d 192.168.1.111 -p tcp --dport 2224 -j DNAT --to 10.16.1.2:22 | ||
Chain POSTROUTING (policy ACCEPT) | Chain POSTROUTING (policy ACCEPT) | ||
target prot opt source destination | target prot opt source destination | ||
MASQUERADE all -- anywhere anywhere | MASQUERADE all -- anywhere anywhere | ||
+ | |||
+ | iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE | ||
</syntaxhighlight> | </syntaxhighlight> |
Edição das 18h56min de 17 de novembro de 2016
Dário de Bordo
Projeto Integrador 3 2016/2
RADIUS - 27/10/16
AP
1. Configurado AP em Wireless Security para utilizar 'WPA/WPA2 - Enterprise';
2. Informado IP do servidor RADIUS 192.168.0.2 com a senha 1234;
Servidor
1. Instalado freeradius;
2. /etc/freeradius/clients.conf;
client 192.168.0.1 {
ipaddr = 192.168.0.1
shortname = AP
secret = 1234
nastype = other
}
</syntaxhighlight>
3. /etc/freeradius/users;
felipe Cleartext-Password :="#Pastel2016"</syntaxhighlight>
4. Ajustadas configurações dos parâmetros de log /etc/freeradius/radiusd.conf
log {
destination = files
file = ${logdir}/radius.log
syslog_facility = daemon
stripped_names = no
auth = yes
auth_badpass = yes
auth_goodpass = no
}
</syntaxhighlight>
5. LOG de acesso
Thu Oct 27 19:31:59 2016 : Info: Ready to process requests.
Thu Oct 27 19:32:43 2016 : Auth: Login OK: [felipe/<via Auth-Type = EAP>] (from client AP port 0 via TLS tunnel)
Thu Oct 27 19:32:43 2016 : Auth: Login OK: [felipe/<via Auth-Type = EAP>] (from client AP port 0 cli 10-C3-7B-A5-6B-AF)
</syntaxhighlight>
Servidores Operadora e Galpão
Em ambos os servidores foram configurados os APs sem DHCP nas interfaces LAN, com o ip 192.168.10.15 configurado para comunicação com o IP da VLAN 10 dos servidores.
No AP da Operadora ficou configurado como servidor RADIUS o IP 192.168.10.10.
No AP do Galpão ficou configurado como servidor RADIUS o IP 192.168.10.1.
Nas interfaces WAN dos APs (sem uso) ficou configurado o IP 192.168.0.1 para o caso de perda de acesso pelas interfaces LAN.
Roteamento estático - 17/11/16
Roteador Borda
eth0 - 192.168.1.111/24
eth1 - 10.16.1.1/24
eth2 - 10.16.2.1/24
Roteador 2
eth0 10.16.1.2/24
eth1 172.16.10.1/24
eth2 192.16.10.1/24
Roteador 3
eth0 10.16.2.2/24
eth1 172.16.10.2/24
eth2 192.16.20.1/24
</syntaxhighlight>
Tabelas de rotas
Roteador 2
aluno@ubuntu:~$ route -n
Tabela de Roteamento IP do Kernel
Destino Roteador MáscaraGen. Opções Métrica Ref Uso Iface
0.0.0.0 10.16.1.1 0.0.0.0 UG 0 0 0 eth0
10.16.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
172.16.10.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
192.16.10.0 0.0.0.0 255.255.255.0 U 0 0 0 eth2
192.16.20.0 172.16.10.2 255.255.255.0 UG 0 0 0 eth1
Roteador 3
aluno@ubuntu:~$ route -n
Tabela de Roteamento IP do Kernel
Destino Roteador MáscaraGen. Opções Métrica Ref Uso Iface
0.0.0.0 10.16.2.1 0.0.0.0 UG 0 0 0 eth0
10.16.2.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
172.16.10.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
192.16.10.0 172.16.10.1 255.255.255.0 UG 0 0 0 eth1
192.16.20.0 0.0.0.0 255.255.255.0 U 0 0 0 eth2
Operadora
aluno@ubuntu:~$ route -n
Tabela de Roteamento IP do Kernel
Destino Roteador MáscaraGen. Opções Métrica Ref Uso Iface
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth0
10.16.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
10.16.2.0 0.0.0.0 255.255.255.0 U 0 0 0 eth2
192.16.10.0 10.16.1.2 255.255.255.0 UG 0 0 0 eth1
192.16.20.0 10.16.2.2 255.255.255.0 UG 0 0 0 eth2
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
</syntaxhighlight>
NAT
Chain PREROUTING (policy ACCEPT)
target prot opt source destination
DNAT tcp -- anywhere 192.168.1.111 tcp dpt:2222 to:10.16.2.2:22
DNAT tcp -- anywhere 192.168.1.111 tcp dpt:2224 to:10.16.1.2:22
iptables -t nat -A PREROUTING -d 192.168.1.111 -p tcp --dport 2222 -j DNAT --to 10.16.2.2:22
iptables -t nat -A PREROUTING -d 192.168.1.111 -p tcp --dport 2224 -j DNAT --to 10.16.1.2:22
Chain POSTROUTING (policy ACCEPT)
target prot opt source destination
MASQUERADE all -- anywhere anywhere
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
</syntaxhighlight>