Configure multiprotocol BGP for IPv4 or IPv6 BGP sessions
Cloud Router lets you enable and disable IPv4 or IPv6 route exchange inindividual Border Gateway Protocol (BGP) sessions that use multiprotocol BGP(MP-BGP). With MP-BGP, you can exchange IPv6 routes over an IPv4 BGP session orIPv4 routes over an IPv6 BGP session.
To exchange both IPv4 and IPv6 traffic in a single BGP session, you must selectthe IPv4 and IPv6 (dual stack) stack type in your Network Connectivityproduct, such as HA VPN orDedicated Interconnect.
You can enable or disable IPv4 or IPv6 route exchange in a specific BGP sessionby modifying the configuration of the BGP peer. Disabling IPv4 or IPv6 routeexchange is useful if you need to troubleshoot IPv4- or IPv6-specific networkissues. Another reason might be that you want to disable traffic temporarily ina dual-stack HA VPN tunnel without deleting the tunneland gateway.
If you disable IPv4 or IPv6 route exchange in a BGP session and then laterre-enable it, IPv4 or IPv6 next hop addresses that were previously assignedare not relinquished. You can reuse those IPv4 or IPv6 next hop addresses ifIPv4 or IPv6 is enabled in the BGP session again.
Before you begin
gcloud
If you want to use the command-line examples in this guide, do the following:
- Install or update to the latest version of theGoogle Cloud CLI.
- Set adefault region andzone.
API
If you want to use the API examples in this guide, set upAPI access.
Configure an IPv4 BGP session
This section describes how to modify the configuration of an IPv4BGP session.
You cannot disable IPv4 route exchange in an IPv4 BGP session.
Enable IPv6 route exchange over an IPv4 session
This procedure assumes that you are modifying IPv4 BGP sessions that havealready been created for HA VPN tunnels or VLAN attachments forCloud Interconnect.
It also assumes that you have configured the associated HA VPNgateway or VLAN attachment to use the IPv4 and IPv6 (dual stack) stack type asdescribed in the following procedures:
- Create an HA VPN to a peer VPN gateway
- Create HA VPN gateways to connect VPC networks
- Create VLAN attachments Dedicated Interconnect
To enable IPv6 route exchange in an existing IPv4 BGP session, perform thefollowing steps.
Console
For HA VPN
To configure a BGP session for HA VPN,in the Google Cloud console, go to theCloud VPN tunnels page.
Select the Cloud VPN tunnel that contains theBGP session to update.
On theVPN tunnel details page, clickEdit BGP session.
In theMultiprotocol BGP section, click theEnable IPv6 traffictoggle to the on position.
Optional: You can allocate the IPv6 BGP addresses forHA VPN tunnels manually or automatically.
- To allocate the addresses automatically, selectAutomatically.
- To allocate the addresses manually:
- Enter the IPv6 address for theCloud Router BGP IPv6 next hopfield. This address is an IPv6 address used byCloud Router for this Cloud VPN tunnel. ThisIPv6 address is advertised as the next hop for the IPv6 routesthat Cloud Router advertises to its BGP peer. Theaddress must be in the range
2600:2d00:0:2::/63. - Enter the IPv6 address for thePeer BGP IPv6 next hop field.This address is the IPv6 address of the on-premises router orpeer VPN device. This IPv6 address is the next hop for the IPv6routes learned from the BGP peer of Cloud Router. Theaddress must be in the range
2600:2d00:0:2::/63.
- Enter the IPv6 address for theCloud Router BGP IPv6 next hopfield. This address is an IPv6 address used byCloud Router for this Cloud VPN tunnel. ThisIPv6 address is advertised as the next hop for the IPv6 routesthat Cloud Router advertises to its BGP peer. Theaddress must be in the range
ClickSave and continue.
For Dedicated Interconnect
To configure a BGP session for Dedicated Interconnect,go to theVLAN attachments page.
Select the VLAN attachment that contains the BGP session to update.
On theVLAN attachment details page,clickEdit BGP session.
In theMultiprotocol BGP section, click theEnable IPv6 traffictoggle to the on position.
ClickSave and continue.
gcloud
Run theupdate-bgp-peer command. Use the--enable-ipv6 flagto allow the BGP session to exchange IPv6 routes, as shown in the followingexample:
gcloud compute routers update-bgp-peerROUTER_NAME \ --peer-name=PEER_NAME \ --enable-ipv6
Optionally, when you enable IPv6 traffic for a BGP session used in anHA VPN tunnel, you can specify IPv6 nexthop addresses:
gcloud compute routers update-bgp-peerROUTER_NAME \ --peer-name=PEER_NAME \ --enable-ipv6 \ --ipv6-nexthop-address=IPV6_NEXTHOP_ADDRESS \ --peer-ipv6-nexthop-address=PEER_IPV6_NEXTHOP_ADDRESS
Replace the following:
IPV6_NEXTHOP_ADDRESS: the IPv6 address used byCloud Router for this Cloud VPN tunnel. This IPv6address is advertised as the next hop for the IPv6 routes thatCloud Router advertises to its BGP peer.The address must be in the IPv6 range
2600:2d00:0:2::/63.PEER_IPV6_NEXTHOP_ADDRESS: the IPv6 address of theon-premises router. This IPv6 address is the next hop for the IPv6 routeslearned from the BGP peer of the Cloud Router. The address mustbe in the range2600:2d00:0:2::/63.
If you don't specify the next hop addresses, Google Cloud automaticallyassigns unused addresses from the2600:2d00:0:2::/63IPv6 range for you.
API
Use therouters.patch methodto update thebgpPeers[] field.
ThebgpPeers[] field accepts an array of BGP peers. When youPATCH thisfield, you overwrite the existing array of BGP peers with the new arrayincluded in your request.
Send a
GETrequest to get the current array of BGP peers for the router.For details, seeView BGP session configuration.Send a
PATCHrequest with a new array of BGP peers. For each BGP peer forwhich you want to enable IPv6 in the BGP session,setbgpPeers[].enableIpv6toTRUE.PATCH https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/regions/REGION/routers/ROUTER_NAME{ "bgpPeers": [BGP_PEERS ]}Replace the following:
PROJECT_ID: the project that contains theCloud RouterREGION: the region where the Cloud Routeris locatedROUTER_NAME: the name of the Cloud RouterBGP_PEERS: the contents of the new array of BGPpeers
The following example enables IPv6 in the session for the first BGP peer:
{"name":"peer-1","interfaceName":"if-peer-1","ipAddress":"169.254.10.1","peerIpAddress":"169.254.10.2","peerAsn":64512,"advertisedRoutePriority":100,"advertiseMode":"DEFAULT","advertisedGroups":[],"advertisedIpRanges":[],"enable":"TRUE","enableIpv6":true},{"name":"peer-2","interfaceName":"if-peer-2","ipAddress":"169.254.20.1","peerIpAddress":"169.254.20.2","peerAsn":64513,"advertisedRoutePriority":100,"advertiseMode":"DEFAULT","advertisedGroups":[],"advertisedIpRanges":[],"enable":"TRUE","enableIpv6":false"}
Additionally, if you are enabling IPv6 traffic for a BGP sessionused in an HA VPN tunnel, you can specify IPv6 nexthop addresses:
{"name":"peer-1","interfaceName":"if-peer-1","ipAddress":"169.254.10.1","peerIpAddress":"169.254.10.2","peerAsn":64512,"advertisedRoutePriority":100,"advertiseMode":"DEFAULT","advertisedGroups":[],"advertisedIpRanges":[],"enable":"TRUE","enableIpv6":true,"ipv6NexthopAddress":"2600:2d00:0:2:0:0:1:5","peerIpv6NexthopAddress":"2600:2d00:0:2:0:0:1:6"},{"name":"peer-2","interfaceName":"if-peer-2","ipAddress":"169.254.20.1","peerIpAddress":"169.254.20.2","peerAsn":64513,"advertisedRoutePriority":100,"advertiseMode":"DEFAULT","advertisedGroups":[],"advertisedIpRanges":[],"enable":"TRUE","enableIpv6":false}
Use the values of
ipv6NexthopAddressandpeerIpv6NexthopAddressto configure your on-premises router or peer VPN device.To view example configurations for HA VPN and yourpeer VPN device, seeSet up third-party VPNs for IPv4 and IPv6 traffic.
To view example configurations for Dedicated Interconnectand your on-premises router,seeSet up on-premises routers for IPv4 and IPv6 traffic.
Disable IPv6 route exchange over an IPv4 BGP session
This procedure assumes that you are modifying an existing IPv4 BGP session thatpreviously enabled IPv6.
Console
For HA VPN
In the Google Cloud console, go to theCloud VPN tunnels page.
Select the Cloud VPN tunnel that contains the BGP session toupdate.
On theVPN tunnel details page, clickEdit BGP session.
To disable IPv6 route exchange, click theEnable IPv6 traffic toggleto the off position.
ClickSave and continue.
For Dedicated Interconnect
In the Google Cloud console, go to theVLAN attachments page.
Select the VLAN attachment that contains the BGP session to update.
On theVLAN attachment details page, clickEdit BGP session.
To disable IPv6 route exchange, click theEnable IPv6 traffic toggleto the off position.
ClickSave and continue.
gcloud
Run the update-bgp-peer command. Use the --no-enable-ipv6 flag toprevent the BGP session from exchanging IPv6 routes, as shownin the following example:
gcloud compute routers update-bgp-peerROUTER_NAME \--peer-name=PEER_NAME \--no-enable-ipv6
API
Use therouters.patch methodto update thebgpPeers[] field.
ThebgpPeers[] field accepts an array of BGP peers. When youPATCH thisfield, you overwrite the existing array of BGP peers with the new arrayincluded in your request.
Send a
GETrequest to get the current array of BGP peers for the router.For details, seeView BGP session configuration.Send a
PATCHrequest with a new array of BGP peers. For each BGP peer forwhich you want to disable IPv6 in the BGP session, setbgpPeers[].enableIpv6toFALSE.PATCH https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/regions/REGION/routers/ROUTER_NAME{ "bgpPeers": [BGP_PEERS ]}Replace the following:
PROJECT_ID: the project that contains theCloud RouterREGION: the region where the Cloud Routeris locatedROUTER_NAME: the name of the Cloud RouterBGP_PEERS: the contents of the new array of BGPpeers
The following example disables IPv6 in the session for the first BGP peer:
{"name":"peer-1","interfaceName":"if-peer-1","ipAddress":"169.254.10.1","peerIpAddress":"169.254.10.2","peerAsn":64512,"advertisedRoutePriority":100,"advertiseMode":"DEFAULT","advertisedGroups":[],"advertisedIpRanges":[],"enable":"TRUE","enableIpv6":false},{"name":"peer-2","interfaceName":"if-peer-2","ipAddress":"169.254.20.1","peerIpAddress":"169.254.20.2","peerAsn":64513,"advertisedRoutePriority":100,"advertiseMode":"DEFAULT","advertisedGroups":[],"advertisedIpRanges":[],"enable":"TRUE","enableIpv6":false}
Configure an IPv6 BGP session
This section describes how to modify the configuration of an IPv6BGP session.
You cannot disable IPv6 route exchange in an IPv6 BGP session.
Enable IPv4 route exchange over an IPv6 BGP session
This procedure assumes that you are modifying IPv6 BGP sessions that havealready been created for HA VPN tunnels or VLAN attachments.
It also assumes that you have already configured an IPv4 and IPv6 (dual stack)HA VPN gateway or VLAN attachment as describedin the following procedures:
- Create an HA VPN to a peer VPN gateway
- Create HA VPN gateways to connect VPC networks
- Create VLAN attachments (Dedicated Interconnect)
To enable IPv4 route exchange in an existing IPv6 BGP session, perform thefollowing steps.
Console
For HA VPN
To configure a BGP session for HA VPN,in the Google Cloud console, go to theCloud VPN tunnels page.
Select the Cloud VPN tunnel that contains the BGP session toupdate.
On theVPN tunnel details page, clickEdit BGP sessions.
In theMultiprotocol BGP section, click theEnable IPv4 traffictoggle to the on position.
Optional: You can allocate the IPv6 BGP addresses forHA VPN tunnels manually or automatically.
- To allocate the addresses automatically, selectAutomatically.
- To allocate the addresses manually:
- SelectManually.
- Enter the IPv6 address for theCloud Router BGP IPv6 addressfield. This address is an IPv6 address used byCloud Router for this Cloud VPN tunnel. ThisIPv6 address is advertised as the next hop for the IPv6 routesthat Cloud Router advertises to its BGP peer. Theaddress must be in the range
2600:2d00:0:2::/63. - Enter the IPv6 address for theBGP peer IPv6 address field.This address is the IPv6 address of the on-premises router orpeer VPN device. This IPv6 address is the next hop for the IPv6routes learned from the BGP peer of Cloud Router. Theaddress must be in the range
2600:2d00:0:2::/63.
Optional: You can allocate the Cloud Router BGP IPv4 next hopaddresses for HA VPN tunnels manually orautomatically.
- To allocate the addresses automatically, selectAutomatically.
- To allocate the addresses manually:
- SelectManually.
- Enter the IPv4 address for theCloud Router BGP IPv4 nexthop field. This address is an IPv4 address used byCloud Router for this Cloud VPN tunnel. ThisIPv4 address is advertised as the next hop for the IPv4 routesthat Cloud Router advertises to its BGP peer. Theaddress must be a link-local address within the same
/30subnetas the BGP peer IPv4 address. - Enter the IPv4 address for thePeer BGP IPv4 next hop field.This address is the IPv4 address of the on-premises router orpeer VPN device. This IPv4 address is the next hop for the IPv6routes learned from the BGP peer of Cloud Router. Theaddress must be a link-local address within the same
/30subnetas the Cloud Router BGP IPv4 address.
ClickSave and continue.
For Dedicated Interconnect
To configure a BGP session for Dedicated Interconnect,go to theVLAN attachments page.
Select the VLAN attachment that contains the BGP session to update.
On theVLAN attachment details page, clickEdit BGP session.
In theMultiprotocol BGP section, click theEnable IPv4 traffictoggle to the on position.
ClickSave and continue.
gcloud
Run theupdate-bgp-peer command. Use the--enable-ipv4 flagto allow the BGP session to exchange IPv4 routes, as shown in the followingexample:
gcloud compute routers update-bgp-peerROUTER_NAME \ --peer-name=PEER_NAME \ --enable-ipv4
Optionally, when you enable IPv4 traffic for an IPv6 BGP session used in anHA VPN tunnel, you can specify the IPv4 nexthop addresses:
gcloud compute routers update-bgp-peerROUTER_NAME \ --peer-name=PEER_NAME \ --enable-ipv4 \ --ipv4-nexthop-address=IPV4_NEXTHOP_ADDRESS \ --peer-ipv4-nexthop-address=PEER_IPV4_NEXTHOP_ADDRESS
Replace the following:
IPV4_NEXTHOP_ADDRESS: the IPv4 address used byCloud Router for this HA VPN tunnel.This IPv4 address is advertised as the next hop for the IPv4 routes thatCloud Router advertises to its BGP peer. The address must be inthe IPv4 link-local range169.254.0.0/16.PEER_IPV4_NEXTHOP_ADDRESS: the IPv4 address of theon-premises router. This IPv4 address is the next hop for the IPv4 routeslearned from the BGP peer of Cloud Router. The address must bein the IPv4 link-local range169.254.0.0/16.If you don't specify the next-hop addresses, Google Cloud automaticallyassigns unused addresses from the IPv4 link-local
169.254.0.0/16range for you.
API
Use therouters.patch methodto update thebgpPeers[] field.
ThebgpPeers[] field accepts an array of BGP peers. When youPATCH thisfield, you overwrite the existing array of BGP peers with the new arrayincluded in your request.
Send a
GETrequest to get the current array of BGP peers for the router.For details, seeView BGP session configuration.Send a
PATCHrequest with a new array of BGP peers. For each BGP peer forwhich you want to enable IPv4 in the BGP session,setbgpPeers[].enableIpv4toTRUE.PATCH https://compute.googleapis.com/compute/projects/PROJECT_ID/regions/REGION/routers/ROUTER_NAME{ "bgpPeers": [BGP_PEERS ]}Replace the following:
PROJECT_ID: the project that contains theCloud RouterREGION: the region where the Cloud Routeris locatedROUTER_NAME: the name of the Cloud RouterBGP_PEERS: the contents of the new array of BGPpeers
The following example enables IPv4 in the session for the first BGP peer:
{"name":"peer-1","interfaceName":"if-peer-1","ipAddress":"fdff:1::1","peerIpAddress":"fdff:1::2","peerAsn":64512,"advertisedRoutePriority":100,"advertiseMode":"DEFAULT","advertisedGroups":[],"advertisedIpRanges":[],"enable":"TRUE","enableIpv4":true},{"name":"peer-2","interfaceName":"if-peer-2","ipAddress":"fdff:1::3","peerIpAddress":"fdff:1::4","peerAsn":64513,"advertisedRoutePriority":100,"advertiseMode":"DEFAULT","advertisedGroups":[],"advertisedIpRanges":[],"enable":"TRUE","enableIpv4":false}
Additionally, if you are enabling IPv4 traffic for a BGP sessionused in an HA VPN tunnel, you can specify IPv4 nexthop addresses:
{"name":"peer-1","interfaceName":"if-peer-1","ipAddress":"fdff:1::1","peerIpAddress":"fdff:1::2","peerAsn":64512,"advertisedRoutePriority":100,"advertiseMode":"DEFAULT","advertisedGroups":[],"advertisedIpRanges":[],"enable":"TRUE","enableIpv4":true,"ipv4NexthopAddress":"169.254.0.1","peerIpv4NexthopAddress":"169.254.0.2"},{"name":"peer-2","interfaceName":"if-peer-2","ipAddress":"fdff:1::3","peerIpAddress":"fdff:1::4","peerAsn":64513,"advertisedRoutePriority":100,"advertiseMode":"DEFAULT","advertisedGroups":[],"advertisedIpRanges":[],"enable":"TRUE","enableIpv4":false}
Disable IPv4 route exchange over an IPv6 BGP session
This procedure assumes that you are modifying an existing IPv6 BGP sessionthat previously exchanged IPv4 routes.
Console
For HA VPN
In the Google Cloud console, go to theCloud VPN tunnels page.
Select the Cloud VPN tunnel that contains the BGP session toupdate.
On theVPN tunnel details page, clickEdit BGP session.
In theMultiprotocol BGP section, click theEnable IPv4 traffictoggle to the off position.
ClickSave and continue.
For Dedicated Interconnect
In the Google Cloud console, go to theVLAN attachments page.
Select the VLAN attachment that contains the BGP session to update.
On theVLAN attachment details page, clickEdit BGP sessions.
In theMultiprotocol BGP section, click theEnable IPv4 traffictoggle to the off position.
ClickSave and continue.
gcloud
Run theupdate-bgp-peer command. Use the--no-enable-ipv4 flag toprevent the IPv6 BGP session from exchanging IPv4 routes, as shownin the following example:
gcloud compute routers update-bgp-peerROUTER_NAME \ --peer-name=PEER_NAME \ --no-enable-ipv4
API
Use therouters.patch methodto update thebgpPeers[] field.
ThebgpPeers[] field accepts an array of BGP peers. When youPATCH thisfield, you overwrite the existing array of BGP peers with the new arrayincluded in your request.
Send a
GETrequest to get the current array of BGP peers for the router.For details, seeView BGP session configuration.Send a
PATCHrequest with a new array of BGP peers. For each BGP peer forwhich you want to disable IPv4 in the BGP session, setbgpPeers[].enableIpv4toFALSE.PATCH https://compute.googleapis.com/compute/projects/PROJECT_ID/regions/REGION/routers/ROUTER_NAME{ "bgpPeers": [BGP_PEERS ]}Replace the following:
PROJECT_ID: the project that contains theCloud RouterREGION: the region where the Cloud Routeris locatedROUTER_NAME: the name of the Cloud RouterBGP_PEERS: the contents of the new array of BGPpeers
The following example disables IPv4 in the session for the first BGP peer:
{"name":"peer-1","interfaceName":"if-peer-1","ipAddress":"fdff:1::1","peerIpAddress":"fdff:1::2","peerAsn":64512,"advertisedRoutePriority":100,"advertiseMode":"DEFAULT","advertisedGroups":[],"advertisedIpRanges":[],"enable":"TRUE","enableIpv4":false},{"name":"peer-2","interfaceName":"if-peer-2","ipAddress":"fdff:1::3","peerIpAddress":"fdff:1::4","peerAsn":64513,"advertisedRoutePriority":100,"advertiseMode":"DEFAULT","advertisedGroups":[],"advertisedIpRanges":[],"enable":"TRUE","enableIpv4":false}
Separate an existing IPv4 MP-BGP session to use IPv4 and IPv6 BGP sessions
Existing Cloud Router IPv4 MP-BGP sessions use IPv4 control packets even whenexchanging routing information about IPv6 BGP prefixes. IPv6-based BGP sessionsare supported in networks with dual-stack subnets or with a mix of IPv4-only andIPv6-only subnets. This section describes how to modify an existing IPv4 MP-BGPsession to use separate IPv4 and IPv6 BGP sessions.
Console
For HA VPN
To configure a BGP session for HA VPN,in the Google Cloud console, go to theCloud VPN tunnels page.
Find the Cloud VPN tunnel that contains theBGP session to update.
On theVPN tunnel details page, clickEdit BGP sessions.
Select a BGP session type. To enable route exchange for IPv4 and IPv6selectBoth.
Optional: You can allocate the BGP IPv4 addresses forHA VPN tunnels manually or automatically.
- To allocate the addresses automatically, selectAutomatically.
- To allocate the addresses manually:
- SelectManually.
- Enter the IPv4 address for theCloud Router BGP IPv4 address.This address is an IPv4 address used by Cloud Routerfor this Cloud VPN tunnel. This IPv4 address isadvertised as the next hop for the IPv4 routes thatCloud Router advertises to its BGP peer.The address must be a link-local address within the same
/30subnet as the BGP peer IPv4 address. - Enter the IPv4 address for theBGP peer IPv4 address.This address is the IPv4 address of the on-premises router or peerVPN device. This IPv4 address is the next hop for the IPv6 routeslearned from the BGP peer of Cloud Router.The address must be a link-local address within the same
/30subnet as the Cloud Router BGP IPv4 address.
Optional: You can allocate the BGP IPv6 addresses forHA VPN tunnels manually or automatically.
- To allocate the addresses automatically, selectAutomatically.
- To allocate the addresses manually:
- SelectManually.
- Enter the IPv6 address for theCloud Router BGP IPv6 address.This address is an IPv6 address used by Cloud Routerfor this Cloud VPN tunnel. This IPv6 address isadvertised as the next hop for the IPv6 routes thatCloud Router advertises to its BGP peer.The address must be in the range
fdff:1::/64. - Enter the IPv6 address for theBGP peer IPv6 address. Thisaddress is the IPv6 address of the on-premises router or peer VPNdevice. This IPv6 address is the next hop for the IPv6 routeslearned from the BGP peer of Cloud Router. The addressmust be in the range
fdff:1::/64.
ClickSave and continue.
For Dedicated Interconnect
To configure a BGP session for Dedicated Interconnect,go to theVLAN attachments page.
Select the VLAN attachment that contains the BGP session to update.
On theVLAN attachment details page, clickEdit BGP session.
Select a BGP session type. To enable route exchange for IPv4 and IPv6selectBoth.
In theIPv4 BGP session section, enter the ASN value for theon-premises side of the BGP session inPeer ASN.
In theIPv6 BGP session section, enter the ASN value for theon-premises side of the BGP session inPeer ASN.
ClickSave and continue.
gcloud
To avoid a conflict with the new IPv6 BGP, disable IPv6 route exchange onyour existing IPv4 BGP session.
Important: Disabling IPv6 route exchange on your existing IPv4 BGP sessioncauses IPv6 traffic to route away from your VLAN attachment and to backuppaths until IPv6 BGP is established.Run the following command:
gcloudcomputeroutersupdate-bgp-peerROUTER_NAME--peer-name=PEER_NAME\--no-enable-ipv6Replace the following:
ROUTER_NAME: the name of the Cloud RouterPEER_NAME: the name of the BGP peer
Add the new IPv6 interface:
gcloudcomputeroutersadd-interfaceROUTER_NAME\--interface-name=INTERFACE_NAME\--interconnect-attachment=ATTACHMENT_NAME\--ip-version=IPV6Replace the following:
INTERFACE_NAME: the name of the interfaceATTACHMENT_NAME: the name of the VLAN attachment
Add the new IPv6 BGP peer:
gcloudcomputeroutersadd-bgp-peerROUTER_NAME\--peer-name=PEER_NAME\--interface=INTERFACE_NAME\--peer-asn=PEER_ASNReplace the following:
PEER_ASN: the BGP peer's ASN
To configure the on-premises BGP session, get the VLAN attachment's IPv6address:
gcloudcomputeinterconnectsattachmentsdescribeATTACHMENT_NAMEThe output is similar to the following:
adminEnabled:trueedgeAvailabilityDomain:AVAILABILITY_DOMAIN_1bandwidth:BPS_1GcloudRouterIpAddress:169.254.67.201/29cloudRouterIpv6Address:2600:2d00:0:1::1/125creationTimestamp:'2017-12-01T08:31:11.580-08:00'customerRouterIpAddress:169.254.67.202/29customerRouterIpv6Address:2600:2d00:0:1::2/125description:Interconnect for Customer 1id:'7193021941765913888'interconnect:https://www.googleapis.com/compute/projects/partner-project/global/interconnects/lga-2kind:compute#interconnectAttachmentlabelFingerprint:42WmSpB8rSM=name:partner-attachmentpartnerMetadata:interconnectName:New York (2)partnerName:Partner IncportalUrl:https://partner-portal.comregion:https://www.googleapis.com/compute/projects/partner-project/regions/us-central1selfLink:https://www.googleapis.com/compute/projects/partner-project/regions/us-central1/interconnectAttachments/customer-attachmentstackType:IPV4_IPV6state:ACTIVEtype:PARTNERvlanTag8021q:1000The relevant IPv6 addresses are listed under
cloudRouterIPv6AddressandcustomerRouterIpv6Address.
API
Use therouters.patch methodto update thebgpPeers[] field.
ThebgpPeers[] field accepts an array of BGP peers. When youPATCH thisfield, you overwrite the existing array of BGP peers with the new arrayincluded in your request.
Send a
GETrequest to get the current array of BGP peers for the router.For details, seeView BGP session configuration.Send a
PATCHrequest with a new array of BGP peers. For each BGP peer forwhich you want to enable IPv6 in the BGP session,setbgpPeers[].enableIpv6toTRUEandbgpPeers[].enableIpv4toFALSE.PATCH https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/regions/REGION/routers/ROUTER_NAME{ "bgpPeers": [BGP_PEERS ]}Replace the following:
PROJECT_ID: the project that contains theCloud RouterREGION: the region where the Cloud Routeris locatedROUTER_NAME: the name of the Cloud RouterBGP_PEERS: the contents of the new array of BGPpeers
The following example enables IPv6 in the session for the first BGP peer:
{"name":"peer-1","interfaceName":"if-peer-1","ipAddress":"169.254.10.1","peerIpAddress":"169.254.10.2","peerAsn":64512,"advertisedRoutePriority":100,"advertiseMode":"DEFAULT","advertisedGroups":[],"advertisedIpRanges":[],"enable":"TRUE","enableIpv6":true,"enableIpv4":false},{"name":"peer-2","interfaceName":"if-peer-2","ipAddress":"169.254.20.1","peerIpAddress":"169.254.20.2","peerAsn":64513,"advertisedRoutePriority":100,"advertiseMode":"DEFAULT","advertisedGroups":[],"advertisedIpRanges":[],"enable":"TRUE","enableIpv6":false}
Additionally, if you are enabling IPv6 traffic for a BGP session used inan HA VPN tunnel, you can specify IPv6 next hopaddresses:
{"name":"peer-1","interfaceName":"if-peer-1","ipAddress":"169.254.10.1","peerIpAddress":"169.254.10.2","peerAsn":64512,"advertisedRoutePriority":100,"advertiseMode":"DEFAULT","advertisedGroups":[],"advertisedIpRanges":[],"enable":"TRUE","enableIpv6":true,"enableIpv4":false,"ipv6NexthopAddress":"2600:2d00:0:2:0:0:1:5","peerIpv6NexthopAddress":"2600:2d00:0:2:0:0:1:6"},{"name":"peer-2","interfaceName":"if-peer-2","ipAddress":"169.254.20.1","peerIpAddress":"169.254.20.2","peerAsn":64513,"advertisedRoutePriority":100,"advertiseMode":"DEFAULT","advertisedGroups":[],"advertisedIpRanges":[],"enable":"TRUE","enableIpv6":false}
Use the values of
ipv6NexthopAddressandpeerIpv6NexthopAddressto configure your on-premises router or peer VPN device.To view example configurations for HA VPN and your peerVPN device, seeSet up third-party VPNs for IPv4 and IPv6traffic.
To view example configurations for Dedicated Interconnectand your on-premises router, seeSet up on-premises routers for IPv4and IPv6traffic.
Combine separate IPv4 and IPv6 BGP sessions onto a single IPv4 MP-BGP session
You can combine separate IPv4 and IPv6 BGP sessions into a single IPv4 MP-BGPsession. In this case, IPv4 control packets are used to exchange routinginformation for both IPv4 and IPv6 BGP sessions. The following proceduresdescribe how to convert separate IPv4 and IPv6 BGP sessions into a single IPv4MP-BGP session:
Console
For HA VPN
To configure a BGP session for HA VPN,in the Google Cloud console, go to theCloud VPN tunnels page.
Find the Cloud VPN tunnel that contains theBGP session to update.
On theVPN tunnel details page, clickEdit BGP sessions.
Select a BGP session type. To enable route exchange for IPv4 selectIPv4 BGP session.
To enable MP-BGP, in theMultiprotocol BGP section, click theEnable IPv6 traffic toggle to the on position.
Optional: You can allocate the IPv4 BGP addresses forHA VPN tunnels manually or automatically.
- To allocate the addresses automatically, in theAllocate BGP IPv4address section, selectAutomatically.
- To allocate the addresses manually:
- SelectManually.
- Enter the IPv4 address for theCloud Router BGP IPv4 address.This address is an IPv4 address used by Cloud Router forthis Cloud VPN tunnel. This IPv4 address is advertisedas the next hop for the IPv4 routes that Cloud Routeradvertises to its BGP peer. The address must be a link-localaddress within the same
/30subnet as the BGP peer IPv4address. - Enter the IPv4 address for theBGP peer IPv4 address. Thisaddress is the IPv4 address of the on-premises router or peer VPNdevice. This IPv4 address is the next hop for the IPv6 routeslearned from the BGP peer of Cloud Router. The addressmust be a link-local address within the same
/30subnet as theCloud Router BGP IPv4 address.
Optional: You can allocate the IPv6 BGP next hop addresses forHA VPN tunnels manually or automatically.
- To allocate the addresses automatically, in theAllocate BGP IPv6next hop section, selectAutomatically.
- To allocate the addresses manually:
- SelectManually.
- Enter the IPv6 address for theCloud Router BGP IPv6 nexthop. This address is an IPv6 address used byCloud Router for this Cloud VPN tunnel. ThisIPv6 address is advertised as the next hop for the IPv6 routesthat Cloud Router advertises to its BGP peer. Theaddress must be in the range
2600:2d00:0:2::/63. - Enter the IPv6 address for thePeer BGP IPv6 next hop. Thisaddress is the IPv6 address of the on-premises router or peer VPNdevice. This IPv6 address is the next hop for the IPv6 routeslearned from the BGP peer of Cloud Router. The addressmust be in the range
2600:2d00:0:2::/63.
ClickSave and continue.
For Dedicated Interconnect
To configure a BGP session for Dedicated Interconnect,go to theVLAN attachments page.
Select the VLAN attachment that contains the BGP session to update.
On theVLAN attachment details page,clickEdit BGP session.
Select a BGP session type. To enable route exchange for IPv4 selectIPv4 BGP session.
To enable MP-BGP, in theMultiprotocol BGP section, click theEnable IPv6 traffic toggle to the on position.
ClickSave and continue.
gcloud
Remove the IPv6 BGP peer:
gcloudcomputeroutersremove-bgp-peerROUTER_NAME\--peer-name=PEER_NAMERemove the IPv6 BGP interface:
gcloudcomputeroutersremove-interfaceROUTER_NAME\--interface-name=INTERFACE_NAMEEnable IPv4 MP-BGP:
gcloudcomputeroutersupdate-bgp-peerROUTER_NAME\--peer-name=PEER_NAME\--enable-ipv6
API
Use therouters.patch methodto update thebgpPeers[] field.
ThebgpPeers[] field accepts an array of BGP peers. When youPATCH thisfield, you overwrite the existing array of BGP peers with the new arrayincluded in your request.
Send a
GETrequest to get the current array of BGP peers for the router.For details, seeView BGP session configuration.Send a
PATCHrequest with a new array of BGP peers. For each BGP peer forwhich you want to enable IPv6 in the BGP session,setbgpPeers[].enableIpv6toTRUEandbgpPeers[].enableIpv4toFALSE.PATCH https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/regions/REGION/routers/ROUTER_NAME{ "bgpPeers": [BGP_PEERS ]}Replace the following:
PROJECT_ID: the project that contains theCloud RouterREGION: the region where the Cloud Routeris locatedROUTER_NAME: the name of the Cloud RouterBGP_PEERS: the contents of the new array of BGPpeers
The following example enables IPv4 and disable IPv6 in the session for thefirst BGP peer:
{"name":"peer-1","interfaceName":"if-peer-1","ipAddress":"169.254.10.1","peerIpAddress":"169.254.10.2","peerAsn":64512,"advertisedRoutePriority":100,"advertiseMode":"DEFAULT","advertisedGroups":[],"advertisedIpRanges":[],"enable":"TRUE","enableIpv6":false,"enableIpv4":true},{"name":"peer-2","interfaceName":"if-peer-2","ipAddress":"169.254.20.1","peerIpAddress":"169.254.20.2","peerAsn":64513,"advertisedRoutePriority":100,"advertiseMode":"DEFAULT","advertisedGroups":[],"advertisedIpRanges":[],"enable":"TRUE","enableIpv6":false}
Additionally, if you are enabling IPv6 traffic for a BGP session used inan HA VPN tunnel, you can specify IPv6 next hopaddresses:
{"name":"peer-1","interfaceName":"if-peer-1","ipAddress":"169.254.10.1","peerIpAddress":"169.254.10.2","peerAsn":64512,"advertisedRoutePriority":100,"advertiseMode":"DEFAULT","advertisedGroups":[],"advertisedIpRanges":[],"enable":"TRUE","enableIpv6":false,"enableIpv4":true,"ipv6NexthopAddress":"2600:2d00:0:2:0:0:1:5","peerIpv6NexthopAddress":"2600:2d00:0:2:0:0:1:6"},{"name":"peer-2","interfaceName":"if-peer-2","ipAddress":"169.254.20.1","peerIpAddress":"169.254.20.2","peerAsn":64513,"advertisedRoutePriority":100,"advertiseMode":"DEFAULT","advertisedGroups":[],"advertisedIpRanges":[],"enable":"TRUE","enableIpv6":false}
Use the values of
ipv6NexthopAddressandpeerIpv6NexthopAddressto configure your on-premises router or peer VPN device.To view example configurations for HA VPN and your peerVPN device, seeSet up third-party VPNs for IPv4 and IPv6traffic.
To view example configurations for Dedicated Interconnectand your on-premises router, seeSet up on-premises routers for IPv4and IPv6traffic.
What's next
- To disable or end a BGP session, seeDisable or remove BGP sessions.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-02-18 UTC.