BGP в Juniper

Материал из Xgu.ru

Перейти к: навигация, поиск

Настройка протокола динамической маршрутизации BGP в Juniper JUNOS:

Configure-bgp-junos.PNG

Посмотреть соседей можно командой show bgp summary:

root@JUN-1> show bgp summary
Groups: 2 Peers: 2 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...
100.0.0.2               200         10         12       0       0        3:50 0/0/0/0              0/0/0/0
192.168.0.2             100         23         23       0       0        9:38 0/0/0/0              0/0/0/0

Посмотреть более подробную информацию о соседе можно командой show bgp neighbor:

root@JUN-1> show bgp neighbor
Peer: 100.0.0.2+61552 AS 200   Local: 100.0.0.1+179 AS 100
  Type: External    State: Established    Flags: <Sync>
  Last State: OpenConfirm   Last Event: RecvKeepAlive
  Last Error: None
  Export: [ adv-aggregate ]
  Options: <Preference PeerAS Refresh>
  Holdtime: 90 Preference: 170
  Number of flaps: 0
  Peer ID: 100.0.0.2       Local ID: 100.100.100.1     Active Holdtime: 90
  Keepalive Interval: 30         Peer index: 0
  BFD: disabled, down
  Local Interface: em0.0
  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 200)
  Peer does not support Addpath
  Table inet.0 Bit: 10001
    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:          1
  Last traffic (seconds): Received 21   Sent 10   Checked 25
  Input messages:  Total 11     Updates 1       Refreshes 0     Octets 253
  Output messages: Total 13     Updates 1       Refreshes 0     Octets 349
  Output Queue[0]: 0

Посмотреть информацию за группу можно командой show bgp group:

root@JUN-1> show bgp group int-100
Group Type: Internal    AS: 100                    Local AS: 100
  Name: int-100         Index: 0                   Flags: <>
  Export: [ next-hop-self-policy ]
  Holdtime: 0
  Total peers: 1        Established: 1
  192.168.0.2+63850
  inet.0: 0/0/0/0

root@JUN-1> show bgp group ext-200
Group Type: External                               Local AS: 100
  Name: ext-200         Index: 1                   Flags: <Export Eval>
  Export: [ adv-aggregate ]
  Holdtime: 0
  Total peers: 1        Established: 1
  100.0.0.2+61552
  inet.0: 0/0/0/0

Посмотреть маршруты, полученные по BGP и добавленные в таблицу маршрутизации можно командой show route protocol bgp:

root@JUN-3> show route protocol bgp

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

100.100.100.0/24   *[BGP/170] 00:02:23, localpref 100
                      AS path: 100 I
                    > to 100.0.0.1 via em0.0

Посмотреть все префиксы, полученные по BGP, до обработки входящими фильтрами можно командой show route receive-protocol bgp [Peer IP]:

root@JUN-3> show route receive-protocol bgp 100.0.0.1

inet.0: 3 destinations, 3 routes (3 active, 0 holddown, 0 hidden)
  Prefix                  Nexthop              MED     Lclpref    AS path
* 100.100.100.0/24        100.0.0.1                               100 I

Посмотреть префиксы, которые мы отдаем по BGP соседу можно командой show route advertising-protocol bgp [Peer IP]:

root@JUN-1> show route advertising-protocol bgp 100.0.0.2

inet.0: 8 destinations, 8 routes (8 active, 0 holddown, 0 hidden)
  Prefix                  Nexthop              MED     Lclpref    AS path
* 100.100.100.0/24        Self                                    I