# Rotate your IPv6 address for escaping YouTube blocking
This tutorial has been written by [unixfox](https://github.com/unixfox), owner of [yewtu.be](https://yewtu.be/). He is better suited when looking for help about this tutorial.
## Synopsis
YouTube has started to periodically block the public Invidious instances since the start of June 2023 ([iv-org/invidious/issues/3872](https://github.com/iv-org/invidious/issues/3872)) and they have become more aggressive about it since the start of August 2023 ([iv-org/invidious/issues/4045](https://github.com/iv-org/invidious/issues/4045)).
Due to this block, "local proxy" and DASH do not work anymore. But Invidious still works for most videos without using the proxy, because the video playback traffic is sent directly to YouTube servers without going through the instance.
Thanks to IPv6 you can easily escape this block because there are many IP addresses in a single /64 IPv6 range. (18,446,744,073,709,551,616 IP addresses to be precise)
This tutorial will explain how to automatically and periodically rotate your IPv6 address. Also some notes about how to have IPv6 in case your provider does not offer it.
If your provider does not support IPv6 then you can either switch to another provider that support IPv6.
There are many today that do support it, here is a non-exhaustive list of them (**this is not recommendation, just a list of the popular providers that support IPv6**):
This website lists all the free and paid existing tunnelbrokers: https://tunnelbroker.services/. **We do not recommend running a public instance on a free tunnelbroker as this would put a lot of strain on their network because video streaming consumes a lot of bandwidth.**
You can also use an external server (from another provider that do support IPv6) for acting as an IPV6 tunnel for your main server. Wireguard is perfectly suited for that.
## Configure the IPv6 rotator (made by Invidious team)
This tool was developed by the Invidious team, and it's the official tool for rotating your IPv6 address on Invidious: https://github.com/iv-org/smart-ipv6-rotator.
It may be used on other projects that depend on YouTube and/or Google (example: Piped or SearXNG).
1. Make sure you have installed all the python libraries from [the "requirements"](#requirements).
2. Clone the repository somewhere that you like (not inside the invidious directory):
3. Find the IPv6 subnet of your server, usually it's written on your provider website.
But you can easily find it using this tool: http://www.gestioip.net/cgi-bin/subnet_calculator.cgi.
Enter the main IPv6 address, select IPv6 and change the prefix length only if it's not a /64.
Use the command `ip a` to get the detail of your IPv6 network configuration.
4. Run the script once like this (don't use sudo if you are already root):
```
sudo python smart-ipv6-rotator.py run --ipv6range=YOURIPV6SUBNET/64
```
5. If everything went well, then configure a cron to periodically rotate your IPv6 range. Twice a day (noon and midnight) is enough for YouTube servers. Also at the reboot of the server!
If the script does not work for you, it could be that:
- Your provider does not allow you to assign any arbitrary IPv6 address, it's common for cloud providers like AWS, Oracle Cloud, Google Cloud where you need to manually assign the IPv6 address from the panel.
- You have not correctly set your IPv6 subnet range. In such case, please ask for help on IRC or Matrix or in a GitHub issue.