Advertising Custom IP Ranges

Update existing Cloud Routers or BGP sessions to advertise IP ranges that aren't part of any subnet, such as external (public) IP addresses.

See Creating Cloud Routers or Establishing BGP Sessions to specify advertisements when you create a Cloud Router or configure a BGP session.

To specify advertisements on an existing Cloud Router:

Console


  1. Go to the Cloud Router page in the Google Cloud Platform Console.
    Cloud Router list
  2. Select the Cloud Router to update.
  3. In the Cloud Router's detail page, select Edit.
  4. Expand the Advertised routes section.
  5. For the Routes, select Create custom routes.
  6. Select Advertise all subnets visible to the the Cloud Router to continue advertising the subnets available to the Cloud Router. Enabling this option mimics the Cloud Router's default behavior.
  7. Select Add custom route to add an advertised route.
  8. Configure the route advertisement.
    • Source — Select Custom IP range to specify a custom IP range.
    • IP address range — Specify the custom IP range by using CIDR notation.
    • Description — Add a description to help you identify the purpose of this route advertisement.
  9. After you're done adding routes, select Save.

gcloud


Run the update command, using the --set-advertisement-ranges or --add-advertisement-ranges flag to specify the custom IP ranges:

  • To set custom IP ranges, use the --set-advertisement-ranges flag. Any existing custom advertisements are replaced. The following example updates the my-router Cloud Router to advertise all subnets and the custom IP ranges 1.2.3.4 and 6.7.0.0/16:

    gcloud compute routers update my-router \
        --set-advertisement-mode custom \
        --set-advertisement-groups all_subnets \
        --set-advertisement-ranges 1.2.3.4,6.7.0.0/16
    

    The --set-advertisement-groups flag accepts Google-defined groups that Cloud Router dynamically advertises. You can remove the --set-advertisement-groups flag to exclude subnet advertisements. For a list of all advertisements groups, see the set-advertisement-groups flag in the Google SDK documentation.

  • To append custom IP ranges to an existing advertisement, use the --add-advertisement-ranges flag. Note that this flag requires the Cloud Router's advertisement mode to already be set to custom. The following example, adds the 1.2.3.5 custom IP to the Cloud Router's advertisements:

    gcloud compute routers update my-router \
        --add-advertisement-ranges 1.2.3.5
    

To specify advertisements on an existing BGP session:

Console


  1. Go to the Cloud Router page in the Google Cloud Platform Console.
    Cloud Router list
  2. Select the Cloud Router that contains the BGP session to update.
  3. In the Cloud Router's detail page, select the BGP session to update.
  4. In the BGP session details page, select Edit.
  5. For the Routes, select Create custom routes.
  6. Select Advertise all subnets visible to the the Cloud Router to continue advertising the subnets available to the Cloud Router. Enabling this option mimics the Cloud Router's default behavior.
  7. Select Add custom route to add an advertised route.
  8. Configure the route advertisement.
    • Source — Select Custom IP range to specify a custom IP range.
    • IP address range — Specify the custom IP range by using CIDR notation.
    • Description — Add a description to help you identify the purpose of this route advertisement.
  9. After you're done adding routes, select Save.

gcloud


Run the update-bgp-peer command, using the --set-advertisement-ranges or --add-advertisement-ranges flag to specify the custom IP ranges.

  • To set custom IP ranges, use the --set-advertisement-ranges flag. Any existing custom advertisements are replaced. The following example updates the my-bgp-session BGP session on the my-router Cloud Router to advertise all subnets and the custom IP ranges 1.2.3.4 and 6.7.0.0/16:

    gcloud compute routers update-bgp-peer my-router \
        --peer-name my-bgp-session \
        --set-advertisement-mode custom \
        --set-advertisement-groups all_subnets \
        --set-advertisement-ranges 1.2.3.4,6.7.0.0/16
    

    The --set-advertisement-groups flag accepts Google-defined groups that the BGP session dynamically advertises. You can remove the --add-advertisement-groups flag to exclude subnet advertisements. For a list of all advertisements groups, see the set-advertisement-groups flag in the Google SDK documentation.

  • To append custom IP ranges to existing ones, use the --add-advertisement-ranges flag. Note that this flag requires the Cloud Router's advertisement mode to already be set to custom. The following example, adds the 1.2.3.5 custom IP to the Cloud Router's advertisements:

    gcloud compute routers update-bgp-peer my-router \
        --peer-name my-bgp-session \
        --add-advertisement-ranges 1.2.3.5
    

What's next

Was this page helpful? Let us know how we did:

Send feedback about...

Cloud Router