info_i_25x25.png See important information about Ubiquiti Devices and KRACK Vulnerability in this article. We will update this document as more information becomes available.

EdgeMAX - Border Gateway Protocol

Resumen


Los lectores aprenderán cómo BGP es utilizado y configurado entre dos sistemas autónomos

BGP (Border Gateway Protocol)


Diagrama que muestra dos diferentes sistemas autónomos (AS)

R1: Router 1

R2: Router 2

Configuración


Nota: Estas son las direcciones IP de los dos routers:

Dirección IP de R1: 192.0.2.1
Dirección IP de R2: 203.0.113.1
  • Para la configuración básica del router R1 en AS 1, utilice los siguientes comandos para crear un peer eBGP con router R2 en AS 2:
ubnt@R1:~$ configure
[edit]
ubnt@R1# set protocols bgp 1 parameters router-id 192.0.2.1
[edit]
ubnt@R1# set protocols bgp 1 neighbor 203.0.113.1 remote-as 2
[edit]
ubnt@R1# commit
[ protocols bgp 1 ]
Starting routing daemon: bgpd.
[edit]
ubnt@R1# save ; exit
Saving configuration to '/config/config.boot'...
Done
exit
  • Para la configuración básica del router R2 en AS 2, utilice los siguientes comandos para crear un peer eBGP con router R1 en 1 como:
ubnt@R2:~$ configure
[edit]
ubnt@R2# set protocols bgp 2 parameters router-id 203.0.113.1
[edit]
ubnt@R2# set protocols bgp 2 neighbor 192.0.2.1 remote-as 1
[edit]
ubnt@R2# commit
[ protocols bgp 2 ]
Starting routing daemon: bgpd.
[edit]
ubnt@R2# save; exit
Saving configuration to '/config/config.boot'...
Done
exit
ubnt@R2:~$

Verificación por pares


Uso del show ip bgp vecinos comando para comprobar que el interlocutor es establecido .

ubnt@R1:~$ show ip bgp neighbors
 BGP neighbor is 203.0.113.1, remote AS 2, local AS 1, external link
 BGP version 4, remote router ID 203.0.113.1
 BGP state = Established, up for 00:00:13
 Last read 00:55:04, hold time is 180, keepalive interval is 60 seconds
 Neighbor capabilities:
 4 Byte AS: advertised and received
 Route refresh: advertised and received(old & new)
 Address family IPv4 Unicast: advertised and received
 Message statistics:
 Inq depth is 0
 Outq depth is 0
 Sent Rcvd
 Opens: 7 1
 Notifications: 0 0
 Updates: 0 0
 Keepalives: 2 1
 Route Refresh: 0 0
 Capability: 0 0
 Total: 9 2
 Minimum time between advertisement runs is 30 seconds
 Update source is 192.0.2.1
 For address family: IPv4 Unicast
 Community attribute sent to this neighbor(both)
 0 accepted prefixes
 Connections established 1; dropped 0
 Last reset never
 Local host: 192.0.2.1, Local port: 60047
 Foreign host: 203.0.113.1, Foreign port: 179
 Nexthop: 192.0.2.1
 Nexthop global: fe80::de9f:dbff:fe29:5f7
 Nexthop local: ::
 BGP connection: non shared network
 Read thread: on Write thread: off

Rutas aprendidas


El Mostrar comando comprueba R1 para rutas aprendidas, y los comandos de configuración redistribuyen rutas estáticas en R2, así que a aprender rutas de R2 R1.

  • Uso del mostrar ip ruta bgp comando para buscar rutas de bgp R1 aprendido de pares R2.
ubnt@R1:~$ show ip route bgp
ubnt@R1:~$
  • No hay rutas han recibido porque no hay rutas han sido redistribuidos. En R2, utilice los siguientes comandos para redistribuir las rutas estáticas:
ubnt@R2:~$ configure
[edit]
ubnt@R2# set protocols bgp 2 redistribute static
[edit]
ubnt@R2# commit
[edit]
ubnt@R2# save; exit
Saving configuration to '/config/config.boot'...
Done
exit
  • Busque R1 otra vez rutas bgp de pares R2.
ubnt@R1:~$ show ip route bgp
Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF,
 I - ISIS, B - BGP, > - selected route, * - FIB route
B>* 0.0.0.0/0 [20/0] via 203.0.113.1, eth2, 00:00:03
B>* 1.0.0.0/24 [20/0] via 203.0.113.1, eth2, 00:00:03
 

Rutas de Internet completo


Nota: Recibir una completa tabla de enrutamiento de Internet consume cantidades significativas de memoria; por lo tanto, no recomendamos utilizar BGP para rutas llenas de la EdgeRouter Lite que solo tiene 512MB de RAM.

Uso del Mostrar vía ip Resumen comando para ver el Resumen de ruta.

admin@ubnt-bgp-test:~$ show ip route summary
Route Source Routes FIB
connected 3 3
static 3 2
ebgp 405543 405541
ibgp 0 0
------
Totals 405549 405546