Juniper-OSPF學習指南-熱身配置

今天閒來無事,敲了學習指南上面OSPF配置CASE,分享給大家。

r1 {
    interfaces {
        fe-0/3/3 {
            unit 12 {
                vlan-id 12;
                family inet {
                    address 10.0.4.6/30;
                }
            }
            unit 13 {
                vlan-id 13;
                family inet {
                    address 10.0.4.14/30;
                }
            }
            unit 55 {
                vlan-id 55;
                family inet {
                    address 10.0.5.1/24;
                }
            }
        }
        lo0 {
            unit 1 {
                family inet {
                    address 10.0.6.1/32;
                }
            }
        }
    }
    protocols {
        ospf {
            export adv-ex;
            reference-bandwidth 1g;
            area 0.0.0.1 {
                nssa;
                interface fe-0/3/3.13 {
                    priority 0;
                }
                interface fe-0/3/3.12 {
                    priority 0;
                }
            }
        }
    }
    policy-options {
        policy-statement adv-ex {
            term 1 {
                from {
                    protocol direct;
                    route-filter 10.0.5.0/24 exact;
                }
                then {
                    metric 10;
                    tag 420;
                    external {
                        type 1;
                    }
                    accept;
                }
            }
        }
    }
}
r2 {
    interfaces {
        fe-0/3/2 {
            unit 12 {
                vlan-id 12;
                family inet {
                    address 10.0.4.5/30;
                }
            }
            unit 23 {
                vlan-id 23;
                family inet {
                    address 10.0.4.2/30;
                }
            }
            unit 24 {
                vlan-id 24;
                family inet {
                    address 10.0.4.10/30;
                }
            }
            unit 55 {
                vlan-id 55;
                family inet {
                    address 10.0.5.2/24;
                }
            }
        }
        lo0 {
            unit 2 {
                family inet {
                    address 10.0.6.2/32;
                }
            }
        }
    }
    protocols {
        ospf {
            export adv-ex;
            reference-bandwidth 1g;
            area 0.0.0.1 {
                nssa;
                interface fe-0/3/2.12;
                interface fe-0/3/2.23;
                interface fe-0/3/2.24;
            }
        }
    }
    policy-options {
        policy-statement adv-ex {
            term 1 {
                from {
                    protocol direct;
                    route-filter 10.0.5.0/24 exact;
                }
                then {
                    metric 10;
                    tag 420;
                    external {
                        type 1;
                    }
                    accept;
                }
            }
        }
    }
}
r3 {
    interfaces {
        fe-0/3/2 {
            unit 13 {
                vlan-id 13;
                family inet {
                    address 10.0.4.13/30;
                }
            }
        }
        fe-0/3/3 {
            unit 23 {
                vlan-id 23;
                family inet {
                    address 10.0.4.1/30;
                }
            }
            unit 30 {
                vlan-id 30;
                family inet {
                    address 172.16.0.13/30;
                }
            }
            unit 34 {
                vlan-id 34;
                family inet {
                    address 10.0.2.5/30;
                }
            }
            unit 35 {
                vlan-id 35;
                family inet {
                    address 10.0.2.2/30;
                }
            }
        }
        lo0 {
            unit 3 {
                family inet {
                    address 10.0.3.3/32;
                }
            }
        }
    }
    protocols {
        ospf {
            reference-bandwidth 1g;
            area 0.0.0.0 {
                interface fe-0/3/3.35 {
                    authentication {
                        md5 10 key "$9$SdelvLoaUDkP"; ## SECRET-DATA
                    }
                }
                interface fe-0/3/3.34 {
                    authentication {
                        md5 10 key "$9$8sEx-wHkPfz6"; ## SECRET-DATA
                    }
                }
            }
            area 0.0.0.1 {
                nssa {
                    default-lsa {
                        default-metric 10;
                        type-7;
                    }
                    no-summaries;
                }
                area-range 10.0.4.0/22;
                interface fe-0/3/2.13;
                interface fe-0/3/3.23 {
                    metric 100;
                }
            }
        }
    }
}
r4 {
    interfaces {
        fe-0/3/2 {
            unit 34 {
                vlan-id 34;
                family inet {
                    address 10.0.2.6/30;
                }
            }
        }
        fe-0/3/3 {
            unit 24 {
                vlan-id 24;
                family inet {
                    address 10.0.4.9/30;
                }
            }
            unit 45 {
                vlan-id 45;
                family inet {
                    address 10.0.2.10/30;
                }
            }
        }
        lo0 {
            unit 4 {
                family inet {
                    address 10.0.3.4/32;
                }
            }
        }
    }
    protocols {
        ospf {
            reference-bandwidth 1g;
            area 0.0.0.0 {
                interface fe-0/3/3.45 {
                    authentication {
                        md5 10 key "$9$sEgaUF39Cu1"; ## SECRET-DATA
                    }
                }
                interface fe-0/3/2.34 {
                    authentication {
                        md5 10 key "$9$QdL53/tleW87V"; ## SECRET-DATA
                    }
                }
            }
            area 0.0.0.1 {
                nssa {
                    default-lsa {
                        default-metric 10;
                        type-7;
                    }
                    no-summaries;
                }
                area-range 10.0.4.0/22;
                interface fe-0/3/3.24;
            }
        }
    }
}
r5 {
    interfaces {
        fe-0/3/2 {
            unit 35 {
                vlan-id 35;
                family inet {
                    address 10.0.2.1/30;
                }
            }
            unit 45 {
                vlan-id 45;
                family inet {
                    address 10.0.2.9/30;
                }
            }
        }
        fe-0/3/3 {
            unit 56 {
                vlan-id 56;
                family inet {
                    address 10.0.8.6/30;
                }
            }
            unit 57 {
                vlan-id 57;
                family inet {
                    address 10.0.8.9/30;
                }
            }
        }
        lo0 {
            unit 5 {
                family inet {
                    address 10.0.3.5/32;
                }
            }
        }
    }
    protocols {
        ospf {
            reference-bandwidth 1g;
            area 0.0.0.0 {
                interface fe-0/3/2.35 {
                    authentication {
                        md5 10 key "$9$sEgaUF39Cu1"; ## SECRET-DATA
                    }
                }
                interface fe-0/3/2.45 {
                    authentication {
                        md5 10 key "$9$.fQnEhrlMX"; ## SECRET-DATA
                    }
                }
                interface lo0.5 {
                    passive;
                }
            }
            area 0.0.0.20 {
                area-range 10.0.8.0/21;
                area-range 172.16.40.0/28;
                interface fe-0/3/3.56;
                interface fe-0/3/3.57;
            }
        }
    }
}
r6 {
    interfaces {
        fe-0/3/2 {
            unit 56 {
                vlan-id 56;
                family inet {
                    address 10.0.8.5/30;
                }
            }
            unit 67 {
                vlan-id 67;
                family inet {
                    address 10.0.8.1/30;
                }
            }
            unit 70 {
                vlan-id 70;
                family inet {
                    address 172.16.40.2/30;
                }
            }
        }
        lo0 {
            unit 6 {
                family inet {
                    address 10.0.9.6/32;
                }
            }
        }
    }
    protocols {
        ospf {
            export adv-rip;
            reference-bandwidth 1g;
            area 0.0.0.20 {
                interface fe-0/3/2.56;
                interface fe-0/3/2.67;
                interface fe-0/3/2.70 {
                    passive;
                }
            }
        }
        rip {
            group rip {
                metric-out 1;
                export adv-ospf;
                import rip-in;
                neighbor fe-0/3/2.70;
            }
        }
    }
    policy-options {
        policy-statement adv-rip {
            term 1 {
                from {
                    protocol aggregate;
                    route-filter 192.168.0.0/22 exact;
                }
                then accept;
            }
        }
        policy-statement adv-ospf {
            term 1 {
                from {
                    protocol ospf;
                    route-filter 10.0.5.0/24 exact;
                }
                then accept;
            }
        }
        policy-statement rip-in {
            term 1 {
                from {
                    protocol rip;
                    route-filter 192.168.0.0/24 orlonger;
                }
                then accept;
            }
            term 2 {
                then reject;
            }
        }
    }
    routing-options {
        aggregate {
            route 192.168.0.0/22;
        }
    }
}
r7 {
    interfaces {
        fe-0/3/2 {
            unit 57 {
                vlan-id 57;
                family inet {
                    address 10.0.8.10/30;
                }
            }
        }
        fe-0/3/3 {
            unit 60 {
                vlan-id 60;
                family inet {
                    address 172.16.40.6/30;
                }
            }
            unit 67 {
                vlan-id 67;
                family inet {
                    address 10.0.8.2/30;
                }
            }
        }
        lo0 {
            unit 7 {
                family inet {
                    address 10.0.9.7/32;
                }
            }
        }
    }
    protocols {
        ospf {
            export adv-rip;
            reference-bandwidth 1g;
            area 0.0.0.20 {
                interface fe-0/3/2.57;
                interface fe-0/3/3.67;
                interface fe-0/3/3.60 {
                    passive;
                }
            }
        }
        rip {
            group rip {
                metric-out 2;
                export adv-ospf;
                import rip-in;
                neighbor fe-0/3/3.60;
            }
        }
    }
    policy-options {
        policy-statement adv-rip {
            term 1 {
                from {
                    protocol aggregate;
                    route-filter 192.168.0.0/22 exact;
                }
                then accept;
            }
        }
        policy-statement adv-ospf {
            term 1 {
                from {
                    protocol ospf;
                    route-filter 10.0.5.0/24 exact;
                }
                then accept;
            }
        }
        policy-statement rip-in {
            term 1 {
                from {
                    protocol rip;
                    route-filter 192.168.0.0/24 orlonger;
                }
                then accept;
            }
            term 2 {
                then reject;
            }
        }
    }
    routing-options {
        aggregate {
            route 192.168.0.0/22;
        }
    }
}
rip {
    interfaces {
        fe-0/3/2 {
            unit 60 {
                vlan-id 60;
                family inet {
                    address 172.16.40.5/30;
                }
            }
        }
        fe-0/3/3 {
            unit 70 {
                vlan-id 70;
                family inet {
                    address 172.16.40.1/30;
                }
            }
        }
        lo0 {
            unit 8 {
                family inet {
                    address 192.168.1.1/32;
                }
            }
        }
    }
    protocols {
        rip {
            group rip {
                export rip;
                neighbor fe-0/3/3.70;
                neighbor fe-0/3/2.60;
            }
        }
    }
    policy-options {
        policy-statement rip {
            term 1 {
                from protocol [ static rip ];
                then accept;
            }
        }
    }
    routing-options {
        static {
            route 192.168.0.0/24 discard;
            route 192.168.1.0/24 discard;
            route 192.168.2.0/24 discard;
            route 192.168.3.0/24 discard;
        }
    }
}

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章