Notas estudo JNCIS-ENT parte 12

Nota: Este Post faz parte do guide de Routing.

Configuring BGP

set routing-options router-id 192.168.100.1
set routing-options autonomous-system 65503

!iBGP Peering
set protocols bgp group int-65503 type internal
set protocols bgp group int-65503 local-address 192.168.100.1
set protocols bgp group int-65503 neighbor 192.168.100.2

!eBGP Peering
set protocols bgp group ext-65501 type external
set protocols bgp group ext-65501 peer-AS 65501
set protocols bgp group ext-65501 neighbor 172.30.1.2

set policy-options policy-statement next-hop-self-policy term alter-next-hop then next-hop self

Nota: não usar action accept em conjunto com next-hop, porque efetivamente faz match de todas as rotas

!Usar o Next-hop self address
set protocols bgp group int-65503 export next-hop-self-policy

Advertising the Aggregate Route

set routing-options aggregate route 172.24.0.0/22

set policy-options policy-statement adv-aggregate term match-aggregate from protocol aggregate
set policy-options policy-statement adv-aggregate term match-aggregate from route-filter 172.24.0.0/22 exact
set policy-options policy-statement adv-aggregate term match-aggregate then accept

!Advertise the aggregate
set protocols bgp group ext-65501 export adv-aggregate

O import e export de policies podem ser aplicadas nas sessões BGP no neighbor, group ou ao nível do protocolo. O router aplica apenas a policy import/export mais especifica, as policies configuradas serão inerentes nos níveis mais baixos, caso não exista policy nos níveis mais baixos. No entanto se existir policy nos níveis mais baixos será aplicada a respectiva policy.

set protocols bgp import add-community
set protocols bgp export alt-next-hop

set protocols bgp groups ISPs type external
set protocols bgp groups ISPs import alt-local-pref
set protocols bgp groups ISPs export adv-aggregate
set protocols bgp groups ISPs neighbor 172.25.1.1 peer-as 65100

set protocols bgp groups ISPs neighbor 172.25.2.1 export adv-custom
set protocols bgp groups ISPs neighbor 172.25.2.1 peer-as 65200

set protocols bgp groups Internal-Peers type internal
set protocols bgp groups Internal-Peers neighbor 192.168.100.10
set protocols bgp groups Internal-Peers neighbor 192.168.100.20

Import Policy Versus Export Policy

Routes from BGP Peers->RIB-In->Import Policy->RIB-Local (Route table)->Export policy->RIB-Out->Routes to BGP Peers

Só é possível exportar active routes. Por exemplo, se o router receber uma rota via BGP e OSPF sera escolhida a do OSPF devido a sua preference causando assim a inactive BGP route. É possível alterar este comportamento usando o advertise-inactive

Displaying BGP Summary Information

lab@mxA-1# run show bgp summary
Groups: 1 Peers: 1 Down peers: 0
Table          Tot Paths  Act Paths Suppressed    History Damp State    Pending
inet.0
0          0          0          0          0          0
Peer                     AS      InPkt     OutPkt    OutQ   Flaps Last Up/Dwn State|#Active/Received/Accepted/Damped…
172.16.110.2          65502         13         12       0       0        4:29 0/0/0/0              0/0/0/0

Output fields do comando show bgp summary:

Groups : Displays the number of BGP groups;
Peers: Displays the number of BGP peers;
Down peers: Displays the number of unestablished BGP peers;
Peer: Displays the address of each BGP peer; each peer has one line of output;
AS: Displays the peer’s AS number;
InPkt: Displays the number of packets received from the peer;
OutPkt : Displays the number of packets sent to the peer;
OutQ: Displays the count of the number of BGP packets queued to be transmitted to a particular neighbor; it
usually is 0 because the queue is emptied quickly;
Last Up/Down: Displays the last time since the neighbor transitioned to or form the established state; and
State: Displays either the BGP state or, if the neighbor is connected, the number of paths received from the
neighbor, the number of these paths that have been accepted as active and are being used for forwarding, and the
number of routes being damped.

lab@mxA-1# run show bgp neighbor
Peer: 172.16.110.2+57229 AS 65502 Local: 172.16.110.1+179 AS 65501
Type: External    State: Established    Flags: <Sync>
Last State: OpenConfirm   Last Event: RecvKeepAlive
Last Error: None
Export: [ policy-out ]
Options: <Preference PeerAS Refresh>
Holdtime: 90 Preference: 170
Number of flaps: 0
Peer ID: 100.1.1.2       Local ID: 100.1.1.1         Active Holdtime: 90
Keepalive Interval: 30         Peer index: 0
BFD: disabled, down
Local Interface: ge-1/1/0.110
NLRI for restart configured on peer: inet-unicast
NLRI advertised by peer: inet-unicast
NLRI for this session: inet-unicast
Peer supports Refresh capability (2)
Stale routes from peer are kept for: 300
Peer does not support Restarter functionality
NLRI that restart is negotiated for: inet-unicast
NLRI of received end-of-rib markers: inet-unicast
NLRI of all end-of-rib markers sent: inet-unicast
Peer supports 4 byte AS extension (peer-as 65502)
Peer does not support Addpath
Table inet.0 Bit: 10000
RIB State: BGP restart is complete
Send state: in sync
Active prefixes:              0
Received prefixes:            0
Accepted prefixes:            0
Suppressed due to damping:    0
Advertised prefixes:          3
Last traffic (seconds): Received 2    Sent 21   Checked 20
Input messages:  Total 50     Updates 2       Refreshes 0     Octets 1038
Output messages: Total 52     Updates 3       Refreshes 0     Octets 1169
Output Queue[0]: 0

