User Tools

Site Tools


wiki:bgp_ip_transit_info

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
wiki:bgp_ip_transit_info [2026/01/08 14:52] – [gobgp software example] add info about adding private IP antisawiki:bgp_ip_transit_info [2026/05/29 12:56] (current) – [gobgp software example] add info about multiple peer ips and examples antisa
Line 76: Line 76:
 //as// is your assigned ASN number. //as// is your assigned ASN number.
  
-//neighbor-address// is the IP of the peer, provider should give you this info.+//neighbor-address// is the IP of the peer, provider should give you this info. There can be multiple peers for redundancy, so you just need to repeat this section for all the other IPs.
  
 //peer-as// is peer ASN, also given by provider. //peer-as// is peer ASN, also given by provider.
 +
 +Provider might also give you a //multihop-ttl// value. If this is the case you need to [[https://github.com/osrg/gobgp/blob/master/docs/sources/ebgp-multihop.md|add]] the following to both ipv4 and ipv6  configuration to above (change the value):
 +
 +
 +<code>
 +[neighbors.ebgp-multihop.config]
 +    enabled = true
 +    multihop-ttl = 64
 +</code>
  
 After starting gobgp you should see the session is established: After starting gobgp you should see the session is established:
Line 88: Line 97:
 2607:9000:600:24::1 11878    00:13:06 Establ      |        1         1 2607:9000:600:24::1 11878    00:13:06 Establ      |        1         1
 </code> </code>
 +//Received// and //Accepted// columns can also be 0. Depends on provider routing.
  
-Check the routing table+Check the routing table. You might see something like this
  
 <code> <code>
Line 109: Line 119:
 *  2a03:c040::/48       ::                                        00:06:24   [{Origin: ?}] *  2a03:c040::/48       ::                                        00:06:24   [{Origin: ?}]
  
 +</code>
 +
 +or this
 +
 +<code | download>
 +# gobgp global rib -a ipv4
 +   Network              Next Hop             AS_PATH              Age        Attrs
 +*  89.124.253.0/24      0.0.0.0                                   00:44:53   [{Origin: ?}]
 +# gobgp global rib -a ipv6
 +   Network              Next Hop             AS_PATH              Age        Attrs
 +*  2a03:c040::/48       ::                                        00:44:54   [{Origin: ?}]
 +</code>
 +
 +This should be ok. What you need to check is that you are advertising your IPs you should see something like:
 +
 +<code | download>
 +# gobgp neighbor 198.44.157.1 adj-out
 +   ID  Network              Next Hop             AS_PATH              AttrsFiltered
 +     89.124.253.0/24      198.44.157.3         203619               [{Origin: ?}]not filtered
 </code> </code>
  
Line 156: Line 185:
  
 </WRAP> </WRAP>
 +
 +===== Checking propagation =====
 +RIPE has BG play tool to check the history of route propagation here https://stat.ripe.net/bgplay/ and https://stat.ripe.net/lg.
 +
 +{{:wiki:screenshots:2026:02:ripe_bgplay.png?direct&600|}}
 +
 +Here's an example of Tzulo server provider which advertises to multiple upstreams
 +https://bgp.he.net/AS11878#_graph4
 +
 +https://bgp.tools/as/11878#connectivity
 +
 +which has multiple arrows pointing to upstreams.
 +
 +===== Updating AS path length =====
 +When advertising IP from multiple providers, one can have a shorter AS path and take all the traffic for itself. You can adjust the length of the AS path on your side by prepending your AS number 1 or more times to extend the path.
 +
 +Example using gobgp:
 +<code>
 +[global.config]
 +...
 +[global.apply-policy.config]
 +export-policy-list = ["prepend_as_path"]
 +default-import-policy = "accept-route"
 +default-export-policy = "accept-route"
 +
 +[[neighbors]]
 +...
 +...
 +
 +[[policy-definitions]]
 +name = "prepend_as_path"
 +  [[policy-definitions.statements]]
 +  name = "stmt_prepend"
 +
 +    [policy-definitions.statements.actions]
 +      route-disposition = "accept-route"
 +
 +    # number of times to prepend our asn. This allows for controlling
 +    # the length of th AS path that packet takes so it affects routing
 +    # https://www.noction.com/blog/as-path-and-as-path-prepending
 +    [policy-definitions.statements.actions.bgp-actions.set-as-path-prepend]
 +      as = "203619"
 +      repeat-n = 1
 +
 +</code>
 +Here we're prepending the path 1 additional time. After restarting the service notice a repeating ASN in //AS_PATH// column
 +
 +   # gobgp neighbor 213.155.129.101 adj-out
 +   ID  Network              Next Hop             AS_PATH              AttrsFiltered
 +     89.124.253.0/24      185.229.190.69       203619 203619        [{Origin: ?}]not filtered
 +
 +On RIPE Looking glass this will be shown as
 +{{:wiki:screenshots:2026:02:ripe_lg.png?direct&600|}}
 +
 +===== Withdrawing BGP announcements =====
 +In case you need to take the server offline for maintenance and you have a dynamic setup i.e. you yourself is advertising the routes via the BGP daemon on your server, it is sufficient to simply stop the BGP session on your side before the maintenance begins. Once the session is down, the advertisements for will be withdrawn automatically.
 +
 +After the maintenance is completed, you can start the session again and the prefixes will be re-advertised as before.
 +
  
 ====== Tested on ====== ====== Tested on ======
Line 167: Line 255:
   * https://cs249i.stanford.edu/projects/project_1.pdf   * https://cs249i.stanford.edu/projects/project_1.pdf
   * https://www.noction.com/blog/bgp-anycast   * https://www.noction.com/blog/bgp-anycast
 +  * https://render.com/blog/how-to-build-an-anycast-network
 +  * https://datatracker.ietf.org/doc/html/rfc4271#autoid-1
 +  * https://www.noction.com/blog/as-path-and-as-path-prepending
 +  * https://www.netactuate.com/docs/guides/mixed-provider-anycast
  
wiki/bgp_ip_transit_info.1767883939.txt.gz · Last modified: by antisa

Except where otherwise noted, content on this wiki is licensed under the following license: CC0 1.0 Universal
CC0 1.0 Universal Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki