Mudanças entre as edições de "Projeto Integrador - 2014.1 - NAT"
Linha 461: | Linha 461: | ||
*Pesquisamos sobre como colocar FreeRadius no AccessPoint D-Link DI-524.[https://help.ubuntu.com/community/WifiDocs/ChillispotHotspot ChilliSpot] | *Pesquisamos sobre como colocar FreeRadius no AccessPoint D-Link DI-524.[https://help.ubuntu.com/community/WifiDocs/ChillispotHotspot ChilliSpot] | ||
+ | =='''30/06: Projeto integrador (PRC (Segunda-Feira)'''== | ||
+ | * Iniciamos a configuração do FreeRadius + Hotspot | ||
=='''Referencias'''== | =='''Referencias'''== | ||
https://help.ubuntu.com/community/WifiDocs/ChillispotHotspot | https://help.ubuntu.com/community/WifiDocs/ChillispotHotspot |
Edição das 20h57min de 30 de junho de 2014
Projeto Integrador - NAT - Network Adress Transmision
10/06: Iniciando o Projeto Integrador (CAB (Terça-Feira)
- Início do Projeto.
- Primeiro contato com os integrantes do Projeto Integrador.
- Os integrantes do grupo são: Jeferson, Gerson, Vinícius, Hyowata.
- Primeiramente instalamos a fibra óptica FURUKAWA INDOOR/OUTDOOR TYPE OFNR
- Verificamos a integridade física da máquina fornecida pelo IFSC
11/06: Segundo dia do PI (IER (Quarta-Feira)
- Começamos a instalação do Ubuntu Server 12.04 LTS
- Iniciando a certificação do link principal com TestSet ACTERNA EDT-135
- Entre os roteadores CISCO 2514 (R1) e CISCO 1750 (R2)
Descrição do Servidor
- Configuração do Sistema Operacional:
cat /etc/issue
Ubuntu 12.04.4 LTS \n \l
- Para verificar a configuração do Hardware:
- Memória (Total 2Gb):
free
total used free shared buffers cached
Mem: 2055312 251216 1804096 0 11556 200784
-/+ buffers/cache: 38876 2016436
Swap: 3048572 0 3048572
- Processador:
cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 15
model : 6
model name : Intel(R) Celeron(R) D CPU 3.06GHz
stepping : 5
microcode : 0x9
cpu MHz : 3059.161
cache size : 512 KB
- HD (total: 320Gb):
df -h
Sist. Arq. Tam. Usado Disp. Uso% Montado em
/dev/sda5 138G 2,7G 129G 3% /
udev 995M 4,0K 995M 1% /dev
tmpfs 402M 356K 402M 1% /run
none 5,0M 0 5,0M 0% /run/lock
none 1004M 0 1004M 0% /run/shm
/dev/sda1 453M 30M 396M 8% /boot
/dev/sda6 155G 267M 147G 1% /var
Configurando do Servidor
- Desabilitando Ctrl + Alt + Del.
- Foi editado o seguinte arquivo:
vim /etc/init/control-alt-delete.conf
- Foi comentado a linha abaixo:
exec shutdown -r now "Control-Alt-Delete pressed"
- Atualizando o Sistema.
sudo apt-get update
sudo apt-get upgrade
- Instalando SSH.
sudo apt-get install ssh
- Configurando Usuarios.
useradd gerson
useradd hyowata
useradd jeferson
useradd vinicius
- Desabilitando ssh do ROOT editando o arquivo /etc/ssh/sshd_config.
## Na linha PermitRootLogin yes para ##
PermitRootLogin no
13/06: Terceiro dia do PI (GER (Sexta-Feira)
Configurado Bind9 como servidor DNS
- Instalação do bind9:
sudo apt-get install bind9
- Editado o arquivo de configuração /etc/bind/named.conf.local
zone "nat.sj.ifsc.edu.br" {
type master;
file "/etc/bind/nat.zone";
// abaixo fica autorizado que IFSC copie o conteúdo da zona !!! secundario
allow-transfer { 200.135.37.65; };
};
// reverso
zone "99.37.135.200.in-addr.arpa" {
type master;
file "/etc/bind/db.172";
allow-transfer { 200.135.37.65; };
};
- Editado o arquivo de configuração de zona /etc/bind/nat.zone
$TTL 604800
@ IN SOA nat.sj.ifsc.edu.br. root.nat.sj.ifsc.edu.br. (
2 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN A 200.135.37.99
@ IN NS ns1.nat.sj.ifsc.edu.br.
@ IN A 127.0.0.1
@ IN AAAA ::1
ns1 IN A 200.135.37.99
www IN CNAME nat.sj.ifsc.edu.br.
nat.sj.ifsc.edu.br. IN MX 0 mx
nat.sj.ifsc.edu.br. IN MX 10 mx
- Editado o arquivo de configuração de db /etc/bind/db.172
$TTL 604800
@ IN SOA ns1.nat.sj.ifsc.edu.br. root.nat.sj.ifsc.edu.br. (
1 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS nat.sj.ifsc.edu.br.
99 IN PTR ns1.nat.sj.ifsc.edu.br.
mail IN A 200.135.37.99
Configurado isc-dhcp-server como servidor DHCP
- Instalação do isc-dhcp-server:
sudo apt-get install isc-dhcp-server
- Configurando personalizado o arquivo /etc/dhcp/dhcpd.conf
default-lease-time 600;
max-lease-time 7200;
option subnet-mask 255.255.255.0;
option broadcast-address 172.16.1.255;
option routers 172.16.1.254;
option domain-name-servers 200.135.37.99, 200.135.37.65;
option domain-name "nat.sj.ifsc.edu.br";
subnet 172.16.1.0 netmask 255.255.255.0 {
range 172.16.1.50 172.16.1.200;
}
- Configurando qual interface vai entregar IP editando o arquivo /etc/default/isc-dhcp-server
INTERFACES="eth1"
16/06: Quarto dia do PI (PRC (Segunda-Feira)
Configurando IP Externo
- Fizemos a configuração e fizemos a fixação da maquina no armário.
18/06: Iniciando a esquematização do Site (IER (quinta-Feira)
- Definimos como será feita a pagina principal do nosso site.
- Definido IPs internos, externos entro os roteadores segue abaixo:
- O servidor foi configurado para acesso remoto.
apt-get install apache2
ping google.com
apt-get install traceroute
apt-get install --no-install-recommends xubuntu-desktop
sudo apt-get install xfce4
- Configuramos AccessPoint D-Link DI-524, para mascara de rede 172.16.1.0/24
24/06: Projeto integrador (GAR (terça-Feira)
- Foi corrigido os IP'S de 178 para 172.
- Foi corrigido os IP'S do DHCP e respectivas interfaces.
- Instalado o servidor de email POSTFIX
apt-get install postfix
apt-get install mailutils
vi /etc/postfix/main.cf
*Foi alterado as configurações para o host da NAT
myhostname = nat.sj.ifsc.edu.br
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = nat, localhost.localdomain, , localhost
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
mydomain = nat.sj.ifsc.edu.br
mynetwork_style = subnet
service postfix start
root@nat:~# mail hyowatha@gmail.com
Cc:
Subject: testes
tetstets
- Instalado e configurado FreeRaius:
apt-get install freeradius freeradius-ldap freeradius-common
apt-get install openldap-server
aptitude install apache2 libapache2-mod-php5 php5 php5-cgi php5-ldap
aptitude install phpldapadmin
dpkg-reconfigure slapd
apt-get install ldap-utils
ufw allow 80
ufw allow 389
- Configurado os arquivos com os respectivos conteúdos:
vim /etc/ldap/ldap.conf
BASE dc=sj,dc=ifsc,dc=edu,dc=br
URI ldap://200.135.37.99
vim /etc/phpldapadmin/config.php
$servers->setValue('login','bind_id','cn=admin,dc=sj,dc=ifsc,dc=edu,dc=br');
$servers->setValue('server','base',array('dc=sj,dc=ifsc,dc=edu,dc=br'));
$servers->setValue('login','bind_id','cn=admin,dc=sj,dc=ifsc,dc=edu,dc=br');
vim /etc/freeradius/modules/ldap
#modificar as seguintes linhas
server = "nat.sj.ifsc.edu.br"
basedn = "dc=sj,dc=ifsc,dc=edu,dc=br"
filter = "(uid=%u)"
access_attr = "uid"
edir_account_policy_check = yes
dictionary_mapping = ${confdir}/ldap.attrmap
vim /etc/freeradius/sites-enabled/default
authorize {
ldap
expiration
logintime
}
authenticate {
Auth-Type LDAP {
ldap
}
}
preacct {
preprocess
acct_unique
suffix
files
}
accounting {
detail
unix
radutmp
attr_filter.accounting_response
}
session {
radutmp
}
post-auth {
Post-Auth-Type REJECT {
attr_filter.access_reject
}
}
vim /etc/freeradius/clients.conf
client localhost {
ipaddr = 127.0.0.1
secret = testing123
require_message_authenticator = no
}
# Exemplo de configuração para rede (caso não utilize, comente as 4 linhas abaixo)
client 172.16.1.0/24 {
secret = sw2011
shortname = switches-3com
}
# Exemplo de configuração para host (caso não utilize, comente as 4 linhas abaixo)
client 172.16.1.4 {
secret = wl2011
shortname = ap-wireless
}
vim /etc/freeradius/radiusd.conf
prefix = /usr
exec_prefix = /usr
sysconfdir = /etc
localstatedir = /var
sbindir = /usr/sbin
logdir = /var/log/radius
raddbdir = /etc/freeradius
radacctdir = /var/log/radius/radacct
name = radiusd
confdir = ${raddbdir}
run_dir = ${localstatedir}/run/${name}
db_dir = ${raddbdir}
libdir = /usr/lib/freeradius
pidfile = ${run_dir}/${name}.pid
max_request_time = 30
cleanup_delay = 5
max_requests = 1024
listen {
type = auth
ipaddr = *
port = 0
}
listen {
ipaddr = *
port = 0
type = acct
}
hostname_lookups = no
allow_core_dumps = no
regular_expressions = yes
extended_expressions = yes
log {
destination = files
file = ${logdir}/radius.log
syslog_facility = daemon
stripped_names = no
auth = yes
auth_badpass = yes
auth_goodpass = yes
}
checkrad = ${sbindir}/checkrad
security {
max_attributes = 200
reject_delay = 1
status_server = yes
}
proxy_requests = yes
$INCLUDE proxy.conf
$INCLUDE clients.conf
thread pool {
start_servers = 5
max_servers = 32
min_spare_servers = 3
max_spare_servers = 10
max_requests_per_server = 0
}
modules {
$INCLUDE ${confdir}/modules/
$INCLUDE eap.conf
}
instantiate {
exec
expr
expiration
logintime
}
$INCLUDE policy.conf
$INCLUDE sites-enabled/
#testando
radtest abc 123 localhost 1812 testing123
25/06: Projeto integrador (IER (quarta-Feira)
- Instalado e configurado X11vnc:
26/06: Projeto integrador (CAB (quinta-Feira)
- Instrumentação sobre Fibra Óptica
- Fusão de fibra óptica
27/06: Projeto integrador (GER (sexta-Feira)
- Configuramos AccessPoint D-Link DI-524
- Removido DHCP interno do AP.
- Configurado com IP fixo da nossa interface interna.
- Corrigido os endereços IP do DNS.
- Realizado comando para trocar pacotes da interface WAN do servidor:
# Temporario #
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
- Configuramos um script para iniciar com este comando:
vim /etc/init.d/nat_habilita.sh
# Com o conteudo:
#!/bin/bash
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
# Dando permissão para executar
chmod +x /etc/init.d/nat_habilita.sh
- Realizado comando para rotear pacotes da interface WAN do servidor:
echo 1 > /proc/sys/net/ipv4/ip_forward
- Pesquisamos sobre como colocar FreeRadius no AccessPoint D-Link DI-524.ChilliSpot
30/06: Projeto integrador (PRC (Segunda-Feira)
- Iniciamos a configuração do FreeRadius + Hotspot
Referencias
https://help.ubuntu.com/community/WifiDocs/ChillispotHotspot
http://www.stato.blog.br/wordpress/?p=738
http://www.unixmen.com/openldap-installation-configuration-ubuntu-12-1013-0413-10-debian-67-2/
http://www.vivaolinux.com.br/artigo/Entendendo-o-LDAP/?pagina=4
http://www.vivaolinux.com.br/artigo/Tutorial-completo-de-implementacao-de-LDAP-+-Samba-+-Squid/
http://www.unitednerds.org/thefallen/docs/?area=LDAP&tuto=LDAP-NSS_Ldap
http://www.vivaolinux.com.br/artigo/Configurando-um-servidor-Freeradius-+-openLDAP
http://www.tldp.org/HOWTO/archived/LDAP-Implementation-HOWTO/radius.html
http://www.vivaolinux.com.br/artigo/Configuracao-simples-Samba-+-LDAP?pagina=3
http://www.tldp.org/HOWTO/archived/LDAP-Implementation-HOWTO/radius.html
http://repositorio.roca.utfpr.edu.br/jspui/bitstream/1/416/1/CT_GESER_1_2011_14.pdf
http://softwarelivre.org/gomex/blog/openldap-samba-como-alternativa-livre-ao-active-directory
http://www.vivaolinux.com.br/artigo/Configurando-um-servidor-Freeradius-+-openLDAP
http://www.vivaolinux.com.br/topico/Adminitradores-Mikrotik/Servico-ldap/