# Discourse 能否正常处理 IPv6 的屏蔽？

**URL:** <https://meta.discourse.org/t/does-discourse-handle-blocking-of-ipv6-okay/83125>\
**Category:** Support\
**Created:** [2018年三月16日 05:38 UTC](https://meta.discourse.org/t/does-discourse-handle-blocking-of-ipv6-okay/83125 "2018-03-16T05:38:29Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![1101010](https://avatars.discourse-cdn.com/v4/letter/1/6de8d8/32.png) [@1101010](https://meta.discourse.org/u/1101010)\
**Post date:** [2018年三月16日 05:38 UTC](https://meta.discourse.org/t/does-discourse-handle-blocking-of-ipv6-okay/83125/1 "2018-03-16T05:38:29Z")

</div>

We’ve got a troll who keeps coming back and it’s true that he has a new IP each time but it’s relatively easy for me to spot him and stop him based on his location coming up and his style. Mostly he has IPv6 IPs

What I noticed was that Screened IPs shows a couple of his:

 ![image](https://global.discourse-cdn.com/meta/original/3X/f/b/fb592ef434b0e851637a1e3bfa90291b4e53cff3.png)

But they’re not the full IP. When I put 2001 into the Search box on the top right it brings up nothing, whereas if I do, say, ‘81’, I get a couple of IPv4s come up.

Anyway, all of his IPv6 addresses begin  
2001:2012:208:2a00  
so I’d like to do a block mask on that basis but I’m not sure if masks are possible but I assume they are. However, since the full IP isn’t showing on this screen I wasn’t sure what that meant in terms of doing such a block?

Thanks

---

<div class="post-metadata">

**Author:** ![1101010](https://avatars.discourse-cdn.com/v4/letter/1/6de8d8/32.png) [@1101010](https://meta.discourse.org/u/1101010)\
**Post date:** [2018年三月16日 05:39 UTC](https://meta.discourse.org/t/does-discourse-handle-blocking-of-ipv6-okay/83125/2 "2018-03-16T05:39:34Z")

</div>

Apologies, if I click to edit I see the full IP with a /128 at the end, so maybe I can mask ban?

---

<div class="post-metadata">

**Author:** ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)\
**Post date:** [2018年三月16日 05:42 UTC](https://meta.discourse.org/t/does-discourse-handle-blocking-of-ipv6-okay/83125/3 "2018-03-16T05:42:32Z")

</div>

Yes, in fact repeated spam blocks will automatically roll up IP address blocks to increasingly large subnets, such as `255.255.255.*` and `255.255.*.*`

I’m not sure what this code does with IPv6 though.. cc @mpalmer @zogstrip

---

<div class="post-metadata">

**Author:** ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)\
**Post date:** [2018年三月16日 07:38 UTC](https://meta.discourse.org/t/does-discourse-handle-blocking-of-ipv6-okay/83125/4 "2018-03-16T07:38:03Z")

</div>

I reckon I didn’t test IPv6 blocks. Added to my list.

---

<div class="post-metadata">

**Author:** ![supermathie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/supermathie/32/507518_2.png) [@supermathie](https://meta.discourse.org/u/supermathie)\
**Post date:** [2018年三月16日 14:22 UTC](https://meta.discourse.org/t/does-discourse-handle-blocking-of-ipv6-okay/83125/5 "2018-03-16T14:22:29Z")

</div>

I can confirm that if you add a block for an IPv6 range (e.g. `2001:2012:208:2a00::/64`) it’ll work as expected:

![image](https://global.discourse-cdn.com/meta/original/3X/5/0/5034983619aa4a53fbc4cb494c79f3f3da0e5ef2.png)

but we do need to fix search and the column width.

As for the automatic roll-up, we probably want to do something like:

- if we have ≥3 blocks in the same IPv6 /64, then summarize to blocking that /64

---

<div class="post-metadata">

**Author:** ![1101010](https://avatars.discourse-cdn.com/v4/letter/1/6de8d8/32.png) [@1101010](https://meta.discourse.org/u/1101010)\
**Post date:** [2018年三月16日 23:47 UTC](https://meta.discourse.org/t/does-discourse-handle-blocking-of-ipv6-okay/83125/6 "2018-03-16T23:47:13Z")

</div>

Thanks a lot for this.

I did briefly try one with four stars in between the remaining colon blocks and /128 at the end but it was rejected as in error.

---

<div class="post-metadata">

**Author:** ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)\
**Post date:** [2024年六月8日 12:37 UTC](https://meta.discourse.org/t/does-discourse-handle-blocking-of-ipv6-okay/83125/7 "2024-06-08T12:37:41Z")

</div>

此主题已在 2276 天后自动关闭。不再允许回复。