Output fields do comando show bgp neighbor:

Peer: Displays the address of each BGP peer; each peer has one line of output.
Type: Displays the type of peer ( Internal  or  External ).
State: Displays the BGP state for this neighbor.
Flags: Displays the internal peer-specific flags for this neighbor.
Last State: Displays the BGP state of this neighbor prior to the current state.
Last Event: Displays the last BGP state transition event.
Last Error: Displays the last notification message sent to the neighbor.
Options: Displays the configuration options in effect for this neighbor.
Holdtime : Displays the configured hold time for this neighbor.
Preference: Displays the configuration preference for routes learned from the neighbor.
Peer ID: Displays the neighbor’s router ID.
Local ID : Displays the local system’s router ID.
Active Holdtime: Displays the hold-time value that was negotiated during the BGP open.
Table inet.0 Bit : Displays the Internal bit used for the peer group.
Send state: Displays whether all peers in the group have received all their updates ( in sync or  out of
sync).
Active Prefixes: Displays the number of prefixes accepted as active from this neighbor.
Last traffic (seconds): Displays how recently a BGP message was sent or received between the local
system and this neighbor.
Output Queue: Displays the number of BGP update messages pending for transmission to the neighbor.
Deleted routes: Displays the prefixes queued for withdrawal through pending update messages.
Queued AS Path: Displays an AS path queued for transmission in an update message.

lab@mxA-1# run show bgp group
Group Type: External                               Local AS: 65501
Name: ext             Index: 0                   Flags: <Export Eval>
Export: [ policy-out ]
Holdtime: 0
Total peers: 1        Established: 1
172.16.110.2+53009
inet.0: 0/0/0/0

Groups: 1  Peers: 1    External: 1    Internal: 0    Down peers: 0   Flaps: 1
Table          Tot Paths  Act Paths Suppressed    History Damp State    Pending
inet.0
0          0          0          0          0          0

Output fields do comando show bgp group :

Group Type: Displays the type of BGP group. It can be either  Internal  or  External .
• AS: Displays the number of the remote AS. For IBGP, this  number should be the same as the local AS number.
• Local AS : Displays the number of the local AS.
• Export : Displays the export policies configured for the BGP group with the export statement.
• Total peers : Displays the total number of peers in the group.
• Established : Displays the number of peers within the group that are in the established state.
• ip addresses: Displays the list of peers that are members of the group; the address is followed by the peer’s
port number.
• Options: Displays configured BGP options; these options can be one or more of the following:
– Local address : Displays the address configured with the  local-address  statement.
– NLRI: Displays the configured MBGP state for the BGP group; it can be either multicast or unicast, or both if
you have configured  nlri any .
– Hold time: Displays the hold time configured with the  hold-time statement; the default hold time is
90 seconds.
– Preference: Displays the preference value configured with the  preference statement; the default
preference value is 170.

Displaying Received BGP Routes

!O IP a usar deve ser o local do router usao para fazer peering
lab@exA-1# run show route advertising-protocol bgp ?
Possible completions:
<neighbor>           IP address of neighbor (local for RIP and RIPng)
!O IP e o do neighbor
lab@exA-1# run show route receive-protocol bgp ?
Possible completions:
<peer>               IP address of neighbo

!Rotas advertidas depois de aplicar o export policy
ab@mxA-1# run show route advertising-protocol bgp 172.16.110.1

inet.0: 6 destinations, 6 routes (6 active, 0 holddown, 0 hidden)
Prefix                  Nexthop              MED     Lclpref    AS path
* 9.9.9.9/32              Self                 100                200 [65501] I
* 10.210.14.128/27        Self                 100                200 [65501] I
* 172.16.110.0/24         Self                 100                200 [65501] I

!Rotas recebidas antes de aplicar o import policy
lab@mxA-2# run show route receive-protocol bgp 172.16.110.1

inet.0: 7 destinations, 9 routes (7 active, 0 holddown, 0 hidden)
Prefix                  Nexthop              MED     Lclpref    AS path
* 9.9.9.9/32              172.16.110.1         100                200 65501 I
10.210.14.128/27        172.16.110.1         100                200 65501 I
172.16.110.0/24         172.16.110.1         100                200 65501 I
Referências:

Notas estudo JNCIS-ENT parte 1

Notas estudo JNCIS-ENT parte 2

Notas estudo JNCIS-ENT parte 3

Notas estudo JNCIS-ENT parte 4

Notas estudo JNCIS-ENT parte 5

Notas estudo JNCIS-ENT parte 6

Notas estudo JNCIS-ENT parte 7

Notas estudo JNCIS-ENT parte 8

Notas estudo JNCIS-ENT parte 9

Notas estudo JNCIS-ENT parte 10

Notas estudo JNCIS-ENT parte 11

1 thought on “Notas estudo JNCIS-ENT parte 12”

Leave a Comment

Translate »
Google no longer supports Google Images API and this plugin can't work.

You can try to use other plugins with the same feature:
WP Picasa Box - http://codecanyon.net/item/wp-picasa-box/16099962
WP Pixabay Search And Insert - http://wpclever.net/downloads/wordpress-pixabay-search-and-insert