Sei sulla pagina 1di 41

Custom Training

Module 4 Protocols

JUNOS and Routing Protocols


JUNOS has been stable and deployed for 10 years Proven and Tested
Some of the best routing expertise in industry Dave Katz
Author of most of the IGP code in the word

Ross Callon
IS-IS

Yakov Rechter

Wrote a little thing called BGP


MPLS VPNs anybody?

Kiretti Kompella Many others

Static Routes
Manually configured routes added to the routing table Once active, routes remain in the routing table until

deleted Route configured at the routing-options hierarchy level


[edit] routing-options {

static {
defaults { static-options; } route destination-prefix{ next-hop; static-options; }

Static Route Configuration


Static routes require the configuration of a next hop Valid options are IP address, discard, and reject Defaults section affects all static routes Qualified next-hop option allows independent

preference for static routes to the same destination Recursive static routes allow you to configure a route to an IP address that is not connected directly to the router
routing-options { static { defaults { preference 250; } route 192.168.20.0/24 next-hop 10.0.0.1; route 192.168.21.0/24 discard; route 192.168.22.0/24 reject; } }

Aggregate Routes
Route prefixes in the network can be combined into a

single entry in the routing table Aggregate routes become active once one or more contributing routes are active You configure aggregate routes at the routingoptions hierarchy level
[edit] routing-options { aggregate { defaults { aggregate-options; } route destination-prefix { policy policy-name; aggregate-options; }

Aggregate Route Configuration


The default next hop for an aggregate is reject discard is also a valid option
Defaults section affects all aggregate routes
routing-options { aggregate { defaults { community 1:888; } route 192.168.16.0/21; route 192.168.24.0/21 discard; } }

Martian Addresses
Address prefixes for which the routers ignore all

associated routing information Martians are not installed into the routing table In JUNOS software, the default martian addresses are:
0.0.0.0/8 orlonger 127.0.0.0/8 orlonger 128.0.0.0/16 orlonger 191.255.0.0/16 orlonger 192.0.0.0/24 orlonger 223.255.255.0/24 orlonger 240.0.0.0/4 orlonger

Adding Martian Addresses


Additional prefixes can be added to the martian list Configured at the routing-options hierarchy level
routing-options { martians { destination-prefix match-type; } } [edit] routing-options { martians { 10.0.0.0/8 orlonger; 172.16.0.0/12 orlonger; 192.168.0.0/16 orlonger; } }

Routing Tables
Juniper Networks M-series and T-series platforms have

eight predefined routing tables:


inet.0 for unicast routes inet.1 for the multicast forwarding cache inet.2 for MBGP routes to provide reverse path forwarding (RPF) checks inet.3 for MPLS path information inet6.0 for IPv6 routes mpls.0 for MPLS next hops __juniper_private1__.inet.0 __juniper_private1__.inet6.0

Routing Table Protocols


Within JUNOS software, many sources of routing

information exist
Referred to as protocols in the routing table

Default protocols: Direct Local Static RSVP LDP OSPF IS-IS RIP Aggregate BGP

Protocol Preference
Each protocol has a default preference value Preference is a measure of desirability
Used as a tiebreaker when the same prefix is learned through multiple sources; protocols with a lower preference are preferred

Selected default preference values circa release 6.0:

Direct/Local: 0 Static: 5 RSVP: 7 LDP: 9 OSPF internal route: 10 IS-IS Level 1 internal route: 15 IS-IS Level 2 internal route: 18

...

PIM: 105 DVMRP: 110


Aggregate routes: 130 OSPF AS external routes: 150 IS-IS Level 1 external route: 160 IS-IS Level 2 external route: 165 BGP: 170 MSDP: 175

RIP: 100 RIPng: 100


...

The Main Routing Table: inet.0


Sample inet.0 routing table for unicast routes:
user@host> show route inet.0: 49 destinations, 49 routes (49 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both

10.0.11.0/24
10.0.11.1/32 192.168.1.0/24

192.168.16.0/21

192.168.20.0/24

*[Direct/0] 1d 08:19:20 > via at-0/1/0.100 *[Local/0] 1d 08:19:20 Local *[BGP/170] 00:06:08, localpref 100 AS path: 1 I > to 10.0.11.2 via at-0/1/0.100 *[Static/5] 00:02:40 Discard [Aggregate/130] 00:36:17 Reject *[Static/5] 00:06:12 Reject

OSPF Protocol Review


OSPF is a link-state IGP that routes packets within a

single AS OSPF reliably floods LSAs to distribute link-state information once an adjacency is formed Each router uses these LSAs to create a complete database for the network OSPF uses the SPF algorithm within the database to calculate the best route to every node in the network

Designated Router
DR is elected by two values First tiebreaker is priority (JUNOS default is 128)
IOS default is 1 Priority can be set to 0

Second tiebreaker is router ID

Backup designated router is also elected Protects the segment from a DR failure Same election rules apply to the BDR

JUNOS Router ID Selection


Defined process for selection of a router ID (RID) The first non-127/8 address is selected as the RID The lo0 interface is used first to find an appropriate address If the loopback address is not configured, the router begins to scan for the first operational interface
After a reboot, this is often the fxp0 interface After an rpd restart, this is often a transit interface

The RID can be manually configured within the [edit

routing-options] configuration hierarchy

OSPF Configuration
Place operational interfaces within the OSPF area Each area is a separate configuration hierarchy All addresses on the interface can form adjacencies and are advertised into the network
protocols { ospf { area 0.0.0.0 { interface lo0.0; interface so-1/0/0.0; } area 0.0.0.1 { interface ge-0/1/0.0; } } } router ospf 1 network 10.81.254.40 0.0.0.0 area 0 network 10.81.40.14 0.0.0.1 area 0 network 10.81.40.16 0.0.0.1 area 1

show ospf interface


Defaults are different between the two vendors detail option provides a similar level of information
user@host> show ospf interface Intf State Area Nbrs so-1/0/0.0 PtToPt 0.0.0.0 1 ge-0/1/0.0 DR 0.0.0.1 0 DR ID 0.0.0.0 10.81.254.20 BDR ID 0.0.0.0 0.0.0.0

IOS-RTR#sh ip ospf int POS2/1 is up, line protocol is up Internet Address 10.81.40.17/31, Area 1 Process ID 1, Router ID 10.81.254.40, Network Type POINT_TO_POINT, Cost: 1 Transmit Delay is 1 sec, State POINT_TO_POINT, Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5 oob-resync timeout 40 Hello due in 00:00:09 Supports Link-local Signaling (LLS) Index 1/1, flood queue length 0 Next 0x0(0)/0x0(0) Last flood scan length is 1, maximum is 2 Last flood scan time is 0 msec, maximum is 0 msec Neighbor Count is 1, Adjacent neighbor count is 1 Adjacent with neighbor 10.81.254.20 Suppress hello for 0 neighbor(s)

show ospf neighbor


Default output is a summary-like screen detail option provides more information for each neighbor

user@host> show ospf neighbor Address Interface 10.81.40.35 so-1/0/0.0 10.81.40.37 ge-0/1/0.0 IOS-RTR#sh ip ospf neighbor Neighbor ID Pri State 10.81.254.24 0 FULL/ 10.81.254.23 0 FULL/

State Full Full Dead Time 00:00:33 00:00:36

ID 10.81.254.31 10.81.254.40 Address 10.81.40.14 10.81.40.16

Pri 128 128

Dead 35 38

Interface POS2/0 POS2/1

show ospf database


user@host> show ospf database OSPF link state database, Area 0.0.0.0 Type ID Adv Rtr Router *10.81.254.23 10.81.254.23 Router 10.81.254.24 10.81.254.24 Router 10.81.254.40 10.81.254.40 Network 10.81.9.46 10.81.254.24 IOS-RTR#sh ip ospf da OSPF Router with ID (10.81.254.40) (Process ID 1) Router Link States (Area 0) Link ID 10.81.254.23 10.81.254.24 10.81.254.40 Link ID 10.81.9.46 ADV Router 10.81.254.23 10.81.254.24 10.81.254.40 ADV Router 10.81.254.24 Age 14 13 17 Age 165 Seq# 0x80000007 0x80000009 0x80000002 Checksum 0xA184 0x2EDA 0x2C2D Link count 5 4 5 Seq 0x80000007 0x80000009 0x80000002 0x80000002 Age 38 39 43 190 Opt 0x22 0x2 0x22 0x2 Cksum Len 0xa184 84 0x2eda 72 0x2c2d 84 0xa8ca 32

Net Link States (Area 0) Seq# Checksum 0x80000002 0xA8CA

Viewing OSPF Routes


Use the show route protocol ospf command to

see all OSPF routes


user@host> show route protocol ospf inet.0: 1898 destinations, 2009 routes (1898 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 10.15.15.0/24 10.15.16.0/24 10.15.17.0/24 10.81.40.14/31 224.0.0.5/32 *[OSPF/10] 00:01:14, metric 2, tag > to 10.81.40.17 via so-1/0/0.0 *[OSPF/10] 00:01:14, metric 2, tag > to 10.81.40.17 via so-1/0/0.0 *[OSPF/10] 00:01:14, metric 2, tag > to 10.81.40.17 via so-1/0/0.0 *[OSPF/10] 00:21:54, metric 2, tag > to 10.81.40.17 via so-1/0/0.0 *[OSPF/10] 00:14:22, metric 1 MultiRecv 0 0 0 0

JUNOS BGP Support


JUNOS supports the following BGP features: Route refresh Multiprotocol extensions Authentication Communities Route damping Graceful restart Route reflection Confederations

What Is BGP?
BGP Is an inter-domain routing protocol that communicates prefix reachability Is a path vector protocol Views the Internet as a collection of autonomous systems Supports CIDR Exchanges routing information between peers

BGP Fundamentals
Each BGP update contains one path advertisement and

attributes
Many prefixes can share the same path

Routes consist of a destination prefix along with an AS

path and other BGP-specific attributes BGP compares the AS path and other attributes to choose the best path

BGP Message Types


BGP message types: Open Update Keepalive Notification Refresh
Messages use a common header

BGP Routing Information Bases


Three main routing information bases (RIB) used by

the protocol
Adjacency-RIB-In contains all the routes received from all peers Adjacency-RIB-Local contains the best path to each received destination Adjacency-RIB-Out contains the routes to advertise to each peer

You view all of these using the show route command


JUNOS maintains all routes in the routing table Internal data structures keep things straight

BGP Route Selection

JUNOS uses a similar selection algorithm to IOS


1. 2. 3. 4. 5. The notable change is a lack of weight Verify reachability to the BGP next hop; otherwise mark the route as hidden and unusable Select the route with the highest Local Preference Select the route with the shortest AS Path length Select the route with the lowest Origin value Select the route with the smallest MED

The list of selection tiebreakers is:

BGP Route Selection

The list of selection tiebreakers continues:


6. Prefer routes learned from EBGP peers over routes learned from IBGP peers. If only EBGP-learned routes remain, skip to step 9 7. Select the route with the small IGP cost to the BGP peer who advertised the route 8. Select the route with the shortest Cluster list length, if route reflection is used in the network 9. Select the route with the smallest numerical RID 10. Select the route with the smallest numerical Peer ID

BGP Configurations
The configuration of BGP is where many differences

appear between JUNOS and IOS Assigning the local Autonomous System number
JUNOS places the AS within routing-options
Allows multiple process to use the same value (VPN)

IOS encodes the AS within the router command

routing-options { autonomous-system 65000; } router bgp 65000

BGP Configurations
Peer groups JUNOS makes almost exclusive use of them Optional within IOS (but widely used)
AS number of the peer Can be defined for the whole group or just a peer
bgp { group EXTERNAL-PEERS { peer-as 65001; neighbor 10.81.254.1; neighbor 10.81.254.2 { peer-as 65002; } } } router bgp 65000 neighbor 10.81.254.1 remote-as 65001 neighbor 10.81.254.2 remote-as 65002

BGP Configurations
Synchronization JUNOS uses no synch by default
Automatic summarization off by default

bgp { group EXTERNAL-PEERS { peer-as 65001; neighbor 10.81.254.1; neighbor 10.81.254.2 { peer-as 65002; } } }

router bgp 65000 no synchronization neighbor 10.81.254.1 remote-as 65001 neighbor 10.81.254.2 remote-as 65002 no auto-summary

BGP Configurations
type command informs the router figure how to work

with the peer


external or internal defined

bgp { group EXTERNAL-PEERS { type external; peer-as 65001; neighbor 10.81.254.1; neighbor 10.81.254.2 { peer-as 65002; } } group INTERNAL-PEERS { type internal; neighbor 10.81.254.3; } }

router bgp 65000 no synchronization neighbor 10.81.254.1 remote-as 65001 neighbor 10.81.254.2 remote-as 65002 neighbor 10.81.254.3 remote-as 65000 no auto-summary

BGP Configurations
local-address command changes the source

address of the BGP packets


Similar to update-source
bgp { group EXTERNAL-PEERS { type external; peer-as 65001; neighbor 10.81.254.1; neighbor 10.81.254.2 { peer-as 65002; } } group INTERNAL-PEERS { type internal; local-address 10.81.254.10; neighbor 10.81.254.3; } } router bgp 65000 no synchronization neighbor 10.81.254.1 neighbor 10.81.254.2 neighbor 10.81.254.3 neighbor 10.81.254.3 Loopback0 no auto-summary

remote-as 65001 remote-as 65002 remote-as 65000 update-source

show bgp summary


Similar looking high-level view of all peers JUNOS adds some additional route information
Active/Received/Damped routes per peer

user@host> show bgp summary Groups: 1 Peers: 2 Down peers: 0 Table Tot Paths Act Paths Suppressed History Damp State inet.0 12 12 0 0 0 Peer AS InPkt OutPkt OutQ Flaps Last Up/Dwn 10.81.254.1 65001 423 430 0 0 3:33:00 10.81.254.2 65002 428 430 0 0 3:32:56 IOS-RTR-1#sh ip bgp summary BGP router identifier 10.81.254.10, local AS number 65000 BGP table version is 1, main routing table version 1 Neighbor V AS MsgRcvd MsgSent State/PfxRcd 10.81.254.1 4 65001 5 22 10.81.254.2 4 65002 9 22 TblVer 1 1 InQ OutQ Up/Down 0 0 0 00:01:09 0 00:03:02

Pending 0 State 4/4/0 4/4/0

4 4

show bgp neighbor


Detailed information regarding each BGP peer
user@host> show bgp neighbor Peer: 10.81.254.1+179 AS 65001 Local: 10.81.254.10+1028 AS 65000 Type: External State: Established Flags: <> Last State: OpenConfirm Last Event: RecvKeepAlive Last Error: None Options: <Preference HoldTime PeerAS Refresh> Holdtime: 90 Preference: 170 Number of flaps: 0 Peer ID: 10.81.254.1 Local ID: 10.81.254.10 Active Holdtime: 90 Keepalive Interval: 30 Local Interface: so-0/0/1.0 NLRI advertised by peer: inet-unicast NLRI for this session: inet-unicast Peer supports Refresh capability (2) Table inet.0 Bit: 10000 Send state: in sync Active prefixes: 4 Received prefixes: 4 Suppressed due to damping: 0 Last traffic (seconds): Received 13 Sent 13 Checked 13 Input messages: Total 438 Updates 4 Refreshes 0 Octets 8473 Output messages: Total 440 Updates 4 Refreshes 0 Octets 8526 Output Queue[0]: 0

Viewing Advertised BGP Routes


All routes in JUNOS are in the routing table Use show route advertising-protocol bgp <peer> to see all routes sent to that peer Similar to show ip bgp neigh <peer> advertise in IOS Shows the effect of all export policies
Except for the default AS Path prepend action

Different than IOS, which doesnt display changed attributes


user@host> show route advertising-protocol bgp 10.81.254.1 inet.0: 21 destinations, 22 routes (21 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 10.20.3.0/24 Self 0 100 I 10.20.4.0/24 Self 0 100 I

Viewing Received BGP Routes


Again, routes in JUNOS are in the routing table Use show route receive-protocol bgp <peer> to see all routes received from that peer Similar to show ip bgp neigh <peer> receivedroutes in IOS
IOS requires soft-in configuration
JUNOS defaults to soft-in and soft-out operation

Shows the routes prior to import policies


Except for rejected routes via a route-filter
user@host> show route receive-protocol bgp 10.81.254.1 inet.0: 26 destinations, 27 routes (26 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 10.20.1.0/24 10.81.40.15 0 100 I 10.20.2.0/24 10.81.40.15 0 100 I

Viewing Local BGP Routes


Use show route protocol bgp
Some BGP attributes are present in this output
Local Preference, AS Path, Origin, MED Use detail or extensive to see more data

Similar to show ip bgp in IOS

JUNOS doesnt have the concepts of: Table versions


The routing table is the routing table one entity

60-second BGP scan time


All BGP routes get processed immediately

Local BGP Route Comparison


user@host> show route protocol bgp inet.0: 26 destinations, 27 routes (26 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 10.20.1.0/24 *[BGP/170] 00:23:21, MED 0, localpref 100 AS path: 65001 I > to 10.81.40.15 via so-0/0/0.0 10.20.2.0/24 *[BGP/170] 00:23:21, MED 0, localpref 100 AS path: 65001 I > to 10.81.40.15 via so-0/0/0.0 IOS-RTR-1#sh ip bgp BGP table version is 2003, local router ID is 10.81.254.10 Status codes: s suppressed, d damped, h history, * valid, > best, i internal, r RIB-failure, S Stale Origin codes: i - IGP, e - EGP, ? - incomplete Network >i10.20.3.0/24 >i10.20.4.0/24 Next Hop 10.81.254.20 10.81.254.20 Metric LocPrf Weight Path 100 0 i 100 0 i

Viewing Detailed Route Information


user@host> show route 10.20.3/24 detail inet.0: 26 destinations, 27 routes (26 active, 0 holddown, 0 hidden) 10.20.3.0/24 (1 entry, 1 announced) *BGP Preference: 170/-101 Source: 10.81.254.20 Nexthop: via ge-0/1/0.0, selected Protocol Nexthop: 10.81.254.20 Indirect nexthop: 8458088 44 State: <Active Int Ext> Local AS: 65000 Peer AS: 65000 Age: 2:39:44 Metric: 0 Metric2: 1 Task: BGP_20.10.81.254.20+1127 Announcement bits (3): 0-KRT 3-BGP.0.0.0.0+179 4-Resolve inet.0 AS path: I Localpref: 100 Router ID: 10.81.254.20

Questions

Potrebbero piacerti anche