# Restricting Team Access

**URL:** https://forum.mattermost.com/t/restricting-team-access/7367
**Category:** Troubleshooting
**Created:** [May 27, 2019, 12:11am UTC](https://forum.mattermost.com/t/restricting-team-access/7367 "2019-05-27T00:11:33Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Gift\_Of\_Sight](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/gift_of_sight/32/2935_2.png) [@Gift\_Of\_Sight](https://forum.mattermost.com/u/Gift_Of_Sight)
#### Post date: [May 27, 2019, 12:11am UTC](https://forum.mattermost.com/t/restricting-team-access/7367/1 "2019-05-27T00:11:33Z")

</div>

We have a need to deny access to a Team outside a defined IP range.We intend to perform this task with the Location directive within nginx;s reverse proxy server. I cannot seem to find the specific Team name or ID’s directory to try this experiment.

Any ideas? Have others tried other methods?

Thanks

---

<div class="post-metadata">

### Author: ![amy.blais](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/amy.blais/32/7481_2.png) [@amy.blais](https://forum.mattermost.com/u/amy.blais)
#### Post date: [May 27, 2019, 10:13pm UTC](https://forum.mattermost.com/t/restricting-team-access/7367/2 "2019-05-27T22:13:27Z")

</div>

Hi @Gift_Of_Sight,

A response from a community member:

To get the team ID, given a team name, you could use the [API](https://api.mattermost.com/#tag/teams%2Fpaths%2F~1teams~1name~1%7Bname%7D%2Fget). (Also, they’re not too convinced by your approach. Sounds like it might break usage of Mattermost in strange/unexpected ways.)

---

<div class="post-metadata">

### Author: ![Gift\_Of\_Sight](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/gift_of_sight/32/2935_2.png) [@Gift\_Of\_Sight](https://forum.mattermost.com/u/Gift_Of_Sight)
#### Post date: [May 29, 2019, 5:07pm UTC](https://forum.mattermost.com/t/restricting-team-access/7367/3 "2019-05-29T17:07:39Z")

</div>

Thank you. I’m struggling with this issue.

Are there other options to restrict a Team or group of users to the internal network while allowing another group or members of a team access outside the firewall?

Thanks for your help.

![](https://us1.discourse-cdn.com/flex020/uploads/mattermost/original/2X/2/2b2a01942df843af31e5b4dfb06d8c74ed52b3d7.png "amy.blais")

[amy.blais](https://forum.mattermost.com/u/amy.blais)

```
    May 27

```

Hi [@Gift\_Of\_Sight](https://forum.mattermost.com/u/gift_of_sight),

A response from a community member:

To get the team ID, given a team name, you could use the [API](https://api.mattermost.com/#tag/teams%2Fpaths%2F~1teams~1name~1%7Bname%7D%2Fget). (Also, they’re not too convinced by your approach. Sounds like it might break usage of Mattermost in strange/unexpected ways.)

---

<div class="post-metadata">

### Author: ![amy.blais](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/amy.blais/32/7481_2.png) [@amy.blais](https://forum.mattermost.com/u/amy.blais)
#### Post date: [June 3, 2019, 12:11pm UTC](https://forum.mattermost.com/t/restricting-team-access/7367/4 "2019-06-03T12:11:16Z")

</div>

A response from a community member:

He wasn’t sure if restricted users move between allowed/forbidden networks, but if not, you could try to configure the authentication method (e.g. [LDAP](https://unix.stackexchange.com/questions/444332/how-to-restrict-user-based-on-ip-address-in-openldap)) to prevent restricted users from login unless they are in the allowed network.
