Files
mkdocs/docs/Divers/reseau/rt-ac88u-merlin.md
2024-04-06 09:54:09 +02:00

226 lines
5.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Asus RT-AC88U @ Merlin
### Backup (paramètres et partition JFFS)
A faire avant la mise-à-jour du firmware;
Administration -> Restaurer -> **Router settings** -> Enregistrer les Paramètres
Administration -> Restaurer -> **JFFS Partition** -> Backup JFFS partition
### Activer SSH et les scripts JFFS:
1. Aller à **Administration** puis onglet **Système**.
2. Activer **Enable JFFS custom scripts and configs**.
3. Option USB Mode, choisir **USB 2.0**.
4. Activer **Enable SSH sur LAN**.
5. Changer le port SSH (entre 49152 et 65535).
6. Activer **Autoriser la connexion par mot de passe**.
7. Activer **Enable SSH Brute Force Protection**.
8. **Appliquer**.
#### Effacer le cache DNS
```bash
$ ssh bruno@192.168.2.1 -p 26397 -v
$ killall -1 dnsmasq
```
Autre solution: redémarrer le routeur.
#### Ajouter des entrées DNS
Activer la partition JFFS dans les paramètres.
The idea of JFFS is to create a partition stored inside the router's flash storage to put scripts in. If you disable JFFS, it will disable the partition, meaning the firmware will no longer be able to access your config file at boot time to merge it with the main config file.
```bash
$ ssh bruno@192.168.2.1 -p 26397 -v
$ nano /jffs/configs/dnsmasq.conf.add
# ajouter la ligne "address=/clicclac.synology.me/192.168.2.7"
$ service restart_dnsmasq
```
### Dnsmasq:
#### Configuration:
```bash
$ nano /etc/dnsmasq.conf
```
#### Vérifier la configuration:
```bash
$ dnsmasq --test
```
#### Vérifier la résolution DNS:
```bash
$ dig clicclac.synology.me +short
90.62.226.41
```
```bash
dig clicclac.synology.me
; <<>> DiG 9.10.6 <<>> clicclac.synology.me
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 4051
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;clicclac.synology.me. IN A
;; ANSWER SECTION:
clicclac.synology.me. 171 IN A 90.62.226.41
;; Query time: 4 msec
;; SERVER: 172.20.10.1#53(172.20.10.1)
;; WHEN: Thu Nov 26 13:20:21 CET 2020
;; MSG SIZE rcvd: 65
```
#### Bloquer un domain:
Ajouter dans le fichier `/etc/dnsmasq.conf`:
```bash
address=/blocked.example/
address=/another.blocked.example/
```
ou dans un fichier séparé `/etc/dnsmasq.d/blocklist.conf`:
```bash
conf-file=/etc/dnsmasq.d/blocklist.conf
# ou
conf-dir=/etc/dnsmasq.d/,*.conf
```
#### Notification de mise-à-jour:
https://github.com/RMerl/asuswrt-merlin.ng/wiki/Update-Notification-Example
```bash
bruno@RT-AC88U-0928:/bin# /jffs/scripts/update-notification
```
### amtm
[amtm](https://diversion.ch/amtm.html) est une GUI qui permet d'installer des scripts dans les routeurs Asus fonctionnant sous le firmware [Asuswrt-Merlin](https://www.asuswrt-merlin.net) (depuis la v384.15, amtm est installé d'office) ([forum](https://www.snbforums.com/threads/amtm-the-asuswrt-merlin-terminal-menu.42415/page-124)).
Préparation:
1. Formater une clé USB au format ext.
2. Insérer la clé dans le port USB du routeur.
3. Se connecter au routeur en ssh.
4. Entrer **amtm** ou **/jffs/scripts/amtm** pour ouvrir **amtm**.
5. Avec la commander **fd**, formatter la clé au format **ext4**, avec un **label** (routeur). Le routeur redémarre.
Installer [Diversion](https://diversion.ch/diversion/diversion.html) (AD Blocker)
1. Se connecter au routeur en ssh.
2. Entrer **amtm** ou **/jffs/scripts/amtm** pour ouvrir **amtm**.
3. Taper **i** pour voir les scripts disponibles.
4. Taper **1** pour installer Diversion
```bash
amtm 3.1.8 FW by thelonelycoder
RT-AC88U (armv7l) FW-384.19 @ 192.168.2.1
The Asuswrt-Merlin Terminal Menu
1 open Diversion v4.1.12
2 install Skynet - the Router Firewall
3 install FlexQoS - Flexible QoS Enhancement
3d install FreshJR QOS - Adaptive QOS (deprecated)
```
Modules installés:
- Skynet (nécessite un fichier swap de 2 Go):
- LED Control: éteint les LED de 21h30 à 7h
Désinstaller Skynet:
```bash
sh /jffs/scripts/firewall uninstall
```
#### Reset usine
1. Éteignez le routeur.
2. Appuyez et maintenez le bouton "WPS" puis allumez le routeur.
3. Le voyant d'alimentation est allumé **(continue à tenir le bouton WPS****).**
4. Relâchez le **bouton WPS** lorsque le voyant d'alimentation commence à clignoter.
5. Le voyant d'alimentation cesse de clignoter et le routeur redémarre automatiquement.
https://www.asus.com/fr/support/FAQ/1039077
Login / password: admin / admin
#### AsusWRT-Merlin
[Forum](https://www.snbforums.com/forums/asuswrt-merlin.42/)
[Custom config files](https://github.com/RMerl/asuswrt-merlin.ng/wiki/Custom-config-files)
https://github.com/RMerl/asuswrt-merlin.ng/wiki/Custom-config-files
https://www.drazzib.com/docs/admin/dnsmasq.html
https://wiki.archlinux.org/index.php/Dnsmasq
Asus-wrt vs Asus-Merlin:
https://www.snbforums.com/threads/dnsmasq-conf-add-without-custom-firmware.43244/
https://www.snbforums.com/threads/how-to-use-dnsmasq-conf-add.8785/
https://www.henriksommerfeld.se/firmware-update-notifications-for-my-asus-router/