Today, the major release v2rayN v7.0 was released, and with it, my series of commits that add support for the "Russia" preset.

Introduction

It's no secret that due to the blocking of "regular" VPN protocols in Russia, many users have switched to using v2ray/xray/sing-box. As is known, almost all GUI clients are developed in China for China, but their specifics are not very applicable to Russia (at least for now).

Therefore, I had the idea to create a repository with Russian GeoIP/GeoSite files, as well as to add support for them in what is probably the most popular client for Windows—v2rayN.

Please note that starting from version 7.0.0, v2rayN supports Linux!

v2rayN

If you're not interested in the details, here is the link to the release: v2rayN v7.0

You just need to download v2rayN-windows-64-SelfContained-With-Core.7z, unpack it, and run v2rayN.exe.

After that, add your config and click Настройки -> Региональные пресеты -> Россия (For the English locale Settings -> Regional presets setting -> Russia).

What was done

  1. Added support for third-party sources of GeoIP/GeoSite files for Xray and sing-box and their updates.

  2. Added support for third-party sources of routing rules.

  3. Added support for third-party sources of DNS configuration for Xray and sing-box.

  4. Added the "Russia" preset itself, which simply sets all the above parameters and updates the Geo files.

v2rayN already has support for Russian sources, but you can use your own. All sources except DNS are configured in Settings -> Option Settings -> v2rayN Settings.

Downloading from all sources goes through the proxy, so you don't have to worry about future blocks.

GeoIP/GeoSite Sources

The official GeoIP/GeoSite and sing-box srs files are downloaded from the @runetfreedom/russia-v2ray-rules-dat repository.

This repository is an aggregator of files from @runetfreedom/russia-blocked-geoip and @runetfreedom/russia-blocked-geosite. The sole purpose of this aggregation is that the v2rayN code expects a single repository for both types of files.

More details on the contents of these files below.

Routing Rules Sources

The official routing rules are downloaded from the @runetfreedom/russia-v2ray-custom-routing-list repository.

All rules block ads and pass traffic directly to private and reserved networks defined in RFC6890.

Currently, there are 3 sets of rules:

  1. All—as the name suggests, directs all traffic to the proxy/VPN.

  2. All, except RU—all traffic is directed to the proxy/VPN, except for torrents and all Russian IPs. In this mode, government services, Russian Railways, banks, etc., work normally.

  3. Blocked—Only domains (antifilter community and re:filter) and IP addresses blocked in Russia are directed to the proxy/VPN. Additionally, UDP ports 50000-65535 had to be routed for Discord voice to work.

The choice of rule depends on the task and the desired level of anonymity, but in general, the second set is sufficient for the average user. Due to the new approach with blocking on TSPU, we don't actually have a single registry of resources to which they apply restrictions, so the third set may not work perfectly.

DNS Configuration Sources

The official DNS configuration is downloaded from the @runetfreedom/russia-v2ray-custom-routing-list repository.

There is nothing particularly interesting in them; they are very similar to the built-in ones, except for blocking ads and replacing Chinese DNS for local queries with Yandex DNS (77.88.8.8).

Russian Source of GeoIP and GeoSite Files

I couldn't find a single repository on the internet that collected all the sources together, so I decided to make my own.

The data sources for blocks in Russia are:

  1. antifilter.download

  2. community.antifilter.download

  3. re:filter

For routers and mobile phones, you should use geosite-ru-only.dat and geoip-ru-only.dat, as the full lists are too large for them.

The content is updated every 6 hours using GitHub Actions.

GeoIP

GeoIP files are available in the @runetfreedom/russia-blocked-geoip repository.

The following output formats are currently supported:

  • geoip.dat (V2Ray, Xray-core, v2rayN and others)

  • MaxMind mmdb

  • sing-box srs

  • mihomo mrs

  • Clash rules

  • SURGE rules

  • nginx allow and deny templates (for reverse proxy and fallback schemes)

Main categories:

  1. geoip:ru-blocked contains ipresolve.lst and subnet.lst from the antifilter.download service

  2. geoip:ru-blocked-community contains community.lst from the community.antifilter.download service

  3. geoip:re-filter contains ipsum.lst from re:filter

For your convenience, several additional ASN-based categories are included in the files:

  • geoip:cloudflare

  • geoip:cloudfront

  • geoip:facebook

  • geoip:fastly

  • geoip:google

  • geoip:netflix

  • geoip:telegram

  • geoip:twitter

  • geoip:ddos-guard

  • geoip:yandex

File contents:

  • geoip.dat, Country.mmdb—contains the full dataset (original geoip + all categories)

  • geoip-asn.dat, Country-asn.mmdb—contains only the additional categories

  • geoip-ru-only.dat, Country-ru-only.mmdb—contains only the lists of blocked networks and addresses + private (geoip:ru-blocked, geoip:ru-blocked-community, geoip:re-filter, and geoip:private)

  • ru-blocked.dat, ru-blocked-community.dat, re-filter.dat—the corresponding categories separately (geoip.dat format only)

  • private.dat—Private/Reserved networks (RFC6890)

Directory contents

In all directories, the content is divided according to the principle "1 file = 1 category".

  • datgeoip.dat format

  • text—Text lists

  • srs—sing-box format

  • clash—Clash format (including classic and ip-cidr notation)

  • mrs—mihomo format

  • surge—SURGE format

  • nginx—allow and deny rules for nginx

GeoSite

GeoSite files are available in the @runetfreedom/russia-blocked-geosite repository.

Currently, only the geosite.dat format is supported.

In addition to the lists of blocked content, the following are used:

Additional domains from @runetfreedom/russia-domains-list are also loaded into the lists. To add blocked domains, please use the Antifilter Community bot instead of submitting a PR to this repository, if possible.

Available categories

  • All categories from @v2fly/domain-list-community. Including: google, discord, youtube, twitter, meta, openai, and so on.

  • geosite:ru-blocked—domains blocked in Russia (antifilter-download-community + re:filter)

  • geosite:ru-blocked-allall known domains blocked in Russia (antifilter-download + antifilter-download-community + re:filter). The list contains at least 700,000 domains, use with caution.

  • geosite:ru-available-only-inside—Domains accessible only from within Russia

  • geosite:antifilter-download—all domains from antifilter.download (almost 700,000, use with caution)

  • geosite:antifilter-download-community—all domains from community.antifilter.download

  • geosite:refilter—all domains from re:filter

  • geosite:category-ads-all—all ad domains

  • geosite:win-spy—domains used by Windows for tracking and collecting analytics

  • geosite:win-update—domains used by Windows for updates

  • geosite:win-extra—other domains used by Windows

Please note that geosite:category-ads-all from v2fly is overwritten, as it is too small and largely useless.

The release also contains these categories as text files with a list of domains.

Conclusion

All files are available for download and use for any purpose. If you have any ideas or suggestions, please post them in the issues of the respective repositories.

I had plans to also make routing rules for FoxRay (a client for iOS/macOS), but the client's developers recently removed support for importing rules.