github.com/osrg/gobgp/v3@v3.30.0/docs/sources/ebgp-multihop.md (about) 1 # eBGP Multihop 2 3 This page explains how to configure eBGP multihop feature when external 4 BGP (eBGP) peers are not directly connected and multiple IP hops away. 5 6 ## Prerequisites 7 8 Assume you finished [Getting Started](getting-started.md). 9 10 ## Contents 11 12 - [Configuration](#configuration) 13 - [Verification](#verification) 14 15 ## Configuration 16 17 If eBGP neighbor "10.0.0.2" is 2 hops away, you need to configure 18 `[neighbors.ebgp-multihop.config]` with `multihop-ttl >= 3` in 19 `[[neighbors]]` section. 20 21 ```toml 22 [global.config] 23 as = 65001 24 router-id = "10.0.0.1" 25 26 [[neighbors]] 27 [neighbors.config] 28 peer-as = 65002 29 neighbor-address = "10.0.0.2" 30 [neighbors.ebgp-multihop.config] 31 enabled = true 32 multihop-ttl = 3 33 ``` 34 35 **NOTE:** eBGP Multihop feature is mututally exclusive with 36 [TTL Security](ttl-security.md). 37 These features cannot be configured for the same neighbor. 38 39 ## Verification 40 41 Without eBGP multihop configuration, the default TTL for eBGP session is 1, 42 and GoBGP cannot reach the neighbor on 2 hops away. 43 44 ```bash 45 $ gobgpd -f gobgpd.toml 46 {"level":"info","msg":"gobgpd started","time":"YYYY-MM-DDTHH:mm:ss+09:00"} 47 {"Topic":"Config","level":"info","msg":"Finished reading the config file","time":"YYYY-MM-DDTHH:mm:ss+09:00"} 48 {"level":"info","msg":"Peer 10.0.0.2 is added","time":"YYYY-MM-DDTHH:mm:ss+09:00"} 49 {"Topic":"Peer","level":"info","msg":"Add a peer configuration for:10.0.0.2","time":"YYYY-MM-DDTHH:mm:ss+09:00"} 50 ...(No connection)... 51 ``` 52 53 ```bash 54 $ tcpdump -i ethXX tcp -v 55 tcpdump: listening on ethXX, link-type EN10MB (Ethernet), capture size 262144 bytes 56 hh:mm:ss IP (tos 0x0, ttl 1, id 19110, offset 0, flags [DF], proto TCP (6), length 60) 57 10.0.0.1.xxx > 10.0.0.2.bgp: Flags [S], cksum 0x8382 (incorrect -> 0x540e), seq 31213082, win 29200, options [mss 1460,sackOK,TS val 2231484 ecr 0,nop,wscale 9], length 0 58 hh:mm:ss IP (tos 0x0, ttl 1, id 19111, offset 0, flags [DF], proto TCP (6), length 60) 59 10.0.0.1.xxx > 10.0.0.2.bgp: Flags [S], cksum 0x8382 (incorrect -> 0x5314), seq 31213082, win 29200, options [mss 1460,sackOK,TS val 2231734 ecr 0,nop,wscale 9], length 0 60 hh:mm:ss IP (tos 0x0, ttl 1, id 19112, offset 0, flags [DF], proto TCP (6), length 60) 61 10.0.0.1.xxx > 10.0.0.2.bgp: Flags [S], cksum 0x8382 (incorrect -> 0x511f), seq 31213082, win 29200, options [mss 1460,sackOK,TS val 2232235 ecr 0,nop,wscale 9], length 0 62 ...(snip)... 63 ``` 64 65 With eBGP multihop configuration, GoBGP will set the given TTL for eBGP 66 session and successfully connect to the neighbor on 2 hops away. 67 68 ```bash 69 $ gobgpd -f gobgpd.toml 70 {"level":"info","msg":"gobgpd started","time":"YYYY-MM-DDTHH:mm:ss+09:00"} 71 {"Topic":"Config","level":"info","msg":"Finished reading the config file","time":"YYYY-MM-DDTHH:mm:ss+09:00"} 72 {"level":"info","msg":"Peer 10.0.0.2 is added","time":"YYYY-MM-DDTHH:mm:ss+09:00"} 73 {"Topic":"Peer","level":"info","msg":"Add a peer configuration for:10.0.0.2","time":"YYYY-MM-DDTHH:mm:ss+09:00"} 74 {"Key":"10.0.0.2","State":"BGP_FSM_OPENCONFIRM","Topic":"Peer","level":"info","msg":"Peer Up","time":"YYYY-MM-DDTHH:mm:ss+09:00"} 75 ...(snip)... 76 ``` 77 78 ```bash 79 $ tcpdump -i ethXX tcp -v 80 tcpdump: listening on ethXX, link-type EN10MB (Ethernet), capture size 262144 bytes 81 hh:mm:ss IP (tos 0x0, ttl 3, id 31155, offset 0, flags [DF], proto TCP (6), length 60) 82 10.0.0.1.xxx > 10.0.0.2.bgp: Flags [S], cksum 0x8382 (incorrect -> 0x42a8), seq 3226540591, win 29200, options [mss 1460,sackOK,TS val 3302300 ecr 0,nop,wscale 9], length 0 83 hh:mm:ss IP (tos 0x0, ttl 253, id 0, offset 0, flags [DF], proto TCP (6), length 60) 84 10.0.0.2.bgp > 10.0.0.1.xxx: Flags [S.], cksum 0x5dd6 (correct), seq 2536172214, ack 3226540592, win 28960, options [mss 1460,sackOK,TS val 3302301 ecr 3302300,nop,wscale 9], length 0 85 hh:mm:ss IP (tos 0x0, ttl 3, id 31156, offset 0, flags [DF], proto TCP (6), length 52) 86 10.0.0.1.xxx > 10.0.0.2.bgp: Flags [.], cksum 0x837a (incorrect -> 0xfd89), ack 1, win 58, options [nop,nop,TS val 3302301 ecr 3302301], length 0 87 hh:mm:ss IP (tos 0x0, ttl 3, id 31157, offset 0, flags [DF], proto TCP (6), length 103) 88 10.0.0.1.xxx > 10.0.0.2.bgp: Flags [P.], cksum 0x83ad (incorrect -> 0xd68c), seq 1:52, ack 1, win 58, options [nop,nop,TS val 3302301 ecr 3302301], length 51: BGP 89 Open Message (1), length: 51 90 Version 4, my AS 65001, Holdtime 90s, ID 1.1.1.1 91 Optional parameters, length: 22 92 Option Capabilities Advertisement (2), length: 20 93 Route Refresh (2), length: 0 94 Multiprotocol Extensions (1), length: 4 95 AFI IPv4 (1), SAFI Unicast (1) 96 Multiprotocol Extensions (1), length: 4 97 AFI IPv6 (2), SAFI Unicast (1) 98 32-Bit AS Number (65), length: 4 99 4 Byte AS 65001 100 hh:mm:ss IP (tos 0x0, ttl 1, id 35114, offset 0, flags [DF], proto TCP (6), length 52) 101 10.0.0.2.bgp > 10.0.0.1.xxx: Flags [.], cksum 0xfd57 (correct), ack 52, win 57, options [nop,nop,TS val 3302301 ecr 3302301], length 0 102 hh:mm:ss IP (tos 0x0, ttl 1, id 35115, offset 0, flags [DF], proto TCP (6), length 103) 103 10.0.0.2.bgp > 10.0.0.1.xxx: Flags [P.], cksum 0xd357 (correct), seq 1:52, ack 52, win 57, options [nop,nop,TS val 3302301 ecr 3302301], length 51: BGP 104 Open Message (1), length: 51 105 Version 4, my AS 65002, Holdtime 90s, ID 2.2.2.2 106 Optional parameters, length: 22 107 Option Capabilities Advertisement (2), length: 20 108 Route Refresh (2), length: 0 109 Multiprotocol Extensions (1), length: 4 110 AFI IPv4 (1), SAFI Unicast (1) 111 Multiprotocol Extensions (1), length: 4 112 AFI IPv6 (2), SAFI Unicast (1) 113 32-Bit AS Number (65), length: 4 114 4 Byte AS 65002 115 hh:mm:ss IP (tos 0x0, ttl 3, id 31158, offset 0, flags [DF], proto TCP (6), length 52) 116 10.0.0.1.xxx > 10.0.0.2.bgp: Flags [.], cksum 0x837a (incorrect -> 0xfd23), ack 52, win 58, options [nop,nop,TS val 3302301 ecr 3302301], length 0 117 hh:mm:ss IP (tos 0x0, ttl 1, id 35117, offset 0, flags [DF], proto TCP (6), length 52) 118 10.0.0.2.bgp > 10.0.0.1.xxx: Flags [.], cksum 0x837a (incorrect -> 0xfcf4), ack 71, win 57, options [nop,nop,TS val 3302311 ecr 3302301], length 0 119 ...(snip)... 120 ```