You can check whether [IP filtering](https://docs.cloud.google.com/storage/docs/ip-filtering-overview.md.txt) is enabled or disabled on your Cloud Storage buckets by listing the bucket IP filtering rules. If you need to view
information about the specific network sources that are allowed, use the
[Get bucket IP filtering rules](https://docs.cloud.google.com/storage/docs/get-ip-filter.md.txt) operation.

## Required roles

To get the required permissions for listing the bucket IP filtering rules, ask your administrator to grant you the Storage Admin (`roles/storage.admin`)
role on the bucket. This role contains the `storage.buckets.list` permission required to list bucket IP filtering rules.

You can also get this permission with [custom roles](https://docs.cloud.google.com/iam/docs/creating-custom-roles.md.txt). You might be able to get this permission with other predefined roles as well. To see which roles are associated with which permissions,
refer to [IAM roles for Cloud Storage](https://docs.cloud.google.com/iam/docs/understanding-roles).

For instructions on granting roles for projects, see [Manage access to
projects](https://docs.cloud.google.com/iam/docs/granting-changing-revoking-access).

## List bucket IP filtering rules

### Console

1. In the Google Cloud console, go to the Cloud Storage **Buckets** page.

   [Go to Buckets](https://console.cloud.google.com/storage/browser)
2. In the list of buckets, click the name of the bucket you want to update.

3. On the **Bucket details** page, click the **Configuration** tab.

4. In the **Permissions** section, navigate to **IP filtering** . Then, click **Edit IP filtering configuration**.

   The **IP filtering** page displays the following details:
   - IP filtering status of the bucket.
   - Whether service agents are configured to bypass the IP filter validation.
   - Whether access from cross-organization VPC networks is allowed.
   - All configured IP filtering rules.

### gcloud

1. Verify that you have the Google Cloud CLI version 526.0.0 or later installed:

       gcloud version | head -n1

2. If you have an earlier gcloud CLI version installed, update the version:

       gcloud components update --version=526.0.0

3. To list the bucket IP filtering rules, run the [`gcloud
   storage buckets describe`](https://docs.cloud.google.com/sdk/gcloud/reference/storage/buckets/describe) command in your development
   environment:

   ```
   gcloud storage buckets describe gs://BUCKET_NAME --format="default(ip_filter_config)"
   ```

   Where:

   `BUCKET_NAME` is the name of your bucket. For example, `my-bucket`.

### JSON API

1. Have gcloud CLI [installed and initialized](https://docs.cloud.google.com/sdk/docs/install), which lets
   you generate an access token for the `Authorization` header.

2. Use [`cURL`](http://curl.haxx.se/) to call the [JSON API](https://docs.cloud.google.com/storage/docs/json_api.md.txt) with a [`List` bucket](https://docs.cloud.google.com/storage/docs/json_api/v1/buckets/list.md.txt) request:

   ```
   curl -X GET \
     -H "Authorization: Bearer $(gcloud auth print-access-token)" \
     "https://storage.googleapis.com/storage/v1/b?project=PROJECT_ID"
   ```

   Where:

   `PROJECT_ID` is the ID of the project containing the buckets you want to list. For example, `my-project`.

   The response looks like the following example:

   ```json
   {
     "kind": "storage#buckets",
     "items":
           {
           "kind": "storage#bucket",
           "selfLink": "https://www.googleapis.com/storage/v1/b/my-bucket1",
           "id": "my-bucket1",
           "name": "my-bucket1",
           "projectNumber": "123456789012",
           ...
             },
           "ipFilter": {
             "mode": "Disabled"
            }
           {
           "kind": "storage#bucket",
           "selfLink": "https://www.googleapis.com/storage/v1/b/my-bucket2",
           "id": "my-bucket2",
           "name": "my-bucket2",
           "projectNumber": "123456789013",
           ...
           },
           "ipFilter": {
             "mode": "Enabled"
           }
   },
   ```

## What's next

- [Create or update IP filtering rules on an existing bucket](https://docs.cloud.google.com/storage/docs/update-ip-filter.md.txt).
- [Get bucket IP filtering rules](https://docs.cloud.google.com/storage/docs/get-ip-filter.md.txt).
- [Disable bucket IP filtering rules](https://docs.cloud.google.com/storage/docs/disable-ip-filtering.md.txt).