Juniper Firewall uses policy-options (policy) to re-distribute static to OSPF

Source: Internet
Author: User
Tags firewall

Juniper to implement the redistribution function like Cisco is to be implemented by policy, here is an example of me: its function is to distribute static routes to OSPF, the following is the topology map

Redistribution of R1 default routes into OSPF

The configuration is as follows:

# # # # Last changed:2012-07-18 06:03:09 CST version 12.1r1.9;   
                    Logical-systems {r1 {interfaces {em1 {unit 12 {   
                    Vlan-id 12;   
                    Family inet {address 10.0.4.5/30;   
                    } \ {Vlan-id 13;   
                    Family inet {address 10.0.4.14/30;            
                    } {Vlan-id 15;   
                    Family inet {address 172.30.25.1/30; }} lo0 {Unit 1 {family ine   
                    t {address 10.0.0.1/32;   
   }}} protocols {         Policies in OSPF {export default-static;//output policy-options   
                    Default-static area 0.0.0.0 {interface em1.12;   
                Interface em1.13; }} policy-options {policy-statement default-static//custom policy default-s tatic {term 1//custom term 1{from {route-filter 0.0.0.   
                0/0 exact;//0.0.0.0/0 is a static route entry to be filtered, exact represents an exact match} can also be used from {interface em1.15   
                Instead of term 1 from, this means that the direct network segment where the interface em1.15 is posted to the OSPF then accept;//action result is accepted }}} routing-options {static {route 0.0.0.0/   
            0 next-hop 172.30.25.2;                }}} r2 {interfaces {       
            EM2 {Vlan-id 12;   
                    Family inet {address 10.0.4.6/30;   
                    {Vlan-id 24;   
                    Family inet {address 10.0.4.10/30; }} lo0 {Unit 2 {family INE   
                    t {address 10.0.0.2/32; }}} protocols {OSPF {area   
                    0.0.0.0 {interface em2.21;   
                Interface em2.24; }}} r3 {interfaces {em3 {unit   
           to {Vlan-id 13;         Family inet {address 10.0.4.13/30;   
                    {Vlan-id 34;   
                    Family inet {address 10.0.2.5/30; }} lo0 {Unit 3 {family INE   
                    t {address 10.0.0.3/32; }}} protocols {OSPF {area   
                    0.0.0.0 {interface em3.31;   
                Interface em3.34; }}} r4 {interfaces {em4 {unit   
                    {Vlan-id 24;   
               Family inet {address 10.0.4.9/30;     {Vlan-id 34;   
                    Family inet {address 10.0.2.6/30;                   
                    }} lo0 {Unit 4 {   
                    Family inet {address 10.0.0.4/24; }}} protocols {OSPF {area   
                    0.0.0.0 {interface em4.42;   
                Interface em4.43; }}} R5 {interfaces {em5 {unit   
                    Wuyi {Vlan-id 15;   
                    Family inet {address 172.30.25.2/30; }}}}} interfaces{em0 {traceoptions {flag all;   
            Unit 0 {Family inet {address 192.168.1.254/24;   
    }}} em1 {vlan-tagging;   
    } em2 {vlan-tagging;   
    } em3 {vlan-tagging;   
    } em4 {vlan-tagging;   
    } EM5 {vlan-tagging; The routing table is as follows:olive> show Route Logical-system all LOGICAL-SYSTEM:R5 inet.0:2 destinations     , 3 routes (2 active, 0 holddown, 0 hidden) + = Active Route,-= last active, * = Both 172.30.25.0/30   
                    *[direct/0] 00:10:57 > via em5.51 [STATIC/5] 00:10:57   
> to 172.30.25.1 via em5.51 172.30.25.2/32 *[local/0] 00:10:57 Local via em5.51 -----LOGICAL-SYSTEM:R1 inet.0:11 Destinations, one routes (active, 0 holddown, 0 hidden) + = Active Route,-= last active, * = Both 0.0.0.0/0 *[STATIC/5] 00:10:57//Static routing default management distance is 5 > to 172.30.25.2 via em1.15 10.0.0.1/32 *[di   
                    Rect/0] 11:02:30 > via lo0.1 10.0.2.4/30 *[OSPF/10] 00:10:13, metric 2   
> to 10.0.4.13 via em1.13 10.0.4.4/30 *[direct/0] 00:10:57 > via em1.12 10.0.4.5/32 *[local/0] 00:10:57 Local via em1.12 10.0.4.8/30 *[OSPF/10] 00:10:07   
                    , metric 2 > to 10.0.4.6 via em1.12 10.0.4.12/30 *[direct/0] 00:10:57 > via em1.13 10.0.4.14/32 *[local/0] 00:10:57 local via em1.13 172.30.25.0/3   
                      0 *[direct/0] 00:10:57 > via em1.15 172.30.25.1/32 *[local/0] 00:10:57 Local via EM1224.0.0.5/32 *[OSPF/10] 11:02:43, metric 1 multirecv-----   
LOGICAL-SYSTEM:R3 inet.0:9 Destinations, 9 routes (9 active, 0 holddown, 0 hidden)   
                    + = Active Route,-= last active, * = Both 0.0.0.0/0 *[ospf/150] 00:10:13, metric 0, tag 0 > to 10.0.4.14 via EM3.31//OSPF external route default management distance is 150 10.0.   
                    0.3/32 *[direct/0] 11:02:25 > via lo0.3 10.0.2.4/30 *[direct/0] 00:10:57 > via em3.34 10.0.2.5/32 *[local/0] 00:10:57 Local via em3.34 10 .0.4.4/30 *[OSPF/10] 00:10:13, metric 2 > to 10.0.4.14 via em3.31 10.0.4.8/30 *    
                    [OSPF/10] 00:10:12, metric 2 > to 10.0.2.6 via em3.34 10.0.4.12/30 *[direct/0] 00:10:57> via em3.31 10.0.4.13/32 *[local/0] 00:10:57 local via em3.31 224.0.0.5/32 *[OSPF/10] 11:02:43, metric 1 multirecv-----logical-system:r2 inet. 0:9 Destinations, 9 routes (9 active, 0 holddown, 0 hidden) + = Active Route,-= last active, * = Both 0.        0.0.0/0 *[ospf/150] 00:10:07, metric 0, Tag 0 > to 10.0.4.5 via em2.21 10.0.0.2/32   
                    *[direct/0] 11:02:31 > via lo0.2 10.0.2.4/30 *[OSPF/10] 00:10:17, metric 2 > to 10.0.4.9 via em2.24 10.0.4.4/30 *[direct/0] 00:10:57 > via E m2.21 10.0.4.6/32 *[local/0] 00:10:57 Local via em2.21 10.0.4.8/30 *[direct /0] 00:10:57 > via em2.24 10.0.4.10/32 *[local/0] 00:10:57 Loc Al via em2.24 10.0.4.12/30 *[OSPF/10] 00:10:07, metric 2 > to 10.0.4.5 via em2.21 224.0.0.5/32 *[ospf/ 11:02:43, metric 1 multirecv-----LOGICAL-SYSTEM:R4 inet.0:10 D Estinations, routes (0 holddown, 0 hidden) + = Active Route,-= last active, * = Both 0.0.0.   
                    0/0 *[ospf/150] 00:10:07, metric 0, tag 0 to 10.0.4.10 via em4.42 > to 10.0.2.5 via em4.43 10.0.0.0/24 *[direct/0] 00:54:19 > via lo0.4 10.0.0.4/   
                    *[LOCAL/0] 00:54:19 Local via lo0.4 10.0.2.4/30 *[direct/0] 00:10:57 > via em4.43 10.0.2.6/32 *[local/0] 00:10:57 Local via em4.43 10.0 .4.4/30 *[OSPF/10] 00:10:17, metric 2 > to 10.0.4.10 via em4.42 10.0.4.8/30 *[d   
   IRECT/0] 00:10:57                 > via em4.42 10.0.4.9/32 *[local/0] 00:10:57 Local via em4.42 10 .0.4.12/30 *[OSPF/10] 00:10:12, metric 2 > to 10.0.2.5 via em4.43 224.0.0.5/32 *[ OSPF/10] 00:55:31, metric 1 MULTIRECV

This article is from the "Rista" blog, please be sure to keep this source http://rista.blog.51cto.com/2526140/934040

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.