Version 1.13. This version is no longer supported. For information about how to upgrade to version 1.14, seeUpgrading Anthos on bare metalin the 1.14 documentation. For more information about supported and unsupported versions, see theVersion historypage in the latest documentation.
This document describes how to implement a flat-mode network model with Border
Gateway Protocol (BGP) support. When you implement a network model with BGP
support, BGP dynamically ensures that pods in different L2 domains can
communicate with each other.
How to implement a flat-mode network that uses BGP
To implement a cluster on a flat-mode network model with BGP support, make
the following changes to the cluster'scluster.yamlfile:
Set thespec.clusterNetwork.advancedNetworkingfield totruein the cluster
resource.
Set thespec.clusterNetwork.flatIPv4field totruein the cluster resource.
Whenspec.clusterNetwork.flatIPv4is set totrue, the fieldspec.clusterNetwork.pods.cidrBlocksis ignored and can be omitted. However,
you will need to define aClusterCIDRConfigssection in the yaml file
(per-node, per-nodepool and/or per-cluster). See the examplecluster.yamlfile below for details.
Append aNetworkGatewayGroupresource to thecluster.yamlfile and specify the floating IPs to use for
BGP peering. Ensure that the name isdefaultand the namespace is the
cluster namespace.
AppendFlatIPModeandBGPPeerresources to thecluster.yamlfile. The
name of theFlatIPModeresource must bedefault, and all resources must be
in the cluster namespace.
For Preview, only IPv4 BGP Peers and sessions are supported. However, if your
environment supports Multiprotocol BGP (MP-BGP), IPv4 and IPv6 routes can be
advertised over these IPv4 sessions. IPv6 BGP Peer configuration isn't
supported.
The following excerpt of acluster.yamlfile shows how to implement flat-mode
networking with BGP support. Note that the IP addresses that appear in this
excerpt are only examples and you will need to replace them with your own IP
addresses:
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[[["\u003cp\u003eThis document outlines how to implement a flat-mode network model with Border Gateway Protocol (BGP) support, enabling communication between pods in different L2 domains.\u003c/p\u003e\n"],["\u003cp\u003eImplementing a flat-mode network with BGP requires setting \u003ccode\u003espec.clusterNetwork.advancedNetworking\u003c/code\u003e and \u003ccode\u003espec.clusterNetwork.flatIPv4\u003c/code\u003e to \u003ccode\u003etrue\u003c/code\u003e in the cluster's \u003ccode\u003ecluster.yaml\u003c/code\u003e file.\u003c/p\u003e\n"],["\u003cp\u003eWhen \u003ccode\u003eflatIPv4\u003c/code\u003e is enabled, define \u003ccode\u003eClusterCIDRConfigs\u003c/code\u003e instead of \u003ccode\u003epods.cidrBlocks\u003c/code\u003e, and include a \u003ccode\u003eNetworkGatewayGroup\u003c/code\u003e resource to specify floating IPs for BGP peering.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ecluster.yaml\u003c/code\u003e file must also include \u003ccode\u003eFlatIPMode\u003c/code\u003e and \u003ccode\u003eBGPPeer\u003c/code\u003e resources, with the \u003ccode\u003eFlatIPMode\u003c/code\u003e resource named \u003ccode\u003edefault\u003c/code\u003e, and both must reside in the cluster namespace.\u003c/p\u003e\n"],["\u003cp\u003eFor Preview, only IPv4 BGP Peers and sessions are supported, although environments with Multiprotocol BGP (MP-BGP) can advertise both IPv4 and IPv6 routes over these IPv4 sessions.\u003c/p\u003e\n"]]],[],null,["# Implement flat-mode network model with BGP support\n\n\u003cbr /\u003e\n\nThis document describes how to implement a flat-mode network model with Border\nGateway Protocol (BGP) support. When you implement a network model with BGP\nsupport, BGP dynamically ensures that pods in different L2 domains can\ncommunicate with each other.\n\nFor more information about flat-mode network models, see\n[Flat vs island mode network models](/anthos/clusters/docs/bare-metal/1.13/reference/flat-vs-island-network).\n\nHow to implement a flat-mode network that uses BGP\n--------------------------------------------------\n\nTo implement a cluster on a flat-mode network model with BGP support, make\nthe following changes to the cluster's `cluster.yaml` file:\n\n- Set the `spec.clusterNetwork.advancedNetworking` field to `true` in the cluster resource.\n- Set the `spec.clusterNetwork.flatIPv4` field to `true` in the cluster resource.\n- When `spec.clusterNetwork.flatIPv4`is set to `true`, the field `spec.clusterNetwork.pods.cidrBlocks` is ignored and can be omitted. However, you will need to define a `ClusterCIDRConfigs` section in the yaml file (per-node, per-nodepool and/or per-cluster). See the example `cluster.yaml` file below for details.\n- Append a [`NetworkGatewayGroup`](/anthos/clusters/docs/bare-metal/1.13/how-to/egress-nat#configure_floating_ip_addresses_for_node_traffic) resource to the `cluster.yaml` file and specify the floating IPs to use for BGP peering. Ensure that the name is `default` and the namespace is the cluster namespace.\n- Append `FlatIPMode` and `BGPPeer` resources to the `cluster.yaml` file. The name of the `FlatIPMode` resource must be `default`, and all resources must be in the cluster namespace.\n\nFor Preview, only IPv4 BGP Peers and sessions are supported. However, if your\nenvironment supports Multiprotocol BGP (MP-BGP), IPv4 and IPv6 routes can be\nadvertised over these IPv4 sessions. IPv6 BGP Peer configuration isn't\nsupported.\n\nThe following excerpt of a `cluster.yaml` file shows how to implement flat-mode\nnetworking with BGP support. Note that the IP addresses that appear in this\nexcerpt are only examples and you will need to replace them with your own IP\naddresses: \n\n\n apiVersion: baremetal.cluster.gke.io/v1\n kind: Cluster\n metadata:\n name: bm\n namespace: cluster-bm\n spec:\n\n ...\n\n clusterNetwork:\n advancedNetworking: true\n flatIPv4: true\n\n ... (other cluster config omitted)\n\n apiVersion: networking.gke.io/v1\n kind: NetworkGatewayGroup\n metadata:\n name: default\n namespace: cluster-bm\n spec:\n floatingIPs:\n - 10.0.1.100\n - 10.0.2.100\n\n ....\n\n apiVersion: baremetal.cluster.gke.io/v1alpha1\n kind: FlatIPMode\n metadata:\n name: default\n namespace: cluster-bm\n spec:\n enableBGPIPv4: true\n enableBGPIPv6: false\n peerSelector:\n flatip-peer: \"true\"\n\n ....\n\n apiVersion: networking.gke.io/v1\n kind: BGPPeer\n metadata:\n name: bgppeer1\n namespace: cluster-bm\n labels:\n flatip-peer: \"true\"\n spec:\n localASN: 65001\n peerASN: 65000\n peerIP: 10.0.1.254\n sessions: 2\n\n ....\n\n apiVersion: networking.gke.io/v1\n kind: BGPPeer\n metadata:\n name: bgppeer2\n namespace: cluster-bm\n labels:\n flatip-peer: \"true\"\n spec:\n localASN: 65001\n peerASN: 65000\n peerIP: 10.0.2.254\n sessions: 2\n\n ....\n\n apiVersion: baremetal.cluster.gke.io/v1alpha1\n kind: ClusterCIDRConfig\n metadata:\n name: cluster-wide-1\n namespace: cluster-bm\n spec:\n ipv4:\n cidr: \"192.168.0.0/16\"\n perNodeMaskSize: 24"]]