728x90

- Topology

[R3]-ge-0/0/2--------------ge-0/0/2-[R1]

- OSFP 네이버가 맺어지지 않는 상태
root@R3# run show ospf neighbor
--- 네이버 없음 --

- 트러블슈팅을 위한 traceoption 설정 ( cisco debug command 와 동일하다고 보면됨)

root@R1# set protocols ospf traceoptions file ospf.log
root@R1# set protocols ospf traceoptions flag error detail
root@R1# commit

- OSFP 로그 확인

root@R1# run show log ospf.log
Nov 18 06:30:41 trace_on: Tracing to "/var/log/ospf.log" started
Nov 18 06:30:42 OSPF packet ignored: area mismatch (0.0.0.1) from 10.10.13.3 on intf ge-0/0/2.0 area 0.0.0.0
Nov 18 06:30:42 OSPF rcvd Hello 10.10.13.3 -> 224.0.0.5 (ge-0/0/2.0 IFL 335 area 0.0.0.0)
Nov 18 06:30:42 Version 2, length 44, ID 3.3.3.3, area 0.0.0.1
Nov 18 06:30:42 checksum 0xe618, authtype 0
Nov 18 06:30:42 mask 255.255.255.0, hello_ivl 10, opts 0x12, prio 128
Nov 18 06:30:42 dead_ivl 40, DR 0.0.0.0, BDR 0.0.0.0
-> area mismatch 확인

-라우터 설정 확인

root@R3# show protocols ospf | display set
set protocols ospf area 0.0.0.1 interface lo0.0 passive
set protocols ospf area 0.0.0.1 interface ge-0/0/1.0 interface-type p2p
set protocols ospf area 0.0.0.1 interface ge-0/0/6.0 interface-type p2p
set protocols ospf area 0.0.0.1 interface ge-0/0/2.0 interface-type p2p

root@R1# show protocols ospf | display set
set protocols ospf area 0.0.0.0 interface lo0.0 passive
set protocols ospf area 0.0.0.0 interface ge-0/0/0.0 interface-type p2p
set protocols ospf area 0.0.0.0 interface ge-0/0/2.0 interface-type p2p
set protocols ospf traceoptions file ospf.log
set protocols ospf traceoptions flag error detail

R1 OSPF area : 0.0.0.0 = 0
R3 OSPF area : 0.0.0.1 = 1

- R3 OSPF area 수정 (0.0.0.1 -> 0.0.0.0 )

root@R3# rename protocols ospf area 1 to area 0

- 수정 후 OSPF neighbor 확인

root@R3# run show ospf neighbor
Address      Interface      State    ID        Pri    Dead
10.10.13.1    ge-0/0/2.0   Full      1.1.1.1   128   39

 

 

 

 

728x90


1. OSPF external type 1 이 type 2 보다 우선함.



[R2]--------[R4]

  |           /  |     

  |        /     |    

  |     /        |  

  |  /           | 

[R1]--------[R3]   




R1 설정

 - static 10.10.10.0/24 를 ospf로 재분배 및 ospf type 1 설정


chano@vMX_01# show policy-options | display set 

set policy-options policy-statement static_to_ospf term 10 from protocol static

set policy-options policy-statement static_to_ospf term 10 then external type 1

set policy-options policy-statement static_to_ospf term 10 then accept

set policy-options policy-statement static_to_ospf term 20 then reject


chano@vMX_01# show routing-options | display set   

set routing-options static route 10.10.10.0/24 discard

set routing-options router-id 172.27.255.1


chano@vMX_01# show protocols ospf| display set 
set protocols ospf export static_to_ospf
set protocols ospf area 0.0.0.0 interface ae1.0 interface-type p2p
set protocols ospf area 0.0.0.0 interface ge-0/0/6.0 interface-type p2p
set protocols ospf area 0.0.0.0 interface lo0.0 passive
set protocols ospf area 0.0.0.1 interface ge-0/0/3.0 interface-type p2p

