
R1 e0 -> 10.0.0.1 /24 e2 -> 10.0.1.1/26 e1 -> 11.0.0.1/30 H1 eth0 -> 10.0.0.2 /24
0.0.0.0 -> rota default, dá match com tudo (não quer saber de bits)
H1
| Destination | Máscara | Next Hop | Gateway | Interface |
|---|---|---|---|---|
| 10.0.0.0 | 255.255.255.0 | 10.0.0.1 | 0.0.0 | eth0 |
| 0.0.0.0 | 0.0.0.0 | 10.0.0.1 | 10.0.0.1 |
R1
| Destination | Máscara | N. Hop | Gateway | IF |
|---|---|---|---|---|
| 10.0.0.0 | 255.255.255.0 | 10.0.0.1 | 0.0.0.0 | e0 |
| 10.0.1.0 | 255.255.255.192 | 10.0.1.1 | 0.0.0.0 | e2 |
| 11.0.0.0 | 255.255.255.252 | 11.0.0.1 | 0.0.0.0 | e1 |
| 0.0.0.0 | 0.0.0.0 | 11.0.0.2 | 11.0.0.2 | e1 |
| 192.168.0.0 | 255.255.255.0 | 11.0.0.2 | 11.0.0.2 | e1 |
| 192.168.0.0 | 255.255.0.0 | 15.0.0.1 | 15.0.0.1 | e3 |
| 192.168.0.10 -> match 0.0.0.0/0 -> 0 bits |
-> match 192.168.0.0/24 -> **24 bits** chosen because has more bits
-> match 192.168.0.0/16 -> 16 bits
Notes: in line 2 mask is 255.255.255.192 (11111111 111111111 11111111 11000000) because we had 2 more bits set to 1 because there are 2² subnets. (26-24 = 2 = N).