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



metric2 value can be assigned to any route in the routing table. The metric2defaults to zero for all protocols except for BGP and MPLS/RSVP. 

The metric2 for a BGP route defaults to the value of the IGP's metric to the BGP nexthop for that route. 

Metric2 also applies to MPLS LSPs listed in inet.3. When you configure a standby LSP or fast reroute, the standby and/or fast reroute LSPs will appear in the inet.3 routing table along with the primary LSP. All paths for the LSP will have equal values for metric, but differing metric2 values. The active path LSP will have a metric2 of 0, while an inactive primary path will have a value of 1 and an inactive secondary standby path will have a value of 2. Fast reroute LSPs generally will be assigned metric2 values starting at 1,000,000. 



chano@PE_1# run show route 130.130.130.0/24 extensive 


Static_vpn_Customer.inet.0: 5 destinations, 7 routes (5 active, 0 holddown, 0 hidden)

130.130.130.0/24 (2 entries, 1 announced)

TSI:

KRT in-kernel 130.130.130.0/24 -> {indirect(1048578)}

        *BGP    Preference: 200/-151

                Route Distinguisher: 6619:400

                Next hop type: Indirect

                Address: 0x9685fd4

                Next-hop reference count: 5

                Source: 1.1.1.11

                Next hop type: Router, Next hop index: 1048577

                Next hop: 10.10.9.1 via ge-0/0/3.0, selected

                Label operation: Push 299984, Push 299840(top)

                Label TTL action: prop-ttl, prop-ttl(top)

                Load balance label: Label 299984: None; Label 299840: None; 

                Session Id: 0x142

                Next hop: 10.10.3.1 via ge-0/0/4.0

                Label operation: Push 299984, Push 300144(top)

                Label TTL action: prop-ttl, prop-ttl(top)

                Load balance label: Label 299984: None; Label 300144: None; 

                Session Id: 0x141

                Protocol next hop: 1.1.1.7

                Label operation: Push 299984

                Label TTL action: prop-ttl

                Load balance label: Label 299984: None; 

                Indirect next hop: 0x96dc110 1048578 INH Session ID: 0x151

                State: <Secondary Active Int Ext ProtectionCand>

                Local AS:  6619 Peer AS:  6619

                Age: 1:28       Metric2: 30 

                Validation State: unverified 

                Task: BGP_6619.1.1.1.11+179

                Announcement bits (1): 1-KRT 

                AS path: I (Originator)

                Cluster list:  1.1.1.11

                Originator ID: 1.1.1.7

                Communities: target:6619:400

                Import Accepted

                VPN Label: 299984

                Localpref: 150

                Router ID: 1.1.1.11

                Primary Routing Table bgp.l3vpn.0

                Indirect next hops: 1

                        Protocol next hop: 1.1.1.7 Metric: 30

                        Label operation: Push 299984

                        Label TTL action: prop-ttl

                        Load balance label: Label 299984: None; 

                        Indirect next hop: 0x96dc110 1048578 INH Session ID: 0x151

                        Indirect path forwarding next hops: 2

                                Next hop type: Router

                                Next hop: 10.10.9.1 via ge-0/0/3.0

                                Session Id: 0x142

                                Next hop: 10.10.3.1 via ge-0/0/4.0

                                Session Id: 0x141

                        1.1.1.7/32 Originating RIB: inet.3

                          Metric: 30                      Node path count: 1

                          Forwarding nexthops: 2

                                Nexthop: 10.10.9.1 via ge-0/0/3.0

                                        

[edit]

chano@PE_1# run show route 1.1.1.7 


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

+ = Active Route, - = Last Active, * = Both


1.1.1.7/32         *[OSPF/110] 00:01:41, metric 30

                      to 10.10.9.1 via ge-0/0/3.0

                    > to 10.10.3.1 via ge-0/0/4.0


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

+ = Active Route, - = Last Active, * = Both


1.1.1.7/32         *[LDP/9] 1w0d 23:54:04, metric 30, tag 0

                    > to 10.10.9.1 via ge-0/0/3.0, Push 299840

                      to 10.10.3.1 via ge-0/0/4.0, Push 300144






728x90

 

 

 

 

 

PE1

set interfaces ge-0/0/1 mac 00:0c:29:c7:28:8b

set interfaces ge-0/0/1 unit 0 family inet address 10.10.8.6/24

set interfaces ge-0/0/1 unit 0 family mpls

 

set interfaces ge-0/0/4 vlan-tagging

set interfaces ge-0/0/4 encapsulation vlan-ccc

set interfaces ge-0/0/4 mac 00:0c:29:c7:28:a9

set interfaces ge-0/0/4 unit 0 encapsulation vlan-ccc

set interfaces ge-0/0/4 unit 0 vlan-id 1000

set interfaces ge-0/0/4 unit 0 family ccc

 

set interfaces lo0 unit 0 family inet address 6.6.6.6/24

set routing-options router-id 6.6.6.6

set routing-options forwarding-table export ECMP

set protocols mpls interface ge-0/0/1.0

set protocols ospf area 0.0.0.0 interface ge-0/0/1.0

set protocols ospf area 0.0.0.0 interface lo0.0 passive

set protocols ldp interface ge-0/0/1.0

set protocols ldp interface lo0.0