R3 설정
  - static 10.10.10.0/24 를 ospf로 재분배 및 ospf type 2 설정

chano@vMX_03# show policy-options | display set 
set policy-options policy-statement static_to_ospf term 10 from protocol static
set policy-options policy-statement static_to_ospf term 10 then external type 2
set policy-options policy-statement static_to_ospf term 10 then accept
set policy-options policy-statement static_to_ospf term 20 then reject

chano@vMX_03# show routing-options | display set 
set routing-options static route 10.10.10.0/24 discard
set routing-options router-id 172.27.255.3

chano@vMX_03# show protocols ospf| display set 
set protocols ospf export static_to_ospf
set protocols ospf area 0.0.0.0 interface ge-0/0/1.0 interface-type p2p
set protocols ospf area 0.0.0.0 interface lo0.0 passive
set protocols ospf area 0.0.0.0 interface ge-0/0/2.0 interface-type p2p
set protocols ospf area 0.0.0.2 interface ge-0/0/3.0 interface-type p2p

R4에서 10.10.10.0/24 대역 확인
 -  external type 1을 우선함을 확인.

chano@vMX_04> show route 10.10.10.0/24 

inet.0: 25 destinations, 25 routes (25 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

10.10.10.0/24      *[OSPF/150] 00:25:01, metric 1, tag 0
                    > to 172.27.0.10 via ae1.0  [R1향 인터페이스 ae1]

chano@vMX_04> show ospf database extensive external 
    OSPF AS SCOPE link state database
 Type       ID               Adv Rtr           Seq      Age  Opt  Cksum  Len 
Extern   10.10.10.0       172.27.255.1     0x80000021   136  0x22 0xe249  36
  mask 255.255.255.0
  Topology default (ID 0)
    Type: 1, Metric: 0, Fwd addr: 0.0.0.0, Tag: 0.0.0.0
  Aging timer 00:57:43
  Installed 00:02:15 ago, expires in 00:57:44, sent 00:02:15 ago
  Last changed 00:02:15 ago, Change count: 7
Extern   10.10.10.0       172.27.255.3     0x80000001    80  0x22 0x9a2f  36
  mask 255.255.255.0
  Topology default (ID 0)
    Type: 2, Metric: 0, Fwd addr: 0.0.0.0, Tag: 0.0.0.0
  Aging timer 00:58:40
  Installed 00:01:19 ago, expires in 00:58:40, sent 00:01:19 ago
  Last changed 00:01:19 ago, Change count: 1






2. external type 1  경로에 있는 모든 링크 cost 값을 더함.


   external type 2 는 경로에 있는 모든 링크 cost 값을 무시함.

    


[R2]--------[R4]---------[R5]

  |      

  |   

  |     

  | 

[R1]                       


  - 모든 링크 cost는 1로 설정함.


R1 설정

  - R1 에서 10.10.10.0/24 대역을 ospf type 1 으로 광고


chano@vMX_01# show policy-options | display set 

set policy-options policy-statement static_to_ospf term 10 from protocol static

set policy-options policy-statement static_to_ospf term 10 then external type 1

set policy-options policy-statement static_to_ospf term 10 then accept

set policy-options policy-statement static_to_ospf term 20 then reject


chano@vMX_01# show protocols ospf | display set 

set protocols ospf export static_to_ospf

set protocols ospf area 0.0.0.0 interface ae1.0 interface-type p2p

set protocols ospf area 0.0.0.0 interface ge-0/0/6.0 interface-type p2p

set protocols ospf area 0.0.0.0 interface lo0.0 passive

set protocols ospf area 0.0.0.1 interface ge-0/0/3.0 interface-type p2p


chano@vMX_01# show routing-options | display set 
set routing-options static route 10.10.10.0/24 discard
set routing-options router-id 172.27.255.1


R5 에서 확인


chano@vMX_05> show route 10.10.10.0/24 extensive    


inet.0: 21 destinations, 21 routes (21 active, 0 holddown, 0 hidden)

10.10.10.0/24 (1 entry, 1 announced)

TSI:

KRT in-kernel 10.10.10.0/24 ->

        *OSPF   Preference: 150

                Next hop type: Router, Next hop index: 561

                Address: 0x9700438

                Next-hop reference count: 13

                Next hop: 172.27.0.21 via ae2.0, selected

                Session Id: 0x142

                State: <Active Int Ext>

                Age: 2:21       Metric: 3   ( R1<---> R5경로의 cost를 더한 값(1+1+1)이 출력. )

                Validation State: unverified 

                        Tag: 0 

                Task: OSPF

                Announcement bits (1): 0-KRT 

                AS path: I




R1 설정

 - R1 에서 10.10.10.0/24 대역을 ospf type 2 으로 광고


chano@vMX_01# show policy-options | display set 

set policy-options policy-statement static_to_ospf term 10 from protocol static

set policy-options policy-statement static_to_ospf term 10 then external type 2

set policy-options policy-statement static_to_ospf term 10 then accept

set policy-options policy-statement static_to_ospf term 20 then reject


R5 에서 확인

chano@vMX_05> show route 10.10.10.0/24 extensive    

inet.0: 21 destinations, 21 routes (21 active, 0 holddown, 0 hidden)
10.10.10.0/24 (1 entry, 1 announced)
TSI:
KRT in-kernel 10.10.10.0/24 ->
        *OSPF   Preference: 150
                Next hop type: Router, Next hop index: 561
                Address: 0x9700438
                Next-hop reference count: 13
                Next hop: 172.27.0.21 via ae2.0, selected
                Session Id: 0x142
                State: <Active Int Ext>
                Age: 30         Metric: 0  ( R1 <--> R5 경로상의 cost 값 무시, metric 미설정으로 0이 출력됨.)
                Validation State: unverified 
                        Tag: 0 
                Task: OSPF
                Announcement bits (1): 0-KRT 
                AS path: I



R1 설정 

 - R1 에서 10.10.10.0/24 대역을 ospf type 2 으로 광고 (metric 100 설정)


chano@vMX_01# show policy-options | display set 

set policy-options policy-statement static_to_ospf term 10 from protocol static

set policy-options policy-statement static_to_ospf term 10 then metric 100

set policy-options policy-statement static_to_ospf term 10 then external type 2

set policy-options policy-statement static_to_ospf term 10 then accept

set policy-options policy-statement static_to_ospf term 20 then reject



R5 에서 확인


chano@vMX_05> show route 10.10.10.0/24 extensive    


inet.0: 21 destinations, 21 routes (21 active, 0 holddown, 0 hidden)

10.10.10.0/24 (1 entry, 1 announced)

TSI:

KRT in-kernel 10.10.10.0/24 ->

        *OSPF   Preference: 150

                Next hop type: Router, Next hop index: 561

                Address: 0x9700438

                Next-hop reference count: 13

                Next hop: 172.27.0.21 via ae2.0, selected

                Session Id: 0x142

                State: <Active Int Ext>

                Age: 3  Metric: 100   ( R1 <--> R5 경로상의 cost 값 무시하고 설정한 cost 값 100 출력됨.)

                Validation State: unverified 

                        Tag: 0 

                Task: OSPF

                Announcement bits (1): 0-KRT 

                AS path: I










728x90

 


Area 0 : R3, R4
Area 1 : R1, R3
Area 2 : R2, R4
Area 3 : R3, R4, R5, R6
 

root@R1# run show configuration
## Last commit: 2011-05-30 10:27:15 UTC by root
version 10.0R3.10;
system {
    host-name R1;
    root-authentication {
        encrypted-password "$1$Le7q3/yU$l2sBlzemteXJhXQBnqnFX."; ## SECRET-DATA
    }
    services {
        ssh {
            root-login allow;
        }
    }
    syslog {
        user * {
            any emergency;
        }
        file messages {
            any notice;
            authorization info;
        }
        file interactive-commands {
            interactive-commands any;
        }
    }              
}
interfaces {
    em1 {
        unit 0 {
            family inet {
                address 192.168.10.1/24;
            }
        }
    }
    em2 {
        unit 0 {
            family inet {
                address 192.168.1.1/24;
            }
        }
    }
    em3 {
        unit 0 {
            family inet {
                address 192.168.3.1/24;
            }
        }
    }              
    lo0 {
        unit 0 {
            family inet {
                address 1.1.1.1/32;
            }
        }
    }
}
protocols {
    ospf {
        area 0.0.0.1 {
            stub default-metric 20; // default metric 값 20 으로 변경 0.0.0.0
            interface em2.0;
        }
    }
}

root@R2# run show configuration
## Last commit: 2011-05-27 11:41:31 UTC by root
version 10.0R3.10;
system {
    host-name R2;
    root-authentication {
        encrypted-password "$1$Le7q3/yU$l2sBlzemteXJhXQBnqnFX."; ## SECRET-DATA
    }
    services {
        ssh {
            root-login allow;
        }
    }
    syslog {
        user * {
            any emergency;
        }
        file messages {
            any notice;
            authorization info;
        }
        file interactive-commands {
            interactive-commands any;
        }
    }              
}
interfaces {
    em1 {
        unit 0 {
            family inet {
                address 192.168.20.4/32;
            }
        }
    }
    em2 {
        unit 0 {
            family inet {
                address 192.168.8.2/24;
            }
        }
    }
    em3 {
        unit 0 {
            family inet {
                address 192.168.3.2/24;
            }
        }
    }              
    lo0 {
        unit 0 {
            family inet {
                address 1.1.1.2/32;
            }
        }
    }
}
protocols {
    ospf {
        area 0.0.0.2 {
            stub default-metric 10 no-summaries;
            interface em2.0;
        }
    }
}

root@R3# run show configuration
## Last commit: 2011-05-30 10:28:45 UTC by root
version 10.0R3.10;
system {
    host-name R3;
    root-authentication {
        encrypted-password "$1$Le7q3/yU$l2sBlzemteXJhXQBnqnFX."; ## SECRET-DATA
    }
    services {
        ssh {
            root-login allow;
        }
    }
    syslog {
        user * {
            any emergency;
        }
        file messages {
            any notice;
            authorization info;
        }
        file interactive-commands {
            interactive-commands any;
        }
    }              
}
interfaces {
    em0 {
        unit 0 {
            family inet {
                address 192.168.5.3/24;
            }
        }
    }
    em1 {
        unit 0 {
            family inet {
                address 192.168.2.3/24;
            }
        }
    }
    em2 {
        unit 0 {
            family inet {
                address 192.168.1.3/24;
            }
        }
    }              
    em3 {
        unit 0 {
            family inet {
                address 192.168.4.3/24;
            }
        }
    }
    lo0 {
        unit 0 {
            family inet {
                address 1.1.1.3/32;
            }
        }
    }
}
protocols {
    ospf {
        area 0.0.0.1 {
            stub default-metric 20;
            interface em2.0;
        }
        area 0.0.0.0 {
            interface em3.0;
            interface lo0.0;
        }
        area 0.0.0.3 {
            interface em1.0;
            interface em0.0;
        }
    }
}

root@R4# run show configuration
## Last commit: 2011-05-27 14:00:08 UTC by root
version 10.0R3.10;
system {
    host-name R4;
    root-authentication {
        encrypted-password "$1$Le7q3/yU$l2sBlzemteXJhXQBnqnFX."; ## SECRET-DATA
    }
    services {
        ssh {
            root-login allow;
        }
    }
    syslog {
        user * {
            any emergency;
        }
        file messages {
            any notice;
            authorization info;
        }
        file interactive-commands {
            interactive-commands any;
        }
    }              
}
interfaces {
    em0 {
        unit 0 {
            family inet {
                address 192.168.6.4/24;
            }
        }
    }
    em1 {
        unit 0 {
            family inet {
                address 192.168.9.4/24;
            }
        }
    }
    em2 {
        unit 0 {
            family inet {
                address 192.168.8.4/24;
            }
        }
    }              
    em3 {
        unit 0 {
            family inet {
                address 192.168.4.4/24;
            }
        }
    }
    lo0 {
        unit 0 {
            family inet {
                address 1.1.1.4/32;
            }
        }
    }
}
protocols {
    ospf {
        area 0.0.0.0 {
            interface em3.0;
            interface lo0.0;
        }
        area 0.0.0.2 {
            stub default-metric 10 no-summaries;
            interface em2.0;
        }
        area 0.0.0.3 {
            interface em0.0;
            interface em1.0;
        }
    }
}

root@R5# run show configuration
## Last commit: 2011-05-27 13:56:54 UTC by root
version 10.0R3.10;
system {
    host-name R5;
    root-authentication {
        encrypted-password "$1$Le7q3/yU$l2sBlzemteXJhXQBnqnFX."; ## SECRET-DATA
    }
    services {
        ssh {
            root-login allow;
        }
    }
    syslog {
        user * {
            any emergency;
        }
        file messages {
            any notice;
            authorization info;
        }
        file interactive-commands {
            interactive-commands any;
        }
    }              
}
interfaces {
    em0 {
        unit 0 {
            family inet {
                address 192.168.6.5/24;
            }
        }
    }
    em1 {
        unit 0 {
            family inet {
                address 192.168.2.5/24;
            }
        }
    }
    em2 {
        unit 0 {
            family inet {
                address 192.168.7.5/24;
            }
        }
    }              
    lo0 {
        unit 0 {
            family inet {
                address 1.1.1.5/32;
            }
        }
    }
}
routing-options {
    static {
        route 100.100.100.0/24 next-hop 192.168.7.6; // static 경로를 테이블에 올리기 위해 임으로 설정함.
    }
}
protocols {
    ospf {
        export redis_static;
        area 0.0.0.3 {
            interface em0.0;
            interface em1.0;
            interface em2.0;
            interface lo0.0;
        }
    }              
}
policy-options {
    policy-statement redis_static {    //static경로를 ospf로 재분배 하는 정책
        from protocol static;
        then accept;
    }
}

root@R6# run show configuration
## Last commit: 2011-05-27 13:59:36 UTC by root
version 10.0R3.10;
system {
    host-name R6;
    root-authentication {
        encrypted-password "$1$Le7q3/yU$l2sBlzemteXJhXQBnqnFX."; ## SECRET-DATA
    }
    services {
        ssh {
            root-login allow;
        }
    }
    syslog {
        user * {
            any emergency;
        }
        file messages {
            any notice;
            authorization info;
        }
        file interactive-commands {
            interactive-commands any;
        }
    }              
}
interfaces {
    em0 {
        unit 0 {
            family inet {
                address 192.168.5.6/24;
            }
        }
    }
    em1 {
        unit 0 {
            family inet {
                address 192.168.9.6/24;
            }
        }
    }
    em2 {
        unit 0 {
            family inet {
                address 192.168.7.6/24;
            }
        }
    }              
    lo0 {
        unit 0 {
            family inet {
                address 1.1.1.6/32;
            }
        }
    }
}
routing-options {
    static {
        route 200.200.200.0/24 next-hop 192.168.7.5;
    }
}
protocols {
    ospf {
        export redis_static;
        area 0.0.0.3 {
            interface em0.0;
            interface em1.0;
            interface em2.0;
            interface lo0.0;
        }
    }              
}
policy-options {
    policy-statement redis_static {
        from protocol static;
        then accept;
    }
}

+ Recent posts