OSPF:
Bon ces derniers jours, j’ai joué avec OSPF.
C’est bien marrant pour éviter de se taper un paquets de routes statiques et rendre redondant vos liens (si physiquement ils le sont ;) ).
Voici ce que cela peut donner (c’est très rapide comme amusement):
- Test1 OSPF sur Flexrouter - ================================================= - Christophe Lucas - $Id: test1.txt,v 1.4 2007/05/11 09:16:01 clucas Exp clucas $ 1. Architecture ================ [ A ] <===========> [ B ] 2. Machines ============ 2.1 Machine A ~~~~~~~~~~~~ nas-default # ip addr 1: eth0: mtu 1500 qdisc pfifo_fast qlen 1000 link/ether 00:40:63:ec:5a:b0 brd ff:ff:ff:ff:ff:ff inet 192.168.1.250/24 brd 192.168.1.255 scope global eth0 2: eth1: mtu 1500 qdisc pfifo_fast qlen 1000 link/ether 00:40:63:ec:5a:af brd ff:ff:ff:ff:ff:ff inet 192.168.10.1/24 brd 192.168.10.255 scope global eth1 inet 192.168.20.1/24 brd 192.168.20.255 scope global eth1 3: lo: mtu 16436 qdisc noqueue link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo nas-default # ip route 192.168.20.0/24 dev eth1 proto kernel scope link src 192.168.20.1 192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.250 192.168.10.0/24 dev eth1 proto kernel scope link src 192.168.10.1 224.0.0.0/4 dev eth0 scope link default via 192.168.1.1 dev eth0 nas-default # cat /usr/local/etc/zebra.conf hostname default password 1234 enable password 1234 ! interface eth0 ip address 192.168.1.250/24 multicast no shutdown ! interface eth1 ip address 192.168.10.1/24 ip address 192.168.20.1/24 no shutdown hostname default password 1234 enable password 1234 log file /var/log/ospfd.log ! router ospf network 192.168.1.0/24 area 0 network 192.168.10.0/24 area 1 network 192.168.20.0/24 area 1 ! line vty ! User Access Verification Password: default> ena Password: default# sh ip os default# sh ip ospf route ============ OSPF network routing table ============ N 192.168.1.0/24 [10] area: 0.0.0.0 directly attached to eth0 N 192.168.10.0/24 [10] area: 0.0.0.1 directly attached to eth1 N 192.168.20.0/24 [10] area: 0.0.0.1 directly attached to eth1 ============ OSPF router routing table ============= R 192.168.32.242 [10] area: 0.0.0.0, ASBR via 192.168.1.200, eth0 ============ OSPF external routing table =========== default# sh ip ospf bo default# sh ip ospf border-routers ============ OSPF router routing table ============= R 192.168.32.242 [10] area: 0.0.0.0, ASBR via 192.168.1.200, eth0 default# default# sh ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface RXmtL RqstL DBsmL 192.168.32.242 1 Full/Backup 00:00:39 192.168.1.200 eth0:192.168.1.250 0 0 0 default# 2.2 Machine B ~~~~~~~~~~~ s-labo # ip addr 1: eth0: mtu 1500 qdisc pfifo_fast qlen 1000 link/ether 00:40:63:e8:75:46 brd ff:ff:ff:ff:ff:ff inet 192.168.1.200/24 brd 192.168.1.255 scope global eth0 2: lo: mtu 16436 qdisc noqueue link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo 3: eth1: mtu 1500 qdisc pfifo_fast qlen 1000 link/ether 00:50:fc:5f:ca:3f brd ff:ff:ff:ff:ff:ff inet 192.168.5.1/24 scope global eth1 4: gre0: mtu 1476 qdisc noop link/gre 0.0.0.0 brd 0.0.0.0 5: infosat@NONE: mtu 1476 qdisc noqueue link/gre 217.169.242.200 peer 217.169.242.129 inet 192.168.32.242/30 brd 192.168.32.243 scope global infosat nas-labo # ip route 192.168.32.240/30 dev infosat proto kernel scope link src 192.168.32.242 192.168.5.0/24 dev eth1 proto kernel scope link src 192.168.5.1 192.168.20.0/24 via 192.168.1.250 dev eth0 proto zebra metric 20 equalize 192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.200 192.168.10.0/24 via 192.168.1.250 dev eth0 proto zebra metric 20 equalize default via 192.168.1.1 dev eth0 nas-labo # cat /usr/local/etc/zebra.conf hostname labo password 1234 enable password 1234 ! interface eth0 ip address 192.168.1.200/24 multicast no shutdown ! interface eth1 ip address 192.168.5.1/24 no shutdown ! line vty ! nas-labo # cat /usr/local/etc/ospfd.conf hostname labo password 1234 enable password 1234 log file /var/log/ospfd.log ! router ospf network 192.168.1.0/24 area 0 network 192.168.5.0/25 area 2 redistribute static line vty ! User Access Verification Password: labo> ena Password: labo# sh ip os labo# sh ip ospf route ============ OSPF network routing table ============ N 192.168.1.0/24 [10] area: 0.0.0.0 directly attached to eth0 N IA 192.168.10.0/24 [20] area: 0.0.0.0 via 192.168.1.250, eth0 N IA 192.168.20.0/24 [20] area: 0.0.0.0 via 192.168.1.250, eth0 ============ OSPF router routing table ============= R 192.168.20.1 [10] area: 0.0.0.0, ABR via 192.168.1.250, eth0 ============ OSPF external routing table =========== labo# sh ip ospf ne labo# sh ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface RXmtL RqstL DBsmL 192.168.20.1 1 Full/DR 00:00:40 192.168.1.250 eth0:192.168.1.200 0 0 0 labo# sh ip ospf border-routers ============ OSPF router routing table ============= R 192.168.20.1 [10] area: 0.0.0.0, ABR via 192.168.1.250, eth0
Si vous désirez en savoir un peu plus sur OSPF, je vous recommande ces liens: