OpenFPnet | Instituts: Ebre | Montsià | Deltebre | Els Alfacs | Leopoldo Querol | Joan Coromines | Empreses/Institucions: Mosaic | Ebrecom | Guifi.net | Comunitat de Regants | Altres: TODO | Changelog
|
---|
![]() Navegació: Què enllaça aquí | Pàgines Filles | |
---|---|
Web: | http://openfpnet.guifi.net |
Centre coordinador: | http://www.iesebre.com |
Wiki: | OpenFPnet |
Repositori SVN: | http://www.iesebre.com/subversion/openfpnet/ |
Autors: | Sergi Tur Badenas |
Llicència: | ![]() |
Ajudes: | ![]() |
Enllaços: | ![]() |
La màquina virtual cop la crearem a partir de la plantilla de màquina virtual anomenada:
replicaLdap
Vegeu també:
OpenFPnet/Mosaic/Formació/Planificació/Xarxa#Xarxa_de_servidors
Configuració bàsica:
Recordeu que cal canviar el nom de màquina virtual a Proxmox, la MAC i també assignar l'adreça IP bàsica segons:
OpenFPnet/Mosaic/Formació/Planificació/Xarxa#Xarxa_de_servidors
i canviar el nom de host. Consulteu el procediment seguit amb la primera màquina virtual:
OpenFPnet/Mosaic/Formació/Execució/Servidor_de_gestió_centralitzada._Gosa#Configuraci.C3.B3_de_la_xarxa
Configuració de la xarxa
Cal afegir múltiples targetes de xarxa (una per VLAN a la que es vol donar servei):
Apunteu les MAC per tal de diferència dins la màquina virtual quin interfície (ethx) pertany a quina VLAN.
Cada centre escull a quines interfícies vol donar servei.
IMPORTANT: Proxmox actualment (--acacha (discussió) 07:11, 25 jul 2012 (CEST)), o més ben dit KVM, només suporta un total de 6 interfícies de xarxa. Si és necessiten més cal crear un altre màquina: p.e. el cop/proxy de guifi es crearà en una altre màquina a part
La màquina cop ha de pertànyer a múltiples segments de xarxa/VLANs. Ara configureu el fitxer /etc/network/interfaces. Un exemple:
# This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). # The loopback network interface auto lo iface lo inet loopback # MODEL HEURA/EDUCAT + OPENFPNET: # http://acacha.org/mediawiki/index.php/Model_Heura#Model_Heura # The primary network interface # VLAN 11: Servidors Bridge Proxmox: vmbr0 Interfície: bond0.11 auto eth0 iface eth0 inet static address 192.168.50.10 netmask 255.255.255.0 network 192.168.50.0 broadcast 192.168.50.255 gateway 192.168.50.1 # dns-* options are implemented by the resolvconf package, if installed dns-nameservers 8.8.8.8 dns-search iesmontsia.org # VLAN 2: Docent Bridge Proxmox: vmbr2 Interfície: bond0.2 auto eth1 iface eth1 inet static address 192.168.0.1 netmask 255.255.255.0 network 192.168.0.0 broadcast 192.168.0.255 # VLAN 10: Administració/Gestió/Secretaria. Bridge Proxmox: vmbr10 Interfície: # bond0.10 auto eth2 iface eth2 inet static address 192.168.110.1 netmask 255.255.255.0 network 192.168.110.0 broadcast 192.168.110.255 # VLAN 7: EDUCAT. Bridge Proxmox: vmbr7 Interfície: bond0.7 auto eth3 iface eth3 inet static address 192.168.168.1 netmask 255.255.248.0 network 192.168.168.0 broadcast 192.168.175.255 # VLAN 3: DOCENT-WIFI. Bridge Proxmox: vmbr3 Interfície: bond0.3 auto eth4 iface eth4 inet static address 192.168.130.1 netmask 255.255.255.0 network 192.168.130.0 broadcast 192.168.130.255 # VLAN 13: alumnat. Bridge Proxmox: vmbr13 Interfície: bond0.13 auto eth5 iface eth5 inet static address 172.16.0.1 netmask 255.255.255.0 network 172.16.0.0 broadcast 172.16.0.255
Les xarxes escollides en aquest cas són:
Vlanname | ID | rang adreces IP | Descripció |
---|---|---|---|
docent/professorat | 2 | 192.168.0.0/24 o 192.168.120.0/24 | Vlan per a professorat en connexió per cable. Al model OpenFPnet ens interessa mantenir la diferència entre la VLAN de docent per cable i la de WIFI |
docent-wifi | 3 | 192.168.130.0/24 | Vlan per a professorat en connexió per WIFI. |
educat | 7 | 192.168.168.0/21 | Rang d'adreces Ip per als ordinadors del projecte Educat 1x1 |
administració | 10 | 192.168.110.0/24 | Rang d'adreces IP per als ordinadors d'administració/gestió del centre (Equip directiu, secretaria...) |
servidors | 11 | 192.168.168.50.0/24 | Rang d'adreces IP dels servidors. Xarxa de servidors |
alumnat | 13 | 172.16.0.0/24 o 172.16.0.0/23 segons la mida del centre o 192.168.30.0/24 | Rang d'adreces IP d'alumnes |
Consulteu IP_forwarding#Fer_permanent_la_configuraci.C3.B3_de_ip_forwarding
Vegeu rp_filter:
Editeu el fitxer:
$ sudo joe /etc/sysctl.d/10-network-security.conf
Canvieu les línies:
net.ipv4.conf.default.rp_filter=1 net.ipv4.conf.all.rp_filter=1
el fitxer ha de quedar:
# Turn on Source Address Verification in all interfaces to # prevent some spoofing attacks. net.ipv4.conf.default.rp_filter=0 net.ipv4.conf.all.rp_filter=0 # Turn on SYN-flood protections. Starting with 2.6.26, there is no loss # of TCP functionality/features under normal conditions. When flood # protections kick in under high unanswered-SYN load, the system # should remain more stable, with a trade off of some loss of TCP # functionality/features (e.g. TCP Window scaling). net.ipv4.tcp_syncookies=1
Consulteu:
DHCP i Ldap
Qüestions a tenir en compte:
Gosa#El_plugin_DHCP_no_deixa_afegir_noves_subxarxes_.28no_apareix_el_bot.C3.B3.29
Consulteu:
DNS i Ldap
Qüestions a tenir en compte:
La sol·lució implementada per tal de que des de la xarxa educat es pugui accedir a la xarxa de servidors propis de l'Instititut (servidors del projecte OpenFPnet) és la següents:
192.168.168.3 (cop|dns1) 192.168.168.22 (dns2)
$ ping moodle.dominicentre.com 192.168.168.80
La vista s'implementa de la següent forma:
$ cat /etc/bind/named.conf // This is the primary configuration file for the BIND DNS server named. // // Please read /usr/share/doc/bind9/README.Debian.gz for information on the // structure of BIND configuration files in Debian, *BEFORE* you customize // this configuration file. // // If you are just adding zones, please do that in /etc/bind/named.conf.local include "/etc/bind/named.conf.options"; //include "/etc/bind/named.conf.local"; acl educat { 192.168.168.0/21; }; view "educat" { match-clients { educat; }; include "/etc/bind/named.conf.educat"; }; view "default" { match-clients { any; }; include "/etc/bind/named.conf.default-zones"; include "/etc/bind/named.conf.ldap2zone"; };
On el nou fitxer que defineix les zones per la vista educat és:
$ cat /etc/bind/named.conf.educat zone "168.168.192.in-addr.arpa." { type master; file "/etc/bind/db.educat_168.168.192.in-addr.arpa."; }; zone "insalfacs.cat." { type master; file "/etc/bind/db.educat_insalfacs.cat."; };
I els fitxers de zona locals (aquest nos són creat per l'ordre ldap2bind):
$ cat /etc/bind/db.educat_168.168.192.in-addr.arpa. $TTL 500 @ IN SOA ns1.insalfacs.cat. maninfo.insalfacs.cat. ( 2012090673 ; Serialnumber 10800 ; Refresh 3600 ; Retry 604800 ; Expire 86400 ) ; Minimum TTL NS ns1.insalfacs.cat. NS ns2.insalfacs.cat. 30 PTR gosa.insalfacs.cat. 3 PTR ns1.insalfacs.cat. PTR cop.insalfacs.cat. 22 PTR ns2.insalfacs.cat. 80 PTR www.insalfacs.cat. PTR moodle.insalfacs.cat. 41 PTR samba01.insalfacs.cat.
i
$ cat /etc/bind/db.educat_insalfacs.cat. $TTL 500 @ IN SOA ns1.insalfacs.cat. maninfo.insalfacs.cat. ( 2012090673 ; Serialnumber 10800 ; Refresh 3600 ; Retry 604800 ; Expire 86400 ) ; Minimum TTL NS ns1.insalfacs.cat. cop A 192.168.168.3 gosa A 192.168.168.30 ns1 A 192.168.168.3 ns2 A 192.168.168.22 samba01 A 192.168.168.41 www A 192.168.168.80 moodle A 192.168.168.80
Els fitxers:
/etc/bind/named.conf.default-zones /etc/bind/named.conf.ldap2zone
Són els existents prèviament a la inclusió de la vista educat.
IMPORTANT: l'únic problema serà que l'eina ldap2bind no té en compte les vistes al executar la comanda rndc reload. Cal doncs modificar el codi per tal de no tenir problemes. A la documentació actual (--acacha (discussió) 19:53, 9 set 2012 (CEST)) Ldap i DNS aquesta modificacions ja estan incorporades
La llista de servidors és la següent:
Taula | |||||||
---|---|---|---|---|---|---|---|
Institut | Màquina | DNS | IP Interna | IP Externa | Virtual Host | DNS alternatiu | Comentaris |
Institut de l'Ebre | proxmox01 | http://proxmox01.iesebre.com | 192.168.50.11 | 109.69.15.122 | Sí | http://iesebre.com/proxmox01 | |
ocs | http://www.iesebre.com
http://ocs.iesebre.com/ocsreports http://ocsreports.iesebre.com/ocsreports |
192.168.50.80 | 109.69.15.122 | No cal(és el mateix servidor web) | http://iesebre.com/ocsreports | ||
gosa | http://gosa.iesebre.com | 192.168.50.30 | 109.69.15.122 | Sí | http://iesebre.com/gosa | ||
munin | http://noc.iesebre.com | 192.168.50.50 | 109.69.15.122 | Sí | http://iesebre.com/munin | ||
nagios | http://noc.iesebre.com/nagios3 | 192.168.50.50 | 109.69.15.122 | Sí | http://iesebre.com/nagios | ||
cacti | http://cacti.iesebre.com/cacti | 192.168.50.50 | 109.69.15.122 | Sí | http://iesebre.com/cacti |
Per instal·lar squid:
$ sudo apt-get install squid3
És més còmode treballar amb un fitxer de configuració d'Squid sense comentaris. Fer una còpia de l'original i elimineu els comentaris amb:
$ cd /etc/squid3 $ sudo cp squid.conf squid.conf.reference $ sudo bash -c "cat squid.conf | grep -i -v '^#\|^$\|^;' > squid.conf.backup" $ sudo mv squid.conf.backup squid.conf
Cada cop que modifiqueu el fitxer comproveu la sintaxi amb:
$ sudo squid3 -k parse
I apliqueu els canvis amb:
$ sudo /etc/init.d/squid3 reload
Ara cal recompilar Squid per tal de suportar algunes opcions extres:
Squid#Recompilar_el_paquet_Debian
Incorporeu el suport per a user_agent i snmp. Tant o més important com compilar es forçar que no s'actualitzi l'Squid instal·lat a mà.
Configuració
El servidor cop si no inclou el proxy de guifi no necessita configuració del servidor Ldap. Cal definir un ACL per a cada xarxa del Model Heura + openFPnet i permetre l'accés al proxy per a aquestes xarxes (apliqueu les línies que estan en negreta):
acl manager proto cache_object acl localhost src 127.0.0.1/32 ::1 acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1 acl SSL_ports port 443 acl Safe_ports port 80 # http acl Safe_ports port 21 # ftp acl Safe_ports port 443 # https acl Safe_ports port 70 # gopher acl Safe_ports port 210 # wais acl Safe_ports port 1025-65535 # unregistered ports acl Safe_ports port 280 # http-mgmt acl Safe_ports port 488 # gss-http acl Safe_ports port 591 # filemaker acl Safe_ports port 777 # multiling http acl CONNECT method CONNECT acl servidors src 192.168.50.0/24 acl docent src 192.168.0.0/24 acl gestio src 192.168.110.0/24 acl educat src 192.168.168.0/21 acl docentwifi src 192.168.130.0/24 acl alumnat src 172.16.0.0/24 http_access allow manager localhost http_access deny manager http_access deny !Safe_ports http_access deny CONNECT !SSL_ports http_access allow localhost http_access allow servidors http_access allow docent http_access allow gestio http_access allow educat http_access allow docentwifi http_access allow alumnat #No permetre tota la resta http_access deny all http_port 3128 #Activar user agent log useragent_log /var/log/squid3/user_agent.log coredump_dir /var/spool/squid3 refresh_pattern ^ftp: 1440 20% 10080 refresh_pattern ^gopher: 1440 0% 1440 refresh_pattern -i (/cgi-bin/|\?) 0 0% 0 refresh_pattern (Release|Packages(.gz)*)$ 0 20% 2880 refresh_pattern . 0 20% 4320 visible_hostname copinsmontsia #Errors en català error_directory /usr/share/squid-langpack/ca
Consulteu Squid per a més informació.
Seguiu els passos de:
SquidGuard#Configuraci.C3.B3_per_a_un_Institut
Vegeu també Squidguard
Seguint:
Calamaris
Instal·leu calamaris:
$ sudo apt-get install calamaris
I configureu-lo seguint les instruccions de:
Calamaris#Informes_autom.C3.A0tics_amb_cron
Adaptació de fitxer plantilla
Configuració del firewall durant l'arrencada
Vegeu també iptables.
Seguiu els passos de:
NTP#Instal.C2.B7laci.C3.B3
I configureu amb:
NTP#Configuraci.C3.B3
De fet els servidors per defecte ja són una bona opció:
server 0.ubuntu.pool.ntp.org server 1.ubuntu.pool.ntp.org server 2.ubuntu.pool.ntp.org server 3.ubuntu.pool.ntp.org
Finalment comproveu el funcionament amb:
NTP#Comprovar_que_funciona_correctament_el_servidor