Skip to content

Basic OSPF Protocol Configuration

OSPF Protocol
Topology
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!                                           Area 0                                           !
!                                                                                            !
!                     vlan-id 10                         vlan-id 20                          !
!     ------                                 ------                              ------      !
!    !      ! .1    192.168.10.0/30       .2!      !.5 192.168.10.4/30        .6!      !     !
!    !  R1  !-------------------------------!  R2  !-------------------------- -!  R3  !     !
!    !      ! fxp1.1                 fxp2.1 !      ! fxp3.2              fxp4.1 !      !     !
!     ------                                 ------                              ------      !
!lo0.1 1.1.1.1/32                        lo0.2 2.2.2.2/32                   lo.3 3.3.3.3/32  !
!                                                                                            !                                                                                                                                               !
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
(using logical router)
Configure R1
[edit logical-routers R1]
root@iwing#set protocols ospf area 0 interface lo0.1
[edit logical-routers R1]
root@iwing#set protocols ospf area 0 interface fxp1.1

Configure R2
[edit logical-routers R2]
root@iwing#set protocols ospf area 0 interface lo0.2
[edit logical-routers R2]
root@iwing#set protocols ospf area 0 interface fxp2.1
[edit logical-routers R2]
root@iwing#set protocols ospf area 0 interface fxp3.2
Configure R3
[edit logical-routers R3]
root@iwing#set protocols ospf area 0 interface lo0.3
[edit logical-routers R3]
root@iwing#set protocols ospf area 0 interface fxp4.1
How To check
[edit]
root@iwing# run show ospf interface logical-router R1
Interface           State   Area            DR ID           BDR ID          Nbrs
fxp1.1              BDR     0.0.0.0         2.2.2.2         1.1.1.1            1
lo0.1               DR      0.0.0.0         1.1.1.1         0.0.0.0            0
[edit]
root@iwing# run show ospf interface logical-router R2
Interface           State   Area            DR ID           BDR ID          Nbrs
fxp2.1              DR      0.0.0.0         2.2.2.2         1.1.1.1            1
fxp3.2              BDR     0.0.0.0         3.3.3.3         2.2.2.2            1
lo0.2               DR      0.0.0.0         2.2.2.2         0.0.0.0            0
[edit]
root@iwing# run show ospf interface logical-router R3
Interface           State   Area            DR ID           BDR ID          Nbrs
fxp4.1              DR      0.0.0.0         3.3.3.3         2.2.2.2            1
lo0.3               DR      0.0.0.0         3.3.3.3         0.0.0.0            0
[edit]
root@iwing#
root@iwing# run show ospf neighbor logical-router R1
Address          Interface              State     ID               Pri  Dead
192.168.10.2     fxp1.1                 Full      2.2.2.2          128    34
[edit]
root@iwing# run show ospf neighbor logical-router R2
Address          Interface              State     ID               Pri  Dead
192.168.10.1     fxp2.1                 Full      1.1.1.1          128    32
192.168.10.6     fxp3.2                 Full      3.3.3.3          128    39
[edit]
root@iwing# run show ospf neighbor logical-router R3
Address          Interface              State     ID               Pri  Dead
192.168.10.5     fxp4.1                 Full      2.2.2.2          128    33
[edit]
root@iwing# run show route logical-router R1
inet.0: 7 destinations, 7 routes (7 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
1.1.1.1/32         *[Direct/0] 00:28:54
                   > via lo0.1
2.2.2.2/32         *[OSPF/10] 00:15:58, metric 1
                   > to 192.168.10.2 via fxp1.1
3.3.3.3/32         *[OSPF/10] 00:15:58, metric 2
                   > to 192.168.10.2 via fxp1.1
192.168.10.0/30    *[Direct/0] 00:28:55
                   > via fxp1.1
192.168.10.1/32    *[Local/0] 00:28:55
                   Local via fxp1.1
192.168.10.4/30    *[OSPF/10] 00:15:58, metric 2
                   > to 192.168.10.2 via fxp1.1
224.0.0.5/32       *[OSPF/10] 00:16:52, metric 1
                   MultiRecv
[edit]
root@iwing# run show route logical-router R2
inet.0: 8 destinations, 8 routes (8 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
1.1.1.1/32         *[OSPF/10] 00:16:01, metric 1
                   > to 192.168.10.1 via fxp2.1
2.2.2.2/32         *[Direct/0] 00:28:58
                   > via lo0.2
3.3.3.3/32         *[OSPF/10] 00:16:06, metric 1
                   > to 192.168.10.6 via fxp3.2
192.168.10.0/30    *[Direct/0] 00:28:58
                   > via fxp2.1
192.168.10.2/32    *[Local/0] 00:28:58
                   Local via fxp2.1
192.168.10.4/30    *[Direct/0] 00:28:58
                   > via fxp3.2
192.168.10.5/32    *[Local/0] 00:28:58
                   Local via fxp3.2
224.0.0.5/32       *[OSPF/10] 00:16:56, metric 1
                   MultiRecv
[edit]
root@iwing# run show route logical-router R3
inet.0: 7 destinations, 7 routes (7 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
1.1.1.1/32         *[OSPF/10] 00:16:05, metric 2
                   > to 192.168.10.5 via fxp4.1
2.2.2.2/32         *[OSPF/10] 00:16:10, metric 1
                   > to 192.168.10.5 via fxp4.1
3.3.3.3/32         *[Direct/0] 00:29:02
                   > via lo0.3
192.168.10.0/30    *[OSPF/10] 00:16:10, metric 2
                   > to 192.168.10.5 via fxp4.1
192.168.10.4/30    *[Direct/0] 00:29:02
                   > via fxp4.1
192.168.10.6/32    *[Local/0] 00:29:02
                   Local via fxp4.1
224.0.0.5/32       *[OSPF/10] 00:17:00, metric 1
                   MultiRecv
[edit]
root@iwing# run ping 3.3.3.3 logical-router R1
PING 3.3.3.3 (3.3.3.3): 56 data bytes
64 bytes from 3.3.3.3: icmp_seq=0 ttl=63 time=7.078 ms
64 bytes from 3.3.3.3: icmp_seq=1 ttl=63 time=0.830 ms
64 bytes from 3.3.3.3: icmp_seq=2 ttl=63 time=0.785 ms
64 bytes from 3.3.3.3: icmp_seq=3 ttl=63 time=0.776 ms
64 bytes from 3.3.3.3: icmp_seq=4 ttl=63 time=1.767 ms
64 bytes from 3.3.3.3: icmp_seq=5 ttl=63 time=0.788 ms
64 bytes from 3.3.3.3: icmp_seq=6 ttl=63 time=1.977 ms
64 bytes from 3.3.3.3: icmp_seq=7 ttl=63 time=0.788 ms
64 bytes from 3.3.3.3: icmp_seq=8 ttl=63 time=0.799 ms
^C
--- 3.3.3.3 ping statistics ---
9 packets transmitted, 9 packets received, 0% packet loss
round-trip min/avg/max/stddev = 0.776/1.732/7.078/1.941 ms
[edit]
root@iwing# run traceroute 3.3.3.3 logical-router R1
traceroute to 3.3.3.3 (3.3.3.3), 30 hops max, 40 byte packets
1  192.168.10.2 (192.168.10.2)  2.546 ms  1.091 ms  1.029 ms
2  3.3.3.3 (3.3.3.3)  1.803 ms  0.774 ms  0.974 ms
Final Configuration
[edit]
root@iwing# show
## Last changed: 2010-02-11 11:48:42 UTC
version 8.3R2.8;
system {
    host-name iwing;
    root-authentication {
         encrypted-password "$1$bd4ySf8Q$EaiiIc24ycXAWCQHKOJCf0"; ## SECRET-DATA
    }
    services {
          ftp;
          telnet;
    }
    syslog {
       user * {
           any emergency;
       }
       file messages {
           any notice;
           authorization info;
       }
       file interactive-commands {
          interactive-commands any;
       }
   }
}
logical-routers {
    R1 {
       interfaces {
           fxp1 {
              unit 1 {
                 vlan-id 10;
                 family inet {
                      address 192.168.10.1/30;
                 }
              }
           }
           lo0 {
               unit 1 {
                   family inet {
                        address 1.1.1.1/32;
                   }
               }
          }
      }
      protocols {
            ospf {
                area 0.0.0.0 {
                     interface lo0.1;
                     interface fxp1.1;
                }
            }
       }
   }
   R2 {
      interfaces {
          fxp2 {
              unit 1 {
                 vlan-id 10;
                 family inet {
                     address 192.168.10.2/30;
                 }
             }
        }
        fxp3 {
           unit 2 {
               vlan-id 20;
               family inet {
                         address 192.168.10.5/30;
               }
           }
        }
        lo0 {
           unit 2 {
                family inet {
                    address 2.2.2.2/32;
                }
            }
        }
     }
     protocols {
         ospf {
             area 0.0.0.0 {
                  interface lo0.2;
                  interface fxp2.1;
                  interface fxp3.2;
             }
         }
     }
  }
  R3 {
    interfaces {
        fxp4 {
            unit 1 {
               vlan-id 20;
               family inet {
                    address 192.168.10.6/30;
               }
           }
      }
      lo0 {
         unit 3 {
             family inet {
                 address 3.3.3.3/32;
             }
         }
      }
    }
    protocols {
       ospf {
          area 0.0.0.0 {
                 interface lo0.3;
                 interface fxp4.1;
           }
       }
     }
   }
 }
 interfaces {
   fxp1 {
       vlan-tagging;
   }
   fxp2 {
       vlan-tagging;
   }
   fxp3 {
       vlan-tagging;
   }
   fxp4 {
       vlan-tagging;
   }
}
[edit]
root@iwing#
No comments yet

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: