wdcsx 发表于 2018-7-28 06:33:54

Juniper Olive动态路由RIP配置案例


  上图为配置拓扑图
  R1,R2,R3,R4全部通过RIPv2获取路由,以下为配置文档。
  system {
  root-authentication {
  encrypted-password "$1$PC0IgEDw$xh19u99VsA6AzoTDk9bFz."; ## SECRET-DATA
  }
  login {
  user mengmeng {
  uid 2001;
  class super-user;
  authentication {
  encrypted-password "$1$kEim0KF/$ezlHwRupnb7HFdUZVdIvE."; ## SECRET-DATA
  }
  }
  }
  services {
  telnet;
  web-management {
  http {
  port 80;
  }
  }
  }
  }
  logical-routers {
  R1 {
  interfaces {
  em1 {
  unit 12 {
  vlan-id 12;
  family inet {
  address 12.1.1.1/24;
  }
  }
  unit 13 {
  vlan-id 13;
  family inet {
  address 13.1.1.1/24;
  }
  }
  }
  }
  protocols {
  rip {
  group juniper {
  export juniper1;
  neighbor em1.13;//相当于在接口上启用rip
  neighbor em1.12;
  }
  }
  }
  policy-options {
  policy-statement juniper1 {
  term 1 {
  from interface [ em1.12 em1.13 ];//juniper默认情况下学习从邻居学习到的rip路由,但不将其转发出去,所以在此要使用policy-option(路由策略),来实现rip路由的转发,这条命令的意思就是将接口em1.12,em1.13所在的直连接口路由发送到rip中去
  then accept;
  }
  }
  }
  }
  R2 {
  interfaces {
  em2 {
  unit 12 {
  vlan-id 12;
  family inet {
  address 12.1.1.2/24;
  }
  }
  unit 24 {
  vlan-id 24;
  family inet {
  address 24.1.1.2/24;
  }
  }
  }
  }
  protocols {
  rip {
  group juniper {
  export juniper2; //定义转发策略,juniper默认不会将直连网络宣告出去,需要定义转发策略
  neighbor em2.12;//相当于在接口上启用rip
  neighbor em2.24;
  }
  }
  }
  policy-options {
  policy-statement juniper2 {
  term 1 {
  from interface [ em2.12 em2.24 ]; //将在这些接口上收到的路由发布出去,包括这些接口的网络号
  then accept;
  }
  }
  }
  }
  R3 {
  interfaces {
  em3 {
  unit 13 {
  vlan-id 13;
  family inet {
  address 13.1.1.3/24;
  }
  }
  unit 34 {
  vlan-id 34;
  family inet {
  address 34.1.1.3/24;
  }
  }
  }
  }
  protocols {
  rip {
  group juniper {
  export juniper3;
  neighbor em3.13;
  neighbor em3.34;
  }
  }
  }
  policy-options {
  policy-statement juniper3 {
  term 1 {
  from interface [ em3.13 em3.34 ];
  then accept;
  }
  }
  }
  }
  R4 {
  interfaces {
  em4 {
  unit 24 {
  vlan-id 24;
  family inet {
  address 24.1.1.4/24;
  }
  }
  unit 34 {
  vlan-id 34;
  family inet {
  address 34.1.1.4/24;
  }
  }
  }
  }
  protocols {
  rip {
  group juniper {
  export juniper4;
  neighbor em4.24;
  neighbor em4.34;
  }                                                                      }
  }
  policy-options {
  policy-statement juniper4 {
  term 1 {
  from interface [ em4.24 em4.34 ];
  then accept;
  }
  }
  }
  }
  }
  interfaces {
  em0 {
  unit 0 {
  family inet {
  address 192.168.1.254/24;
  }
  }
  }
  em1 {
  vlan-tagging;
  }
  em2 {
  vlan-tagging;
  }
  em3 {
  vlan-tagging;
  }
  em4 {
  vlan-tagging;
  }
  }
  mengmeng# run show rip neighbor logical-router all
  logical-router: R1
  Source          Destination   Send   Receive   In
  Neighbor          StateAddress         Address         Mode   Mode   Met
  --------          ------------         -----------   ----   ----------
  em1.12               Up 12.1.1.1      224.0.0.9       mcastboth       1
  em1.13               Up 13.1.1.1      224.0.0.9       mcastboth       1
  -----
  logical-router: R2
  em2.12               Up 12.1.1.2      224.0.0.9       mcastboth       1
  em2.24               Up 24.1.1.2      224.0.0.9       mcastboth       1
  -----
  logical-router: R3
  em3.13               Up 13.1.1.3      224.0.0.9       mcastboth       1
  em3.34               Up 34.1.1.3      224.0.0.9       mcastboth       1
  -----
  logical-router: R4
  em4.24               Up 24.1.1.4      224.0.0.9       mcastboth       1
  em4.34               Up 34.1.1.4      224.0.0.9       mcastboth       1
  -----
  logical-router: default
  RIPv2 instance is not running
  
  mengmeng# run show route logical-router all
  logical-router: R1
  inet.0: 7 destinations, 7 routes (7 active, 0 holddown, 0 hidden)
  + = Active Route, - = Last Active, * = Both
  12.1.1.0/24      * 07:22:59
  > via em1.12
  12.1.1.1/32      * 07:22:59
  Local via em1.12
  13.1.1.0/24      * 07:22:59
  > via em1.13
  13.1.1.1/32      * 07:22:59
  Local via em1.13
  24.1.1.0/24      * 00:47:09, metric 2, tag 0
  > to 12.1.1.2 via em1.12
  34.1.1.0/24      * 00:28:07, metric 2, tag 0
  > to 13.1.1.3 via em1.13
  224.0.0.9/32       * 00:24:48, metric 1
  MultiRecv
  -----
  logical-router: R2
  inet.0: 7 destinations, 7 routes (7 active, 0 holddown, 0 hidden)
  + = Active Route, - = Last Active, * = Both
  12.1.1.0/24      * 07:22:59
  > via em2.12
  12.1.1.2/32      * 07:22:59
  Local via em2.12
  13.1.1.0/24      * 00:47:10, metric 2, tag 0
  > to 12.1.1.1 via em2.12
  24.1.1.0/24      * 07:22:59
  > via em2.24
  24.1.1.2/32      * 07:22:59
  Local via em2.24
  34.1.1.0/24      * 00:24:43, metric 2, tag 0
  > to 24.1.1.4 via em2.24
  224.0.0.9/32       * 00:24:48, metric 1
  MultiRecv
  -----
  logical-router: R3
  inet.0: 7 destinations, 7 routes (7 active, 0 holddown, 0 hidden)
  + = Active Route, - = Last Active, * = Both
  12.1.1.0/24      * 00:28:11, metric 2, tag 0
  > to 13.1.1.1 via em3.13
  13.1.1.0/24      * 07:20:09
  > via em3.13
  13.1.1.3/32      * 07:20:09
  Local via em3.13
  24.1.1.0/24      * 00:24:43, metric 2, tag 0
  > to 34.1.1.4 via em3.34
  34.1.1.0/24      * 07:20:09
  > via em3.34
  34.1.1.3/32      * 07:20:09
  Local via em3.34
  224.0.0.9/32       * 00:24:48, metric 1
  MultiRecv
  -----
  logical-router: R4
  inet.0: 7 destinations, 7 routes (7 active, 0 holddown, 0 hidden)
  + = Active Route, - = Last Active, * = Both
  12.1.1.0/24      * 00:24:46, metric 2, tag 0
  > to 24.1.1.2 via em4.24
  13.1.1.0/24      * 00:24:48, metric 2, tag 0
  > to 34.1.1.3 via em4.34
  24.1.1.0/24      * 07:20:09
  > via em4.24
  24.1.1.4/32      * 07:20:09
  Local via em4.24
  34.1.1.0/24      * 07:20:09
  > via em4.34
  34.1.1.4/32      * 07:20:09
  Local via em4.34
  224.0.0.9/32       * 00:24:48, metric 1
  MultiRecv
  -----
  logical-router: default
  inet.0: 2 destinations, 2 routes (2 active, 0 holddown, 0 hidden)
  + = Active Route, - = Last Active, * = Both
  192.168.1.0/24   * 08:16:17
  > via em0.0
  192.168.1.254/32   * 08:31:57
  Local via em0.0
  __juniper_private2__.inet.0: 1 destinations, 1 routes (0 active, 0 holddown, 1 hidden)
页: [1]
查看完整版本: Juniper Olive动态路由RIP配置案例