---
# System prepended metadata

title: Algorithme de routage TP1

---

---
title: Algorithme de routage TP1
authors: Godefroy Simon, Hitschz Pierre, Guillaumie Bilal, Torret Lucas, Nonclercq Basile 
---

# Configuration de l'îlot

## Minicom

Port serie correspondant: dmesg | grep tty
> ttyS1
> 9600 speed

## Routeur 1 (Pierrot)

```
195.0.1.1    195.0.2.1
         V   V
A ------ R1 ------ R2
|
- 195.0.1.2
```
configuration des interfaces
```
enable
conf terminal
interface FastEthernet 4
ip address 195.0.2.1 255.255.255.0
no shutdown 
```


---

Sauvegarde de la config
```
cp running-config startup-config
```

Mise en place de RIP
```
conf terminal
router rip
version 2
network 195.0.1.0
network 195.0.2.0
```




## Network 2 (Simon)

```
195.0.2.2    145.3.0.1
         V   V
R1 ------ R2 ------ R3
          |
           - B 195.0.2.10
```
configuration des interfaces
```
enable
conf terminal
interface FastEthernet 0/0
ip address 195.0.2.2 255.255.255.0
no shutdown 
```

---

Sauvegarde de la config
```
copy running-config startup-config
```


---

Mise en place de RIP
```
conf terminal
router rip
version 2
network 145.3.0.0
network 195.0.2.0
```


---

Changer DR/BDR : 
```
R2#show ip ospf neighbor
R2# configure terminal
R2(conf)# interface FastEthernet 0/1
R2(interface)# ip ospf priority 1
R2(interface)# exit
R2(conf)#exit
R2#clear ip ospf process
```

## Network 3 (Babidiii)
```
145.3.0.2    195.0.4.2
         V   V
R2 ------ R3 ------ R4
          |
           - C 145.3.0.11
```

### Ip 
```sh
interface FastEthernet 0/0
address 145.3.0.2 255.255.0.000
no shutdown

interface FastEthernet 0/1
address 195.0.4.2 255.255.255.0
no shutdown
```

### Networks

```sh
config terminal
router rip
version 2
network 195.0.3.0
network 145.3.0.0
```

```sh
ssh babidiii@145.3.0.22
```

```cisco
config terminal
line console 0
password mypwd
login
exec-timeout 5 30
exit
```

### Ajout de ospf
```cisco
configure terminal
router rip
redistribute ospf <process> metric 3
 
configure terminal 
router ospf
network 145.3.0.0 0.0.255.255 area 0
redistribute rip
```

Ajout serial
```cisco
config terminal
interface Serial 0/0/0
ip address 192.168.1.13 255.255.255.252
no shutdown

config terminal
interface Serial 0/0/1
ip address 192.168.1.10 255.255.255.252
no shutdown

config terminal
router ospf 1
network 192.168.1.12 0.0.0.3 area 3
network 192.168.1.8 0.0.0.3 area 3

show controllers Serial 0/0/0 # -> DCE ?
show controllers Serial 0/0/1 # -> DCE ?

# DCE sur 0/0/0 donc :
config terminal 
interface Serial 0/0/0
clock rate 64000
```

## Network 4 (lutorret)
```
195.0.4.1    195.0.5.1
         V  V
R3 ------ R4 ------ C
          |
           - C 195.0.4.10
```

### Ip 
```sh
interface FastEthernet 
address 195.0.4.1 255.255.255.0
no shutdown

interface VLAN 1
address 195.0.5.1 255.255.255.0
no shutdown
```

### Networks

```sh
config terminal
router rip
version 2
network 195.0.4.0
network 195.0.5.0
```

```sh
ssh lutorret@195.0.4.1
```

## Configuration des PCs

### PC E

Relier au R4 (sur l'interface qui a pour IP: 195.0.5.1)
* Set ip: ifconfig enp0s31f6 195.0.5.2 netmask 255.255.255.0
* Set gw: route add default gw 195.0.5.1

## Configuration SSH

1. enable
2. conf f
3. username user password cisco. (user: lutorret, babidiii, simon, pierrot)
4. hostname routerName. (R1,R2,router-3,router-4). Note: également utilisé pour gen la clé RSA
5. ip domain-name cisco.com (def nom de deomane = concat(hostname + domain-name) Aussi use pour gen la clé
6. crypto key generate rsa modulus 1024

Activation du ssh:
1. line vty 0 4 (ouvre 5 lignes virtuelles) -> 5 admin à al fois
2. transport input ssh (definit quel protocole les vty ont le droit d'utiliser)
3. login local (Def ou se trouve la base des comptes users)
4. exit

[configure command line access](https://www.cisco.com/c/en/us/td/docs/routers/access/800M/software/800MSCG/routconf.html#29868)

Pour full acces ssh: 
1. line console 0 -> Enters line configuration mode, and specifies the type of line.
2. password password -> Specifies a unique password for the console terminal line.
3. login -> Enables password verification at the terminal login session.
4. exec-timeout 5 30 -> Sets the interval that the EXEC command interpreter waits until user input is detected. The default is 10 minutes. You can also optionally add seconds to the interval value.

# From RIP to OSPF aka how stonks un max

## Configure OSPF 

1. Router ospf 100 (100 -> num process ospf)
2. network 10.0.x.1 0.0.0.255 area 0
Info about ospf:
4. show ip ospf
5. show ip ospf neighbor

Attribution d'une priorité pour l'éléction: `ip ospf priority 255` (255 = max)
Verification DR et BDR: `ip ospf interface f0/0` (ex)


Plus de ping -> car pas de redistrib entre les protocoles RIP et OSPF

Soluce: 

 
Au niveau du protocole RIP: 

1. `conf t`
2. `router ospf process number`
3. `redistribute rip`

Au niveau protocole OSPF: 

1. `conf terminal`
2. `router rip`
3. `redistribute ospf 1 metric ` (1 = processID OSPF). Note: mettre une metric sinon metric par defaut = infini ou 0 si static route


# Connectivité entre îlot (ilot 3)
GRO rageu
```
 ilot1 --------- ilot 2
  |                |
  |                |
  |                |
 ilot4 --------- ilot 3
```

* ilot1: ip: 192.168.1.2 192.168.1.5
* ilot2: ip: 192.168.1.6 192.168.1.9
* ilot3: ip: 192.168.1.10 192.168.1.13
* ilot4: ip: 192.168.1.14 192.168.1.1

DCE gère la synchronisation de sur une liaison série.
Gérer le débit max sur la liaison: 64000 (64kb/s) -> car liaison "grosse" sur "petite" aka gros débit to low debit

Commandes:
1. `show controlers serial 0/0/0`
2. `interface serial 0/0/0` (ex)
3. `clock rate 64000`


## Port monitoring [src](https://www.astarox.com/blog/configuration-port-mirroring-switch-cisco-capture-wireshark-b23.html)


Set auth par md5 sur liaisons RIP:
![](https://i.imgur.com/NqA2mK7.png)


1. `ip rip authentication mode md5`
2. 