github.com/osrg/gobgp/v3@v3.30.0/docs/sources/configuration.md (about) 1 # Configuration Example 2 3 ```toml 4 [global.config] 5 as = 1 6 router-id = "1.1.1.1" 7 # listen port (by default 179) 8 port = 1790 9 # to disable listening 10 # port = -1 11 12 # listen address list (by default "0.0.0.0" and "::") 13 local-address-list = ["192.168.10.1", "2001:db8::1"] 14 15 [global.apply-policy.config] 16 import-policy-list = ["policy1"] 17 default-import-policy = "reject-route" 18 export-policy-list = ["policy2"] 19 default-export-policy = "accept-route" 20 21 [[rpki-servers]] 22 [rpki-servers.config] 23 address = "210.173.170.254" 24 port = 323 25 26 [[bmp-servers]] 27 [bmp-servers.config] 28 address = "127.0.0.1" 29 port = 11019 30 route-monitoring-policy = "pre-policy" 31 statistics-timeout = 3600 32 33 [[vrfs]] 34 [vrfs.config] 35 name = "vrf1" 36 # If id is omitted, automatically assigned. 37 id = 1 38 rd = "65000:100" 39 # Each configuration for import and export RTs; 40 # import-rt-list 41 # export-rt-list 42 # are preferred than both-rt-list. 43 both-rt-list = ["65000:100"] 44 45 [[mrt-dump]] 46 [mrt-dump.config] 47 dump-type = "updates" 48 file-name = "/tmp/log/2006/01/02.1504.dump" 49 dump-interval = 180 50 51 [zebra] 52 [zebra.config] 53 enabled = true 54 url = "unix:/var/run/quagga/zserv.api" 55 redistribute-route-type-list = ["connect"] 56 version = 2 # version used in Quagga on Ubuntu 16.04 57 58 [[neighbors]] 59 [neighbors.config] 60 peer-as = 2 61 # To disable AS checking set to 0 62 auth-password = "password" 63 neighbor-address = "192.168.10.2" 64 # override global.config.as value 65 local-as = 1000 66 remove-private-as = "all" 67 # To enable peer group setting, uncomment the following 68 #peer-group = "my-peer-group" 69 # Force sending Software Version Capability, default: disabled. 70 #send-software-version = true 71 [neighbors.as-path-options.config] 72 allow-own-as = 1 73 replace-peer-as = true 74 [neighbors.timers.config] 75 connect-retry = 5 76 hold-time = 9 77 keepalive-interval = 3 78 [neighbors.transport.config] 79 passive-mode = true 80 local-address = "192.168.10.1" 81 remote-port = 2016 82 ttl = 64 # default value on Linux 83 [neighbors.ebgp-multihop.config] 84 enabled = true 85 multihop-ttl = 100 86 [neighbors.route-reflector.config] 87 route-reflector-client = true 88 route-reflector-cluster-id = "192.168.0.1" 89 [neighbors.add-paths.config] 90 send-max = 8 91 receive = true 92 [neighbors.graceful-restart.config] 93 enabled = true 94 notification-enabled = true 95 long-lived-enabled = true 96 # graceful restart restart time 97 restart-time = 20 98 [[neighbors.afi-safis]] 99 [neighbors.afi-safis.config] 100 afi-safi-name = "ipv4-unicast" 101 [neighbors.afi-safis.prefix-limit.config] 102 max-prefixes = 1000 103 shutdown-threshold-pct = 80 104 [neighbors.afi-safis.mp-graceful-restart.config] 105 enabled = true 106 [neighbors.afi-safis.long-lived-graceful-restart.config] 107 enabled = true 108 # long lived graceful restart restart time 109 restart-time = 100000 110 [neighbors.afi-safis.add-paths.config] 111 # override neighbors.add-paths.config 112 receive = true 113 send-max = 8 114 [[neighbors.afi-safis]] 115 [neighbors.afi-safis.config] 116 afi-safi-name = "ipv6-unicast" 117 [[neighbors.afi-safis]] 118 [neighbors.afi-safis.config] 119 afi-safi-name = "ipv4-labelled-unicast" 120 [[neighbors.afi-safis]] 121 [neighbors.afi-safis.config] 122 afi-safi-name = "ipv6-labelled-unicast" 123 [[neighbors.afi-safis]] 124 [neighbors.afi-safis.config] 125 afi-safi-name = "l3vpn-ipv4-unicast" 126 [[neighbors.afi-safis]] 127 [neighbors.afi-safis.config] 128 afi-safi-name = "l3vpn-ipv6-unicast" 129 [[neighbors.afi-safis]] 130 [neighbors.afi-safis.config] 131 afi-safi-name = "l2vpn-evpn" 132 [[neighbors.afi-safis]] 133 [neighbors.afi-safis.config] 134 afi-safi-name = "l2vpn-vpls" 135 [[neighbors.afi-safis]] 136 [neighbors.afi-safis.config] 137 afi-safi-name = "rtc" 138 [[neighbors.afi-safis]] 139 [neighbors.afi-safis.config] 140 afi-safi-name = "ipv4-encap" 141 [[neighbors.afi-safis]] 142 [neighbors.afi-safis.config] 143 afi-safi-name = "ipv6-encap" 144 [[neighbors.afi-safis]] 145 [neighbors.afi-safis.config] 146 afi-safi-name = "ipv4-flowspec" 147 [[neighbors.afi-safis]] 148 [neighbors.afi-safis.config] 149 afi-safi-name = "ipv6-flowspec" 150 [[neighbors.afi-safis]] 151 [neighbors.afi-safis.config] 152 afi-safi-name = "ipv4-mup" 153 [[neighbors.afi-safis]] 154 [neighbors.afi-safis.config] 155 afi-safi-name = "ipv6-mup" 156 [[neighbors.afi-safis]] 157 [neighbors.afi-safis.config] 158 afi-safi-name = "opaque" 159 [neighbors.apply-policy.config] 160 import-policy-list = ["policy1"] 161 default-import-policy = "reject-route" 162 export-policy-list = ["policy2"] 163 default-export-policy = "accept-route" 164 in-policy-list = ["policy3"] 165 default-in-policy = "reject-route" 166 [neighbors.route-server.config] 167 route-server-client = true 168 # To enable TTL Security, uncomment the following. 169 # Please note that this feature is mututally exclusive with 170 # "neighbors.ebgp-multihop.config". 171 #[neighbors.ttl-security.config] 172 # enabled = true 173 # ttl-min = 255 # 255 means directly connected 174 175 [[neighbors]] 176 [neighbors.config] 177 peer-group = "my-peer-group" 178 neighbor-address = "127.0.0.2" 179 180 [[peer-groups]] 181 [peer-groups.config] 182 peer-group-name = "my-peer-group" 183 peer-as = 65000 184 send-software-version = true 185 [[peer-groups.afi-safis]] 186 [peer-groups.afi-safis.config] 187 afi-safi-name = "ipv4-unicast" 188 189 [[dynamic-neighbors]] 190 [dynamic-neighbors.config] 191 prefix = "20.0.0.0/24" 192 peer-group = "my-peer-group" 193 194 [[defined-sets.prefix-sets]] 195 prefix-set-name = "ps0" 196 [[defined-sets.prefix-sets.prefix-list]] 197 ip-prefix = "10.0.0.0/8" 198 masklength-range = "24..32" 199 [[defined-sets.neighbor-sets]] 200 neighbor-set-name = "ns0" 201 neighbor-info-list = ["192.168.10.2", "172.13.0.0/24"] 202 [[defined-sets.bgp-defined-sets.community-sets]] 203 community-set-name = "cs0" 204 community-list = ["100:100"] 205 [[defined-sets.bgp-defined-sets.ext-community-sets]] 206 ext-community-set-name = "es0" 207 ext-community-list = ["rt:100:100", "soo:200:200"] 208 [[defined-sets.bgp-defined-sets.as-path-sets]] 209 as-path-set-name = "as0" 210 as-path-list = ["^100", "200$"] 211 [[defined-sets.bgp-defined-sets.large-community-sets]] 212 large-community-set-name = "ls0" 213 large-community-list = ["100:100:100", "200:200:200"] 214 215 [[policy-definitions]] 216 name = "policy1" 217 [[policy-definitions.statements]] 218 [policy-definitions.statements.conditions.match-prefix-set] 219 prefix-set = "ps0" 220 match-set-options = "any" 221 [policy-definitions.statements.conditions.match-neighbor-set] 222 neighbor-set = "ns0" 223 match-set-options = "invert" 224 [policy-definitions.statements.conditions.bgp-conditions.match-community-set] 225 community-set = "cs0" 226 match-set-options = "all" 227 [policy-definitions.statements.conditions.bgp-conditions.match-large-community-set] 228 large-community-set = "ls0" 229 match-set-options = "all" 230 [policy-definitions.statements.actions.bgp-actions.set-as-path-prepend] 231 as = "last-as" 232 repeat-n = 5 233 [policy-definitions.statements.actions] 234 route-disposition = "accept-route" 235 [[policy-definitions.statements]] 236 [policy-definitions.statements.conditions.bgp-conditions.match-ext-community-set] 237 ext-community-set = "es0" 238 [policy-definitions.statements.actions] 239 route-disposition = "reject-route" 240 241 [[policy-definitions]] 242 name = "policy2" 243 [[policy-definitions.statements]] 244 [policy-definitions.statements.conditions.bgp-conditions.match-as-path-set] 245 as-path-set = "as0" 246 [policy-definitions.statements.actions] 247 route-disposition = "accept-route" 248 [policy-definitions.statements.actions.bgp-actions.set-community] 249 options = "add" 250 [policy-definitions.statements.actions.bgp-actions.set-community.set-community-method] 251 communities-list = ["100:200"] 252 253 [[policy-definitions]] 254 name = "policy3" 255 [[policy-definitions.statements]] 256 [policy-definitions.statements.conditions.bgp-conditions.match-as-path-set] 257 as-path-set = "as0" 258 [policy-definitions.statements.actions] 259 route-disposition = "accept-route" 260 [policy-definitions.statements.actions.bgp-actions.set-community] 261 options = "add" 262 [policy-definitions.statements.actions.bgp-actions.set-community.set-community-method] 263 communities-list = ["100:200"] 264 [[policy-definitions.statements]] 265 [policy-definitions.statements.conditions.match-prefix-set] 266 prefix-set = "ps0" 267 match-set-options = "invert" 268 [policy-definitions.statements.actions] 269 route-disposition = "accept-route" 270 [policy-definitions.statements.actions.bgp-actions.set-ext-community] 271 options = "replace" 272 [policy-definitions.statements.actions.bgp-actions.set-ext-community.set-ext-community-method] 273 communities-list = ["soo:100:200", "rt:300:400"] 274 [[policy-definitions.statements]] 275 [policy-definitions.statements.conditions.match-neighbor-set] 276 neighbor-set = "ns0" 277 [policy-definitions.statements.actions] 278 route-disposition = "accept-route" 279 [policy-definitions.statements.actions.bgp-actions.set-ext-community] 280 options = "remove" 281 [policy-definitions.statements.actions.bgp-actions.set-ext-community.set-ext-community-method] 282 communities-list = ["soo:500:600", "rt:700:800"] 283 [[policy-definitions.statements]] 284 [policy-definitions.statements.conditions.bgp-conditions] 285 next-hop-in-list = [ 286 "10.0.100.1/32" 287 ] 288 [policy-definitions.statements.actions] 289 route-disposition = "accept-route" 290 291 [[policy-definitions]] 292 name = "route-type-policy" 293 [[policy-definitions.statements]] 294 # this statement matches with locally generated routes 295 [policy-definitions.statements.conditions.bgp-conditions] 296 route-type = "local" 297 [policy-definitions.statements.actions] 298 route-disposition = "accept-route" 299 [[policy-definitions.statements]] 300 # this statement matches with routes from iBGP peers 301 [policy-definitions.statements.conditions.bgp-conditions] 302 route-type = "internal" 303 [policy-definitions.statements.actions] 304 route-disposition = "accept-route" 305 [[policy-definitions.statements]] 306 # this statement matches with routes from eBGP peers 307 [policy-definitions.statements.conditions.bgp-conditions] 308 route-type = "external" 309 [policy-definitions.statements.actions] 310 route-disposition = "accept-route" 311 312 [[policy-definitions]] 313 name = "large-communty-policy" 314 [[policy-definitions.statements]] 315 # this statement adds specified large communities 316 [policy-definitions.statements.actions] 317 route-disposition = "accept-route" 318 [policy-definitions.statements.actions.bgp-actions.set-large-community] 319 options = "add" 320 [policy-definitions.statements.actions.bgp-actions.set-large-community.set-large-community-method] 321 communities-list = ["100:200:300"] 322 [[policy-definitions.statements]] 323 # this statement adds specified large communities 324 [policy-definitions.statements.actions] 325 route-disposition = "accept-route" 326 [policy-definitions.statements.actions.bgp-actions.set-large-community] 327 options = "replace" 328 [policy-definitions.statements.actions.bgp-actions.set-large-community.set-large-community-method] 329 communities-list = ["100:200:300"] 330 [[policy-definitions.statements]] 331 # this statement removes specified large communities 332 # regular expression is also supported 333 [policy-definitions.statements.actions] 334 route-disposition = "accept-route" 335 [policy-definitions.statements.actions.bgp-actions.set-large-community] 336 options = "remove" 337 [policy-definitions.statements.actions.bgp-actions.set-large-community.set-large-community-method] 338 communities-list = ["100:200:300", "^200:"] 339 ```