set protocols l2circuit neighbor 2.2.2.2 interface ge-0/0/4.0 virtual-circuit-id 1

 

 

PE2

 

set interfaces ge-0/0/1 vlan-tagging

set interfaces ge-0/0/1 encapsulation vlan-ccc

set interfaces ge-0/0/1 mac 00:0c:29:4a:be:1d

set interfaces ge-0/0/1 unit 0 encapsulation vlan-ccc

set interfaces ge-0/0/1 unit 0 vlan-id 1000

set interfaces ge-0/0/1 unit 0 family ccc

 

set interfaces ge-0/0/4 mac 00:0c:29:4a:be:3b

set interfaces ge-0/0/4 unit 0 family inet address 10.10.8.2/24

set interfaces ge-0/0/4 unit 0 family mpls

set interfaces lo0 unit 0 family inet address 2.2.2.2/32

set routing-options router-id 2.2.2.2

set routing-options forwarding-table export ECMP

set protocols mpls interface ge-0/0/4.0

set protocols ospf area 0.0.0.0 interface lo0.0 passive

set protocols ospf area 0.0.0.0 interface ge-0/0/4.0

set protocols ldp interface ge-0/0/4.0

set protocols ldp interface lo0.0

set protocols l2circuit neighbor 6.6.6.6 interface ge-0/0/1.0 virtual-circuit-id 1

 

 

chano@PE2# run show l2circuit connections 

Layer-2 Circuit Connections:

 

Legend for interface status  

Up -- operational            

Dn -- down                   

Neighbor: 6.6.6.6 

    Interface                 Type  St     Time last up          # Up trans

    ge-0/0/1.0(vc 1)          rmt   Up     May 18 11:23:56 2015           1

      Remote PE: 6.6.6.6, Negotiated control-word: Yes (Null)

      Incoming label: 299888, Outgoing label: 300128

      Negotiated PW status TLV: No

      Local interface: ge-0/0/1.0, Status: Up, Encapsulation: VLAN

      Flow Label Transmit: No, Flow Label Receive: No

 

 

chano@PE1> ping mpls l2circuit virtual-circuit 1 neighbor 2.2.2.2      

!!!!!

--- lsping statistics ---

5 packets transmitted, 5 packets received, 0% packet loss

 

 

728x90

 

 

 

 

 

PE1

set interfaces ge-0/0/1 mac 00:0c:29:c7:28:8b

set interfaces ge-0/0/1 unit 0 family inet address 10.10.8.6/24

set interfaces ge-0/0/1 unit 0 family mpls

set interfaces ge-0/0/4 encapsulation ethernet-ccc

set interfaces ge-0/0/4 mac 00:0c:29:c7:28:a9

set interfaces ge-0/0/4 unit 0

set interfaces lo0 unit 0 family inet address 6.6.6.6/24

set routing-options router-id 6.6.6.6

set routing-options forwarding-table export ECMP

set protocols mpls interface ge-0/0/1.0

set protocols ospf area 0.0.0.0 interface ge-0/0/1.0

set protocols ospf area 0.0.0.0 interface lo0.0 passive

set protocols ldp interface ge-0/0/1.0

set protocols ldp interface lo0.0

set protocols l2circuit neighbor 2.2.2.2 interface ge-0/0/4.0 virtual-circuit-id 1

 

 

PE2

set interfaces ge-0/0/1 encapsulation ethernet-ccc

set interfaces ge-0/0/1 mac 00:0c:29:4a:be:1d

set interfaces ge-0/0/1 unit 0

set interfaces ge-0/0/4 mac 00:0c:29:4a:be:3b

set interfaces ge-0/0/4 unit 0 family inet address 10.10.8.2/24

set interfaces ge-0/0/4 unit 0 family mpls

set interfaces lo0 unit 0 family inet address 2.2.2.2/32

set routing-options router-id 2.2.2.2

set routing-options forwarding-table export ECMP

set protocols mpls interface ge-0/0/4.0

set protocols ospf area 0.0.0.0 interface lo0.0 passive

set protocols ospf area 0.0.0.0 interface ge-0/0/4.0

set protocols ldp interface ge-0/0/4.0

set protocols ldp interface lo0.0

set protocols l2circuit neighbor 6.6.6.6 interface ge-0/0/1.0 virtual-circuit-id 1

 

 

chano@PE2# run show l2circuit connections 

Layer-2 Circuit Connections:

 

Legend for interface status  

Up -- operational            

Dn -- down                   

Neighbor: 6.6.6.6 

    Interface                 Type  St     Time last up          # Up trans

    ge-0/0/1.0(vc 1)          rmt   Up     May 15 22:25:06 2015           1

      Remote PE: 6.6.6.6, Negotiated control-word: Yes (Null)

      Incoming label: 299888, Outgoing label: 300128

      Negotiated PW status TLV: No

      Local interface: ge-0/0/1.0, Status: Up, Encapsulation: ETHERNET

      Flow Label Transmit: No, Flow Label Receive: No

 

 

chano@PE1> ping mpls l2circuit virtual-circuit 1 neighbor 2.2.2.2      

!!!!!

--- lsping statistics ---

5 packets transmitted, 5 packets received, 0% packet loss

 

 

 

 

 

+ Recent posts