Version 1.11. This version is no longer supported. For information about how to upgrade to version 1.12, seeUpgrading Anthos on bare metalin the 1.12 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 is not
supported in version 1.11.0 of Google Distributed Cloud.
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 the implementation of 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, ignoring the \u003ccode\u003espec.clusterNetwork.pods.cidrBlocks\u003c/code\u003e field, and defining a \u003ccode\u003eClusterCIDRConfigs\u003c/code\u003e section.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ecluster.yaml\u003c/code\u003e file needs to include a \u003ccode\u003eNetworkGatewayGroup\u003c/code\u003e resource specifying floating IPs for BGP peering, and \u003ccode\u003eFlatIPMode\u003c/code\u003e and \u003ccode\u003eBGPPeer\u003c/code\u003e resources in the cluster namespace.\u003c/p\u003e\n"],["\u003cp\u003eIn this Preview version, only IPv4 BGP Peers and sessions are supported, although IPv4 and IPv6 routes can be advertised over IPv4 sessions if the environment supports Multiprotocol BGP (MP-BGP), and configuring IPv6 BGP Peers is not supported.\u003c/p\u003e\n"],["\u003cp\u003ePre-GA products and features such as this flat-mode network model with BGP are available "as is" and might have limited support, as per the Pre-GA Offerings Terms.\u003c/p\u003e\n"]]],[],null,["# Implement flat-mode network model with BGP support\n\n\u003cbr /\u003e\n\n|\n| **Preview**\n|\n|\n| This product or feature is subject to the \"Pre-GA Offerings Terms\" in the General Service Terms section\n| of the [Service Specific Terms](/terms/service-terms#1).\n|\n| Pre-GA products and features are available \"as is\" and might have limited support.\n|\n| For more information, see the\n| [launch stage descriptions](/products#product-launch-stages).\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.11/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.11/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 is not\nsupported in version 1.11.0 of Google Distributed Cloud.\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"]]