EdgeRouter - 경계 경로 프로토콜 (Border Gateway Protocol, BGP) ====================================== download at 2017-05-01T20:50:22Z `origin `_ Overview -------- -------------- 이 문서는 두 자율 시스템 사이에서 BGP를 설정하는 방법에 대하여 서술합니다. 경계 경로 프로토콜 (Border Gateway Protocol, BGP) ----------------------------- -------------- 아래는 두개의 서로 다른 자율 시스템 (Autonomous Systems, AS)을 표현한 다이어그램입니다. .. raw:: html
|image0| .. raw:: html
R1: AS 1의 라우터 R2: AS 2의 라우터 환경설정 ------------- -------------- *Note: 각 라우터읱 IP 주소입니다:* *R1 IP 주소: 192.0.2.1* *R2 IP 주소: 203.0.113.1* - AS 1의 R1 기본 설정은 다음 명령어를 사용하여 AS 2의 라우터 R2와 eBGP 피어를 생성합니다: :: 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 - AS 2의 라우터 R2 기본 설정은 다음 명령어를 사용하여 AS 1의 라우터 R1와 eBGP 피어를 생성합니다: :: 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:~$ 피어 검증 ----------------- -------------- \ **show ip bgp neighbors** 명령어를 사용하여 피어가 \ *established* 상태임을 검증합니다. :: 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 학습 경로 -------------- -------------- \ *show* 명령어는 R1 학습 경로를 확인합니다. 환경설정 명령어는 R2 고정 경로를 재배포 합니다. 재배포 함으로써 R1은 R2로부터 경로를 학습합니다. - \ **show ip route bgp** 명령어를 사용해서 R1이 피어 R2로부터 학습한 bgp 경로를 확인합니다. :: ubnt@R1:~$ show ip route bgp ubnt@R1:~$ - 재배포된 경로가 없기 때문에 학습한 경로가 없습니다. R2에서 다음 명령어를 사용하여 고정 경로를 재배포합니다: :: 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 - 피어 R2로부터 학습한 bgp 경로를 R1에서 다시 한번 더 확인해 봅니다. :: 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   모든 인터넷 경로 -------------------- -------------- *Note: 모든 인터넷 경로 라우팅 테이블은 상당히 많은 메모리를 소비합니다. 그러므로, BGP를 모든 경로에 사용하는 것을 권장 하지 않습니다. EdgeRouter Lite는 램의 크기가 512 MB이기 때문에 권장하지 않습니다.* \ **show ip route summary** 명령어를 사용하여 경로 요약을 확인 할수 있습니다. :: 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 .. |image0| image:: /hc/en-us/article_attachments/202776387/EdgeOS_BGP_RGB.png