Outils pour utilisateurs

Outils du site


technique:referentiel:chd-stg2

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentes Révision précédente
Prochaine révision
Révision précédente
technique:referentiel:chd-stg2 [2016/08/07 20:06]
admin [Serveur DNS (reverse IPv6 CHD)]
technique:referentiel:chd-stg2 [2018/03/12 16:33] (Version actuelle)
admin
Ligne 22: Ligne 22:
 apt-get install --purge nullmailer apt-get install --purge nullmailer
 # Donner chd.sx comme smarthost # Donner chd.sx comme smarthost
 +
 +# Permettre ping depuis www-data (et autres user simples)
 +setcap cap_net_raw+p /bin/ping
 </​code>​ </​code>​
  
-===== Serveur DNS (reverse ​IPv6 CHD) =====+<file text /​etc/​syslog.d/​remote.conf>​ 
 +module(load="​imudp"​) 
 +input(type="​imudp"​ port="​514"​ ruleset="​rs_remote"​) 
 +template(name="​t_remote_logfile"​ type="​string"​ string="/​var/​log/​remote/​%fromhost-ip%.log"​) 
 +ruleset(name="​rs_remote"​) { 
 +    action(type="​omfile"​ dynaFile="​t_remote_logfile"​ dynaFileCacheSize="​400"​) 
 +
 +</​file>​ 
 + 
 +===== Serveur DNS (autorité pour reverse ​DNS) =====
  
-Commencé mais n'​est ​pas en prodNe règle pas toutes les questions autour des reverse-DNS.+''​ns2.chd.sx''  ​est un ''​bind9'' ​ sur ''​chd-stg2''​Il y a une délégation de zone vers ''​all-knowing-dns'' ​ sur ''​ns3.chd.sx'' ​ (même machine) pour les IPv6.
  
 [[http://​all-knowing-dns.zekjur.net/​|http://​all-knowing-dns.zekjur.net/​]] [[http://​all-knowing-dns.zekjur.net/​|http://​all-knowing-dns.zekjur.net/​]]
  
 <code bash> <code bash>
-apt-get install all-knowing-dns+apt-get install ​bind9 all-knowing-dns
 editor /​etc/​all-knowing-dns.conf editor /​etc/​all-knowing-dns.conf
 service all-knowing-dns restart service all-knowing-dns restart
 +editor /​etc/​bind/​{named.conf.options,​named.conf.local,​db.185.131.40,​db.185.131.41}
 +editor /​etc/​bind/​{db.2a03:​a0a0::,​db.2a03:​a0a0:​1::,​db.2a03:​a0a0::​upstream,​db.2a03:​a0a0:​1::​upstream}
 +service bind9 restart
 +</​code>​
  
 +Requêtes d'​essai :
 +
 +<​code>​
 +$ dig +short 0.0.0.0.0.a.0.a.3.0.a.2.ip6.arpa. SOA
 +ns2.chd.sx. dnsmaster.chd.sx. 2016121101 10800 900 604800 10800
 +$ dig +short 0.0.0.0.0.a.0.a.3.0.a.2.ip6.arpa. NS
 +ns1.chd.sx. # bind slave
 +ns2.chd.sx. # bind master
 +$ dig +short 0.0.0.0.0.0.a.0.a.3.0.a.2.ip6.arpa. NS
 +ns3.chd.sx. # all-knowing-dns
 +
 +$ dig +short 40.131.185.in-addr.arpa. SOA
 +ns2.chd.sx. dnsmaster.chd.sx. 2016121101 10800 900 604800 10800
 +$ dig +short 41.131.185.in-addr.arpa. SOA
 +ns2.chd.sx. dnsmaster.chd.sx. 2016121101 10800 900 604800 10800
 +$ dig +short 40.131.185.in-addr.arpa. NS
 +ns2.chd.sx.
 +ns1.chd.sx.
 +
 +$ dig +short -x 2a03:​a0a0::​1
 +chd-stg1.chd.sx.
 +$ dig +short -x 2a03:​a0a0::​2
 +chd-stg2.chd.sx.
 +$ dig +short -x 2a03:​a0a0::​3
 +ipv6-000000000000000000000003.chd.sx.
 +$ dig +short -x 2a03:​a0a0:​0:​8001:​2f5:​f0ff:​fe40:​71fe
 +ipv6-0000800102f5f0fffe4071fe.chd.sx.
 +
 +$ dig +short -x 185.131.40.1
 +chd-stg1.chd.sx.
 +$ dig +short -x 185.131.40.2
 +chd-stg2.chd.sx.
 +$ dig +short -x 185.131.40.3
 +chd-stg2.chd.sx.
 +$ dig +short -x 185.131.40.4
 +$ dig +short -x 185.131.40.9
 +srv1.stg.prosoluce.net.
 +$ dig +short -x 185.131.40.10
 +backup3.stg.prosoluce.net.
 +$ dig +short -x 185.131.40.11
 +$ dig +short -x 185.131.40.33
 +ipv4-40-33.chd.sx.
 +$ dig +short -x 185.131.40.34
 +ipv4-40-34.chd.sx.
 +$ dig +short -x 185.131.40.254
 +ipv4-40-254.chd.sx.
 +$ dig +short -x 185.131.41.1
 +ipv4-41-1.chd.sx.
 +$ dig +short -x 185.131.41.2
 +ipv4-41-2.chd.sx.
 +$ dig +short -x 185.131.41.254
 +ipv4-41-254.chd.sx.
 </​code>​ </​code>​
  
-===== Compilation OpenWRT pour ImageBuilder custom ===== +===== Mise à jour routeur ===== 
-  * https://​wiki.openwrt.org/​doc/​howto/​buildroot.exigence + 
-  * https://​wiki.openwrt.org/​doc/​howto/​build+<code bash> 
 +mkdir /root/git 
 +cd /root/git 
 +git clone ssh://​root@chd.sx/​var/​git/​chd_openwrt.git 
 +cd /var/www 
 +ln -s /​root/​git/​chd_openwrt/​maj 
 + 
 +cd /​usr/​local/​bin/​ 
 +ln -s /​root/​git/​chd_openwrt/​build-openwrt-dev.sh 
 +ln -s /​root/​git/​chd_openwrt/​build-openwrt.sh 
 + 
 +cd /​var/​cache 
 +mkdir build-openwrt build-openwrt-dev 
 +chown www-data build-openwrt build-openwrt-dev 
 + 
 +editor /​etc/​fstab 
 +# Ajouter : 
 +</​code>​ 
 + 
 +<​code>​ 
 +tmpfs /​var/​cache/​build-openwrt/​build tmpfs uid=33,​gid=33,​mode=0750,​size=512M 0 0 
 +tmpfs /​var/​cache/​build-openwrt-dev/​build tmpfs uid=33,​gid=33,​mode=0750,​size=512M 0 0 
 +</​code>​ 
 + 
 +<code bash> 
 +mount -a # Vérifier que les deux tmpfs sont montés 
 +</​code>​ 
 + 
 +  * Lancer via le web une première tentative de mise à jour en utilisant les dépôts officiels (sans la modification de repositories.conf dans build-openwrt-dev.sh donc) 
 +  * Si tout fonctionne correctement,​ un fichier .bin est proposé au téléchargement après une bonne minute 
 +  * Le log est dans ''/​tmp/​build-openwrt-dev.sh_*''​ 
 +  * Faire un cache local des paquets ''​.ipk''​ nécessaires (gagne du temps, des ressources et limite grandement les aléas de la disponibilité du serveur web d'en face) : 
 + 
 +<​code>​ 
 +cd /​root/​git/​chd_openwrt 
 +./​mirrorring-bare-minimum.sh 
 +find /​var/​www/​lede-project 
 +# Doit lister environ 66 fichiers .ipk et quelques Packages.gz 
 +</​code>​ 
 + 
 +===== Compilation OpenWRT pour ImageBuilder custom ​(obsolète avec LEDE) ===== 
 + 
 +  * 2017-06-20 : Utiliser le ImageBuilder tout prêt de [[http://​lede-project.org]] 
 +  * [[https://​wiki.openwrt.org/​doc/​howto/​buildroot.exigence|https://​wiki.openwrt.org/​doc/​howto/​buildroot.exigence]] 
 +  * [[https://​wiki.openwrt.org/​doc/​howto/​build|https://​wiki.openwrt.org/​doc/​howto/​build]] 
 <code bash> <code bash>
 apt-get install git-core build-essential libssl-dev libncurses5-dev unzip gawk subversion apt-get install git-core build-essential libssl-dev libncurses5-dev unzip gawk subversion
Ligne 51: Ligne 164:
 sudo -u www-data bash sudo -u www-data bash
  
-editor ~/​.bashrc ​+editor ~/.bashrc
 # Ajouter : export PATH="/​var/​cache/​buildroot-cc-wr740nv5/​openwrt/​staging_dir/​host/​bin:/​var/​cache/​buildroot-cc-wr740nv5/​openwrt/​staging_dir/​toolchain-<​platform>​-<​gcc_ver>​-<​libc_ver>/​bin:​$PATH"​ # Ajouter : export PATH="/​var/​cache/​buildroot-cc-wr740nv5/​openwrt/​staging_dir/​host/​bin:/​var/​cache/​buildroot-cc-wr740nv5/​openwrt/​staging_dir/​toolchain-<​platform>​-<​gcc_ver>​-<​libc_ver>/​bin:​$PATH"​
 git clone https://​git.openwrt.org/​15.05/​openwrt.git git clone https://​git.openwrt.org/​15.05/​openwrt.git
Ligne 66: Ligne 179:
 ./​scripts/​diffconfig.sh > diffconfig ./​scripts/​diffconfig.sh > diffconfig
 </​code>​ </​code>​
 +
 <file conf diffconfig>​ <file conf diffconfig>​
 CONFIG_TARGET_ar71xx=y CONFIG_TARGET_ar71xx=y
Ligne 78: Ligne 192:
 # CONFIG_PACKAGE_uboot-ar71xx-nbg460n_550n_550nh is not set # CONFIG_PACKAGE_uboot-ar71xx-nbg460n_550n_550nh is not set
 </​file>​ </​file>​
 +
 <code bash> <code bash>
 make world make world
 </​code>​ </​code>​
 +
 +==== AirControl2 ====
 +
 +TODO : Détailler l'​installation (par cyril)
 +
 +=== Nettoyage base ===
 +Ajout d'une tâche cron à nous car c'est pas prévu et ces connards là stockent les métriques en pgsql et pas en rrd et n'​agrègent jamais rien. Le ''​vacuum full''​ n'est vraiment pas optionnel.
 +
 +
 +(VM)root@chd-stg2:/​etc/​cron.d#​ cat aircontrol2 ​
 +<code bash>
 +# cron-jobs for aircontrol 2
 +MAILTO=root
 +
 +0 2 28 * * root if [ -x /​opt/​Ubiquiti/​AirControl2/​cleanDB ]; then cd /​opt/​Ubiquiti/​AirControl2;​ ./cleanDB -e 300 -t 300 -s 30 -v > /dev/null; echo "​VACUUM FULL;" | sudo -u postgres psql ac2; fi
 +</​code>​
 +
technique/referentiel/chd-stg2.1470593218.txt.gz · Dernière modification: 2016/08/07 20:06 par admin