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 [Link]/24 next-hop [Link]; route [Link]/24 discard; route [Link]/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 [Link]/21; route [Link]/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:
[Link]/8 orlonger [Link]/8 orlonger [Link]/16 orlonger [Link]/16 orlonger [Link]/24 orlonger [Link]/24 orlonger [Link]/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 { [Link]/8 orlonger; [Link]/12 orlonger; [Link]/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
[Link]/24
[Link]/32 [Link]/24
[Link]/21
[Link]/24
*[Direct/0] 1d [Link] > via at-0/1/0.100 *[Local/0] 1d [Link] Local *[BGP/170] [Link], localpref 100 AS path: 1 I > to [Link] via at-0/1/0.100 *[Static/5] [Link] Discard [Aggregate/130] [Link] Reject *[Static/5] [Link] 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 [Link] { interface lo0.0; interface so-1/0/0.0; } area [Link] { interface ge-0/1/0.0; } } } router ospf 1 network [Link] [Link] area 0 network [Link] [Link] area 0 network [Link] [Link] 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 [Link] 1 ge-0/1/0.0 DR [Link] 0 DR ID [Link] [Link] BDR ID [Link] [Link]
IOS-RTR#sh ip ospf int POS2/1 is up, line protocol is up Internet Address [Link]/31, Area 1 Process ID 1, Router ID [Link], 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 [Link] 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 [Link] 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 [Link] so-1/0/0.0 [Link] ge-0/1/0.0 IOS-RTR#sh ip ospf neighbor Neighbor ID Pri State [Link] 0 FULL/ [Link] 0 FULL/
State Full Full Dead Time [Link] [Link]
ID [Link] [Link] Address [Link] [Link]
Pri 128 128
Dead 35 38
Interface POS2/0 POS2/1
show ospf database
user@host> show ospf database OSPF link state database, Area [Link] Type ID Adv Rtr Router *[Link] [Link] Router [Link] [Link] Router [Link] [Link] Network [Link] [Link] IOS-RTR#sh ip ospf da OSPF Router with ID ([Link]) (Process ID 1) Router Link States (Area 0) Link ID [Link] [Link] [Link] Link ID [Link] ADV Router [Link] [Link] [Link] ADV Router [Link] 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 [Link]/24 [Link]/24 [Link]/24 [Link]/31 [Link]/32 *[OSPF/10] [Link], metric 2, tag > to [Link] via so-1/0/0.0 *[OSPF/10] [Link], metric 2, tag > to [Link] via so-1/0/0.0 *[OSPF/10] [Link], metric 2, tag > to [Link] via so-1/0/0.0 *[OSPF/10] [Link], metric 2, tag > to [Link] via so-1/0/0.0 *[OSPF/10] [Link], 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 [Link]; neighbor [Link] { peer-as 65002; } } } router bgp 65000 neighbor [Link] remote-as 65001 neighbor [Link] 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 [Link]; neighbor [Link] { peer-as 65002; } } }
router bgp 65000 no synchronization neighbor [Link] remote-as 65001 neighbor [Link] 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 [Link]; neighbor [Link] { peer-as 65002; } } group INTERNAL-PEERS { type internal; neighbor [Link]; } }
router bgp 65000 no synchronization neighbor [Link] remote-as 65001 neighbor [Link] remote-as 65002 neighbor [Link] 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 [Link]; neighbor [Link] { peer-as 65002; } } group INTERNAL-PEERS { type internal; local-address [Link]; neighbor [Link]; } } router bgp 65000 no synchronization neighbor [Link] neighbor [Link] neighbor [Link] neighbor [Link] 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 [Link] 65001 423 430 0 0 [Link] [Link] 65002 428 430 0 0 [Link] IOS-RTR-1#sh ip bgp summary BGP router identifier [Link], local AS number 65000 BGP table version is 1, main routing table version 1 Neighbor V AS MsgRcvd MsgSent State/PfxRcd [Link] 4 65001 5 22 [Link] 4 65002 9 22 TblVer 1 1 InQ OutQ Up/Down 0 0 0 [Link] 0 [Link]
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: [Link]+179 AS 65001 Local: [Link]+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: [Link] Local ID: [Link] 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 [Link] inet.0: 21 destinations, 22 routes (21 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both [Link]/24 Self 0 100 I [Link]/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 [Link] inet.0: 26 destinations, 27 routes (26 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both [Link]/24 [Link] 0 100 I [Link]/24 [Link] 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 [Link]/24 *[BGP/170] [Link], MED 0, localpref 100 AS path: 65001 I > to [Link] via so-0/0/0.0 [Link]/24 *[BGP/170] [Link], MED 0, localpref 100 AS path: 65001 I > to [Link] via so-0/0/0.0 IOS-RTR-1#sh ip bgp BGP table version is 2003, local router ID is [Link] 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 [Link] [Link] 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) [Link]/24 (1 entry, 1 announced) *BGP Preference: 170/-101 Source: [Link] Nexthop: via ge-0/1/0.0, selected Protocol Nexthop: [Link] Indirect nexthop: 8458088 44 State: <Active Int Ext> Local AS: 65000 Peer AS: 65000 Age: [Link] Metric: 0 Metric2: 1 Task: BGP_20.[Link]+1127 Announcement bits (3): 0-KRT 3-BGP.[Link]+179 4-Resolve inet.0 AS path: I Localpref: 100 Router ID: [Link]
Questions