Skip to content

Basic OSPF Protocol Configuration

13 February 2010
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# 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#
4 Comments leave one →
  1. setra permalink
    16 February 2010 10:00 AM

    mas saya baru instal olive dan mau coba llogical router nya, dari topology diatas, dan saya coba step by step mengkonekan R1 – R2 di level ip (belum sampai level OSPF), saya mendapat error

    root@setra# run ping 192.168.10.1 logical-router R1
    PING 192.168.10.1 (192.168.10.1): 56 data bytes
    ping: sendto: Can’t assign requested address

    kurang konfiga apa ya mas ? seting fxp1.1 dimana ya ?

    • 16 February 2010 10:09 AM

      boleh saya liat root@iwing>show interface terse
      *muncul berapa interface ?

      sudah buat vlan-tagging kah ?

      interfaces {
      fxp1 {
      vlan-tagging;
      }
      fxp2 {
      vlan-tagging;
      }
      fxp3 {
      vlan-tagging;
      }
      fxp4 {
      vlan-tagging;
      }
      }

  2. setra permalink
    17 February 2010 9:30 AM

    root@setra> show interfaces terse
    Interface Admin Link Proto Local Remote
    dsc up up
    fxp0 up up
    fxp0.0 up up inet 1.2.3.4/24
    gre up up
    ipip up up
    lo0 up up
    lo0.1 up up inet 1.1.1.1 –> 0/0
    lo0.2 up up inet 2.2.2.2 –> 0/0
    lo0.16385 up up inet
    inet6 fe80::2aa:ff:fe00:101
    lsi up up
    mtun up up
    pimd up up
    pime up up
    tap up up
    =====
    ko ip dari interface fxp1 di logical-router R1 dan fxp2 di logical router R2 tidak muncul, padahal sudah saya configure

    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;
    }
    }
    }
    }

    root@setra# run show configuration logical-routers R2
    interfaces {
    fxp2 {
    unit 1 {
    vlan-id 10;
    family inet {
    address 192.168.10.2/30;
    }
    }
    }
    lo0 {
    unit 2 {
    family inet {
    address 2.2.2.2/32;
    }
    }
    }
    }
    ====

    vlan tagging nya juga sudah di set,,

    interfaces {
    fxp0 {
    unit 0 {
    family inet {
    address 1.2.3.4/24;
    }
    }
    }
    fxp1 {
    vlan-tagging;
    }
    fxp2 {
    vlan-tagging;
    }
    fxp3 {
    vlan-tagging;
    }
    fxp4 {
    vlan-tagging;
    }

    ====
    berikut error message nya,
    root@setra# run ping 192.168.10.1 logical-router R1
    PING 192.168.10.1 (192.168.10.1): 56 data bytes
    ping: sendto: No route to host
    ping: sendto: No route to host
    ping: sendto: No route to host
    ^C

    seperti interface nya belum up mas….
    ====

    • 18 February 2010 3:50 AM

      boleh liat perintah untuk menyalakan junos nya :
      ini punya ku :

      jqemu.exe -L . -m 256 -hda olive.img -serial telnet::2007,server -localtime -net nic,vlan=0,macaddr=00:aa:00:00:01:02,model=i82559er -net nic,vlan=1,macaddr=00:aa:00:00:01:03,model=i82559er -net nic,vlan=1,macaddr=00:aa:00:00:01:04,model=i82559er -net nic,vlan=2,macaddr=00:aa:00:00:01:05,model=i82559er -net nic,vlan=2,macaddr=00:aa:00:00:01:06,model=i82559er -vnc :1 -usbdevice tablet -net tap,vlan=0,ifname=Tap1
      (kalau saya terka mas baru bikin mengupkan satu interfaces yaitu fxp0, saran saya buat dulu interfaaces yang lain, coba pake command saya diatas, biarkan warning vlan yang salah), tapi pastikan ketika show interface terse muncul interface selain fxp0, baru buat vlan taggingnya.

      root@iwing> show interfaces terse
      Interface Admin Link Proto Local Remote
      dsc up up
      fxp0 up up
      fxp0.0 up up inet 1.2.3.4/24
      fxp1 up up
      fxp1.1 up up inet 192.168.10.1/30
      iso
      mpls
      fxp1.2 up up inet 192.168.10.10/30
      fxp1.3 up up inet 192.168.10.14/30
      fxp1.32767 up up
      fxp2 up up
      fxp2.1 up up inet 192.168.10.2/30
      iso
      mpls
      fxp2.2 up up inet 192.168.10.9/30
      fxp2.3 up up inet 192.168.10.13/30
      fxp2.32767 up up
      fxp3 up up
      fxp3.2 up up inet 192.168.10.5/30
      iso
      mpls
      fxp3.32767 up up
      fxp4 up up
      fxp4.1 up up inet 192.168.10.6/30
      iso
      mpls
      fxp4.32767 up up
      gre up up
      ipip up up
      lo0 up up
      lo0.1 up up inet 1.1.1.1 –> 0/0
      iso 49.0001.1111.1111.1111
      lo0.2 up up inet 2.2.2.2 –> 0/0
      iso 49.0001.2222.2222.2222
      lo0.3 up up inet 3.3.3.3 –> 0/0
      iso 49.0001.3333.3333.3333
      lo0.4 up up inet 4.4.4.4 –> 0/0
      lo0.5 up up inet 5.5.5.5 –> 0/0
      lo0.16385 up up inet
      inet6 fe80::2aa:ff:fe00:102
      lsi up up
      mtun up up
      pimd up up
      pime up up
      tap up up

      root@iwing>

      selamat mencoba

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: