Difference between revisions of "OSPF (OpenBSD)"

From Wiki
Jump to navigation Jump to search
(Created page with "= Scenario 1 = == Configuration == * <code>/etc/sysctl.conf</code>: <pre> net.inet.ip.forwarding=1 </pre> * <code>/etc/ospfd.conf</code>: <pre> fib-update yes redistribute co...")
 
Line 106: Line 106:
 
  2  172.16.10.2 (172.16.10.2)  0.405 ms  0.463 ms  0.192 ms
 
  2  172.16.10.2 (172.16.10.2)  0.405 ms  0.463 ms  0.192 ms
 
  3  192.168.1.50 (192.168.1.50)  0.384 ms  0.516 ms  0.221 ms
 
  3  192.168.1.50 (192.168.1.50)  0.384 ms  0.516 ms  0.221 ms
 +
</pre>
 +
 +
<pre>
 +
cl3# traceroute 192.168.2.50                                                 
 +
traceroute to 192.168.2.50 (192.168.2.50), 64 hops max, 40 byte packets
 +
1  192.168.3.1 (192.168.3.1)  0.465 ms  0.211 ms  0.354 ms
 +
2  192.168.2.50 (192.168.2.50)  0.381 ms  0.558 ms  0.228 ms
 
</pre>
 
</pre>

Revision as of 22:04, 21 May 2021

Scenario 1

Configuration

  • /etc/sysctl.conf:
net.inet.ip.forwarding=1
  • /etc/ospfd.conf:
fib-update yes
redistribute connected

area 1.2.3.4 {
        interface vio1 {
                router-priority 5
        }
}
  • rcctl enable ospfd


Test

Check config:

# ospfd -n
ospf2# ospfctl show neighbor
ID              Pri State        DeadTime Address         Iface     Uptime
172.16.11.2     5   FULL/DR      00:00:30 172.16.11.2     vio2      00:09:40
172.16.10.1     5   FULL/DR      00:00:38 172.16.10.1     vio1      00:10:31
172.16.10.2     5   FULL/BCKUP   00:00:38 172.16.10.2     vio1      00:10:31
ospf2# ospfctl show rib 
Destination          Nexthop           Path Type    Type      Cost    Uptime  
172.16.10.1          172.16.10.1       Intra-Area   Router    10      00:10:56
172.16.10.2          172.16.10.2       Intra-Area   Router    10      00:10:56
172.16.10.3          0.0.0.0         C Intra-Area   Router    0       00:11:11
172.16.11.2          172.16.11.2       Intra-Area   Router    10      00:10:05
172.16.10.0/24       172.16.10.3     C Intra-Area   Network   10      00:10:56
172.16.11.0/24       172.16.11.1     C Intra-Area   Network   10      00:10:10
192.168.0.0/24       172.16.10.1       Type 1 ext   Network   110     00:10:56
192.168.1.0/24       172.16.10.2       Type 1 ext   Network   110     00:10:56
192.168.2.0/24       172.16.11.2       Type 1 ext   Network   110     00:10:05
192.168.3.0/24       172.16.11.2       Type 1 ext   Network   110     00:10:05
ospf2# ospfctl show fib 
flags: * = valid, O = OSPF, C = Connected, S = Static
Flags  Prio Destination          Nexthop          
*C        0 127.0.0.0/8          link#0
*S        8 127.0.0.0/8          127.0.0.1
*         1 127.0.0.1/32         127.0.0.1
*C        4 172.16.10.0/24       172.16.10.3
*C        4 172.16.11.0/24       172.16.11.1
*O       32 192.168.0.0/24       172.16.10.1
*O       32 192.168.1.0/24       172.16.10.2
*O       32 192.168.2.0/24       172.16.11.2
*O       32 192.168.3.0/24       172.16.11.2
*S        8 224.0.0.0/4          127.0.0.1
ospf2# route -n show -inet
Routing tables

Internet:
Destination        Gateway            Flags   Refs      Use   Mtu  Prio Iface
224/4              127.0.0.1          URS        0      233 32768     8 lo0  
127/8              127.0.0.1          UGRS       0        0 32768     8 lo0  
127.0.0.1          127.0.0.1          UHhl       1        2 32768     1 lo0  
172.16.10/24       172.16.10.3        UCn        2        0     -     4 vio1 
172.16.10.1        1e:d8:f7:47:c5:e2  UHLch      1        9     -     3 vio1 
172.16.10.2        d6:85:ac:1f:a3:1f  UHLch      1        8     -     3 vio1 
172.16.10.3        ee:56:8d:a8:00:48  UHLl       0       14     -     1 vio1 
172.16.10.255      172.16.10.3        UHb        0        0     -     1 vio1 
172.16.11/24       172.16.11.1        UCn        1        3     -     4 vio2 
172.16.11.1        52:51:e1:8e:5d:ba  UHLl       0        7     -     1 vio2 
172.16.11.2        4a:95:e6:49:73:26  UHLch      2       16     -     3 vio2 
172.16.11.255      172.16.11.1        UHb        0        0     -     1 vio2 
192.168.0/24       172.16.10.1        UG         0       26     -    32 vio1 
192.168.1/24       172.16.10.2        UG         0        0     -    32 vio1 
192.168.2/24       172.16.11.2        UG         0       14     -    32 vio2 
192.168.3/24       172.16.11.2        UG         0       12     -    32 vio2
  • Traceroute
srv0# traceroute 192.168.3.50                                                  
traceroute to 192.168.3.50 (192.168.3.50), 64 hops max, 40 byte packets
 1  192.168.0.1 (192.168.0.1)  0.571 ms  0.079 ms  0.4 ms
 2  172.16.10.3 (172.16.10.3)  0.413 ms  0.565 ms  0.239 ms
 3  172.16.11.2 (172.16.11.2)  0.278 ms  0.566 ms  0.226 ms
 4  192.168.3.50 (192.168.3.50)  0.45 ms  0.553 ms  0.286 ms
srv0# traceroute 192.168.1.50 
traceroute to 192.168.1.50 (192.168.1.50), 64 hops max, 40 byte packets
 1  192.168.0.1 (192.168.0.1)  0.131 ms  0.096 ms  0.51 ms
 2  172.16.10.2 (172.16.10.2)  0.405 ms  0.463 ms  0.192 ms
 3  192.168.1.50 (192.168.1.50)  0.384 ms  0.516 ms  0.221 ms
cl3# traceroute 192.168.2.50                                                   
traceroute to 192.168.2.50 (192.168.2.50), 64 hops max, 40 byte packets
 1  192.168.3.1 (192.168.3.1)  0.465 ms  0.211 ms  0.354 ms
 2  192.168.2.50 (192.168.2.50)  0.381 ms  0.558 ms  0.228 ms