====== Différences ======
Cette page vous affiche les différences entre la révision choisie et la version actuelle de la page.
|
cours:activite2:quagga [2014/03/05 15:02] r.doiteau |
cours:activite2:quagga [2019/05/11 14:35] (Version actuelle) |
||
|---|---|---|---|
| Ligne 139: | Ligne 139: | ||
| ⇒ Démarrer les routeur R2 et R3. | ⇒ Démarrer les routeur R2 et R3. | ||
| ⇒ Configurer les routeur R2 et R3 selon la topologie. | ⇒ Configurer les routeur R2 et R3 selon la topologie. | ||
| + | |||
| + | |||
| + | ⇒Détails des fichiers /etc/network/interfaces | ||
| + | |||
| + | ==== R1 ==== | ||
| + | |||
| + | auto eth0 | ||
| + | iface eth0 inet static | ||
| + | address 192.168.1.254 | ||
| + | netmask 255.255.255.0 | ||
| + | |||
| + | auto eth1 | ||
| + | iface eth1 inet static | ||
| + | address 100.0.0.1 | ||
| + | netmask 255.0.0.0 | ||
| + | |||
| + | auto eth2 | ||
| + | iface eth2 inet static | ||
| + | address 102.0.0.1 | ||
| + | netmask 255.0.0.0 | ||
| + | |||
| + | ==== R2 ==== | ||
| + | |||
| + | |||
| + | auto eth0 | ||
| + | iface eth0 inet static | ||
| + | address 192.168.2.254 | ||
| + | netmask 255.255.255.0 | ||
| + | |||
| + | auto eth1 | ||
| + | iface eth1 inet static | ||
| + | address 100.0.0.2 | ||
| + | netmask 255.0.0.0 | ||
| + | |||
| + | auto eth2 | ||
| + | iface eth2 inet static | ||
| + | address 101.0.0.1 | ||
| + | netmask 255.0.0.0 | ||
| + | |||
| + | ==== R3 ==== | ||
| + | |||
| + | auto eth0 | ||
| + | iface eth0 inet static | ||
| + | address 192.168.3.254 | ||
| + | netmask 255.255.255.0 | ||
| + | |||
| + | auto eth1 | ||
| + | iface eth1 inet static | ||
| + | address 101.0.0.2 | ||
| + | netmask 255.0.0.0 | ||
| + | |||
| + | auto eth2 | ||
| + | iface eth2 inet static | ||
| + | address 102.0.0.2 | ||
| + | netmask 255.0.0.0 | ||
| + | |||
| + | |||
| + | |||
| + | |||
| ===== Préparation des machines clientes : S1, S2 et S3 ===== | ===== Préparation des machines clientes : S1, S2 et S3 ===== | ||
| Ligne 154: | Ligne 213: | ||
| ⇒ Configurer la routes par défaut. | ⇒ Configurer la routes par défaut. | ||
| + | |||
| + | ==== Route Statique ==== | ||
| + | |||
| + | === R1 === | ||
| + | |||
| + | R1(config)# ip route 192.168.2.0 255.255.255.0 100.0.0.2 | ||
| + | R1(config)# ip route 192.168.3.0 255.255.255.0 102.0.0.2 | ||
| + | |||
| + | === R2 === | ||
| + | |||
| + | R2(config)# ip route 192.168.1.0 255.255.255.0 100.0.0.1 | ||
| + | R2(config)# ip route 192.168.3.0 255.255.255.0 101.0.0.2 | ||
| + | |||
| + | === R3 === | ||
| + | |||
| + | R3(config)# ip route 192.168.2.0 255.255.255.0 101.0.0.1 | ||
| + | R3(config)# ip route 192.168.1.0 255.255.255.0 102.0.0.1 | ||
| + | |||
| + | |||
| + | ==== RIP ==== | ||
| + | |||
| + | <note warning>Effacer les routes statiques</note> | ||
| + | |||
| + | === R1 === | ||
| + | |||
| + | conf t | ||
| + | router rip | ||
| + | network 192.168.1.0/24 | ||
| + | network 100.0.0.0/8 | ||
| + | network 102.0.0.0/8 | ||
| + | passive-interface eth0 | ||
| + | |||
| + | === R2 === | ||
| + | |||
| + | conf t | ||
| + | router rip | ||
| + | network 192.168.2.0/24 | ||
| + | network 100.0.0.0/8 | ||
| + | network 101.0.0.0/8 | ||
| + | passive-interface eth0 | ||
| + | |||
| + | === R3 === | ||
| + | |||
| + | conf t | ||
| + | router rip | ||
| + | network 192.168.2.0/24 | ||
| + | network 101.0.0.0/8 | ||
| + | network 102.0.0.0/8 | ||
| + | passive-interface eth0 | ||
| + | |||
| + | ===== Intégration d'une quatrième interface INTERNET ===== | ||
| + | |||
| + | ==== Topologie ==== | ||
| + | |||
| + | {{:cours:activite2:quagga_1.png|}} | ||
| + | |||
| + | ==== Installation ==== | ||
| + | |||
| + | ⇒ modifier /etc/network/interfaces pour faire correspondre la topologie | ||
| + | |||
| + | ⇒ Mettre en place la translation d’adressage | ||
| + | |||
| + | <code=bash> | ||
| + | iptables -t nat -A POSTROUTING -o eth3 -j MASQUERADE | ||
| + | </code> | ||
| + | |||
| + | ⇒ Vérifiez la bonne prise en compte de la règle par : | ||
| + | |||
| + | <code=bash> | ||
| + | iptables -t nat -L | ||
| + | </code> | ||
| + | |||
| + | ⇒ Activer la translation d’adresses (NAT) au démarrage : | ||
| + | |||
| + | ⇒ Inscrivez la ligne suivante juste avant exit 0 mais après la ligne concernant le routage dans le fichier /etc/rc.local : | ||
| + | |||
| + | <code=bash> | ||
| + | /sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE | ||
| + | </code> | ||
| + | |||
| + | ⇒ Relancez votre système et vérifiez à nouveau l’existence de la règle NAT à l’aide de la commande vue plus haut. | ||
| + | |||
| + | ==== Détails running-config ==== | ||
| + | |||
| + | === R1 === | ||
| + | |||
| + | ! | ||
| + | hostname R1 | ||
| + | ! | ||
| + | debug rip packet | ||
| + | ! | ||
| + | interface eth0 | ||
| + | ipv6 nd suppress-ra | ||
| + | ! | ||
| + | interface eth1 | ||
| + | ipv6 nd suppress-ra | ||
| + | ! | ||
| + | interface eth2 | ||
| + | ipv6 nd suppress-ra | ||
| + | ! | ||
| + | interface eth3 | ||
| + | ipv6 nd suppress-ra | ||
| + | ! | ||
| + | interface lo | ||
| + | ! | ||
| + | router rip | ||
| + | version 2 | ||
| + | redistribute kernel | ||
| + | network 100.0.0.0/8 | ||
| + | network 102.0.0.0/8 | ||
| + | network 192.168.1.0/24 | ||
| + | network 192.168.254.0/24 | ||
| + | passive-interface eth0 | ||
| + | ! | ||
| + | ip forwarding | ||
| + | ! | ||
| + | line vty | ||
| + | ! | ||
| + | end | ||
| + | |||
| + | === R2 === | ||
| + | |||
| + | hostname R2 | ||
| + | ! | ||
| + | interface eth0 | ||
| + | ipv6 nd suppress-ra | ||
| + | ! | ||
| + | interface eth1 | ||
| + | ipv6 nd suppress-ra | ||
| + | ! | ||
| + | interface eth2 | ||
| + | ipv6 nd suppress-ra | ||
| + | ! | ||
| + | interface lo | ||
| + | ! | ||
| + | router rip | ||
| + | version 2 | ||
| + | network 100.0.0.0/8 | ||
| + | network 101.0.0.0/8 | ||
| + | network 192.168.2.0/24 | ||
| + | passive-interface eth0 | ||
| + | ! | ||
| + | ip forwarding | ||
| + | ! | ||
| + | line vty | ||
| + | ! | ||
| + | end | ||
| + | |||
| + | === R3 === | ||
| + | |||
| + | ! | ||
| + | hostname R3 | ||
| + | ! | ||
| + | interface eth0 | ||
| + | ipv6 nd suppress-ra | ||
| + | ! | ||
| + | interface eth1 | ||
| + | ipv6 nd suppress-ra | ||
| + | ! | ||
| + | interface eth2 | ||
| + | ipv6 nd suppress-ra | ||
| + | ! | ||
| + | interface lo | ||
| + | ! | ||
| + | router rip | ||
| + | version 2 | ||
| + | network 101.0.0.0/8 | ||
| + | network 102.0.0.0/8 | ||
| + | network 192.168.3.0/24 | ||
| + | passive-interface eth0 | ||
| + | ! | ||
| + | ip forwarding | ||
| + | ! | ||
| + | line vty | ||
| + | ! | ||
| + | end | ||
| + | |||
| + | |||