Beginner to Advanced · Configuration Guide

A V2Ray Guide from Setup to Advanced Configuration

Start with how clients and cores work together, then set up installation, subscriptions, proxy testing, routing, and TUN. The user guide covers the quickest setup path; this page explains how to verify each step and where to look when something goes wrong.

01Understand the Connection Flow

Core Concepts: Client, Core, and Outbound Connection

The client saves settings; the core handles traffic

The client displays the server list, saves subscriptions, generates the core configuration, and may also set the operating system proxy. The core listens for local connections, applies routing rules, resolves domain names, and connects to remote servers. Seeing the client window does not mean a proxy is ready to use, and a running core does not mean an app is sending traffic to it. For a first setup, verify these separately: the client saves settings, the core listens, and a local app can make a request. Don’t collapse them into a single “connected” check.

Project V is a good starting point for understanding this ecosystem. V2Fly continues V2Ray’s development, while Xray evolved from related code and is maintained independently. The two cores share some protocols and configuration concepts, but support for specific fields and combinations varies by version. When a client recognizes a link prefix, that only means its parser understands the format; it does not guarantee that the active core supports the specified transport or security layer. If compatibility is unclear, check the core terminology, then confirm in the startup log which core is actually running.

Follow a request through inbound, routing, and outbound

Take a browser request to a test domain. If the browser follows the system proxy, it first connects to a local listening address; the core calls this side the inbound. The router checks details such as the destination address and port, then selects an outbound by tag. A direct outbound connects to the destination from your device; a proxy outbound first connects to the configured remote server. Traffic can enter the core and then go out directly, so “passes through the client” does not mean “passes through a remote server.” Conversely, changing outbound rules won’t help if the browser never reaches the inbound in the first place.

DNS resolution can happen in the app, the system resolver, the core, or the remote proxy. If an app resolves a domain to an address before connecting and submits only that address to the inbound, the core may not know the original domain. If the app sends the domain through the proxy, domain-based rules may apply directly. Don’t assume every unreachable domain means a node is broken. First distinguish between a failed lookup, a successful lookup with no connection, and a connection that fails during the handshake. Each calls for different logs and settings.

Check node parameters individually

A node typically includes a server address, port, protocol, transport, and security settings. The protocol defines how a session is identified and authenticated; the transport determines how protocol data is carried; options such as TLS or REALITY have their own requirements. For example, VLESS alone does not tell you which transport the server uses, and a node address is not necessarily the value to enter as the server name. If a connection fails, compare the original entry with the complete set of parameters provided by the service. Don’t swap fields just because their names look similar.

It’s also important to distinguish the remote server port from the local listening port. In a desktop client, 127.0.0.1 means the current device; on a phone, the same address does not point to your computer. The local port shown by a desktop app can vary by version, settings, or availability, so note the inbound type along with the port. An app that supports only HTTP proxy may fail before the core receives a valid request if you give it a SOCKS-only port. Treating that as a remote server problem and switching nodes won’t provide useful results.

02Choose a Build and Core

Choose a Client: Platform, Architecture, and Protocol Needs

Use v2rayN on desktop; choose a mobile client by core

For desktop, start with v2rayN. Check your operating system and processor architecture, then choose the matching installer on the client downloads page; don’t infer compatibility from files you already have. The Windows desktop edition uses a cross-platform UI, while the classic WPF edition is Windows-only. If your workflow depends on a particular menu layout, stick with the interface you know; when switching operating systems, consider the desktop edition. The UI framework is not a proxy protocol and does not determine whether a node is compatible.

PlatformClientHow to choose an installer
Windowsv2rayNThis site offers an x64 desktop edition and a classic WPF edition. Choose based on the interface you need.
macOSv2rayNChoose arm64 for Apple Silicon or x64 for Intel.
Androidv2rayNG、v2flyNGFirst check which app architectures your system supports, then choose arm64 or a universal build.
Linuxv2rayNChoose x64 or arm64, then select deb or rpm for your distribution.

Use your system information to identify its architecture. On Windows, check System type under Settings > System > About. Compatibility with a type of program does not mean this site offers a native build for it. On macOS, check About This Mac to see whether it lists a chip or an Intel processor. On Linux, run uname -m in a terminal: x86_64 usually corresponds to x64, and aarch64 to arm64. Linux package formats depend on the distribution’s package management system; changing a file extension does not make deb and rpm packages interchangeable.

Choose the mobile installer separately from the node protocol

On Android, v2rayNG with the Xray core is the usual first choice; consider v2flyNG only if you specifically need the v2fly core. Even if a service lists both clients on the same help page, every subscription entry may not work the same way in both. Check the service’s stated protocol, transport, and security requirements, then test a known configuration. If you’re unsure which app architecture your system supports, a universal build may help. It determines which architectures the installer includes; it does not make the core support more protocols.

A device’s processor supporting 64-bit does not guarantee that its operating system accepts 64-bit apps. If the installer reports an architecture mismatch, check which app architectures the system actually supports. If a universal build still reports a signature conflict, changing architectures won’t fix it. If an app with the same name is already installed, first check whether you’re updating through the same distribution channel and whether you need to keep its data. Don’t make uninstalling the old app your first step.

Set minimum requirements for your use case

If you only need a browser and proxy-aware tools to use a particular outbound, a local proxy inbound is enough; you don’t need to require full-device traffic interception when choosing a client. Consider system permissions and interception support only if you need per-app routing or want to handle apps that ignore the system proxy. On a managed device, first check whether you’re allowed to install apps, change proxy settings, or enable a virtual network interface. Network access is controlled by the administrator; switching to a different UI won’t change system permissions.

After choosing a client, note the operating system, architecture, UI edition, installer type, and expected core. If the same configuration behaves differently on another machine, this helps rule out environment differences before you copy an entire working directory. For details on supported platforms and UI differences, see v2rayN desktop vs. WPF edition. Install just one build to start; this helps avoid port conflicts and competing system proxy changes from multiple instances.

03Establish a Local Baseline

Install and Launch: Data Directory, Permissions, and Listener Status

Install using your system’s recommended method

On Windows, run the installer you selected and launch the app from its installed location. If both UI editions are installed, fully exit the other instance first so two processes don’t overwrite the system proxy in turn. If startup reports a missing runtime, note the exact error and selected build, then install only the dependency that build requires. Repeatedly elevating permissions won’t fix a missing component. Start as a standard user; once the app opens and saves settings correctly, consider features that require additional system permissions.

On macOS, open the DMG that matches your chip and follow the installer window to move the app to Applications, then launch it from there. Avoid running it from the mounted image long-term. If the system blocks it, verify the source and follow your device management requirements. On Linux, choose the deb or rpm for your distribution and use its graphical software installer or package manager to handle dependencies. Don’t assume an installation failure means the package is corrupt: errors about package conflicts, architecture mismatches, and missing dependencies need different fixes.

On Android, open the installer you selected and follow the system prompts to allow installation. If the source requires temporary permission, grant it only to the app opening that file and revoke it afterward. If the system reports that the signature differs from an existing app, export any needed settings from the old client first, if possible, then consider migrating. Installing over it won’t resolve a signature mismatch. On first launch, you can check the server list and settings without immediately enabling the system VPN.

Note where settings are stored and record the initial network state

On desktop, use the client’s data directory shortcut, logs, or export feature to locate settings; don’t guess from the program installation folder. The app and user settings may be stored separately, and reinstalling the app may still load existing settings. Before making changes, note the current system proxy, inbound type, and port. If the device already uses a work proxy, auto-configuration script, or exception list, keep track of where those settings came from so you can restore them after exiting the client.

Confirm that the local inbound is set to serve only the current device. A loopback listener does not serve other devices on the same Wi-Fi network; if you only need local access, don’t enable LAN sharing just to troubleshoot. If a port is already in use, check for another instance of the same app, a tray process that remained after closing, or a second client instance. Once you know what is using it, close the relevant process or change the port in settings, then update the address and port in the app you’re testing.

Start with the first error, not a guess based on the final timeout

If the app opens normally but the node list is empty, you haven’t yet tested a remote connection. Some builds also won’t start a core listener until there’s a usable entry or proxying is enabled. After importing an entry in the next chapter, verify in this order: save the entry, make it active, check the startup log, then send a request. If the log first reports a configuration read error followed by local connection timeouts, go back to the first failure instead of changing network settings. For the layout of the interface, see a tour of the v2rayN main window.

04Import and Test an Entry

Import a Subscription: URL, Groups, and Update Results

Tell a subscription URL from a single-node link

A subscription URL points to configuration content that can be updated; the client fetches it and adds recognized entries to a chosen group. A single-node share link describes one entry and usually isn’t maintained by subscription updates. A service’s login page or control panel URL is not the same as its subscription URL. Opening a page in a browser only shows that it returned a response; it doesn’t prove the response is in a format the client can use. Treat URLs containing access tokens as account credentials. Don’t paste them into public conversion services, screenshots, or chat logs.

In v2rayN, create a clearly named subscription group, edit its URL, save it, switch to that group, and then update it. In v2rayNG, add the URL in subscription group management, return to the main list, and use the update option. With v2flyNG, first confirm which group you’re editing. Menus vary by build; the important distinction is between saving the URL and fetching and parsing its entries. For the quickest UI steps, see the subscription import section of the user guide; this section focuses on checking the update results.

Check fetch, parsing, and connection separately

When updating, first check whether the network request completed, then whether the expected entries appeared in the group. If the request failed, check whether the URL has expired, whether the device is online, whether there’s a certificate error, and which network path the update used. If the request completed but the list is empty, make sure the group isn’t filtered, then check whether the response might be a login page, error page, or unsupported list format. If subscription settings let you choose between a direct connection and an existing proxy, base that choice on which path actually works on the device. For a first setup, don’t make fetching the subscription depend on a proxy that isn’t working yet.

Once entries appear, choose one whose parameters you can verify, make it active, and check the status bar or logs to confirm the core loaded it. Selecting a row in the list may not activate it; use the relevant action in the current interface, then send a new request. Notes and ordering can make entries easier to identify, but updates may refresh subscription-managed parameters or replace entries. Keep manual configurations in a clearly separate group rather than mixing them with entries updated by the service.

Let the scope of the failure guide your checks

If one entry fails while others in the same group work, first compare its protocol, transport, security layer, and server parameters. If the whole group stopped working after an update, check what changed; a matching display name alone doesn’t prove it’s the same server. If multiple sources fail to update but existing nodes still work, the subscription fetch and node connection are separate paths. Investigating the update path will tell you more than resetting every setting at once.

While testing, don’t enable scheduled updates and migrate manually at the same time. If the old device still works, note which groups map to which before importing them one by one and testing on the new device. Share only the time, client type, error category, and group alias when asking for help; redact remote hosts, full subscription URLs, and authentication fields. For a symptom-based checklist, see how to troubleshoot failed subscription updates and empty node lists.

05Choose Which Traffic Enters the Core

Proxy Modes: Manual Proxy, System Proxy, and Traffic Scope

Test the local inbound with one app first

On desktop, leave the system proxy unchanged and choose an app that supports manual proxy settings. Enter the local address, port, and proxy type in that app’s network settings. Make a request to a known working site approved for testing, leaving other apps unchanged. This checks whether the core and current outbound work without also testing how apps read the system proxy. Don’t use an app without its own proxy settings for the first test; if it fails, you won’t know whether it never reached the core or reached it but couldn’t connect to the destination.

The command below tests a SOCKS inbound in a desktop environment with curl. Run it unchanged only if the client confirms that SOCKS is listening on 127.0.0.1:10808; otherwise, substitute the actual address. In a terminal where curl is an alias, you can call the actual program explicitly, for example curl.exe. socks5h sends the destination domain to the SOCKS proxy, which is useful for testing a domain as input; it does not guarantee that the remote side resolves or forwards it.

curl --proxy socks5h://127.0.0.1:10808 --noproxy "" --connect-timeout 10 --max-time 20 --head https://example.com/

A connection refused error usually means you should first check the listening address, port, and process. For a timeout, distinguish between a timeout connecting to the local inbound and one connecting from the core to the destination. An HTTP response only shows that the request reached a responder; the status code alone cannot tell you whether a remote proxy was used. Check inbound and outbound tags in the logs. If the test site doesn’t accept HEAD requests, try a regular GET instead of mistaking an application-level response for a proxy handshake failure.

The system proxy affects apps that follow it

After the manual test passes, let v2rayN set the system proxy. Browsers and many desktop apps read it, but some command-line tools use their own options or environment variables, and some apps have separate connection settings. After enabling it, note which program actually uses the system setting, then compare with one that clearly doesn’t. If only one app fails, check its proxy overrides, exception list, and existing connections before switching nodes.

“Set system proxy” and “global proxy” in core routing are different switches. The first determines whether some apps send traffic into the core; the second determines where traffic already inside the core goes by default. A system proxy exception can keep a request out of the core entirely, while a direct rule applies after the core receives it. If an app uses an auto-configuration script, the script’s proxy choice may happen before core routing. Troubleshoot from the app’s first hop; don’t infer behavior from mode names.

Verify mode changes and exit behavior

After changing modes, test with a new connection rather than reusing one from the browser’s connection pool. First verify that requests reach the expected inbound while the setting is on. Then disable the system proxy set by the client, exit it, and confirm the system no longer points to a local port that isn’t listening. If a work environment manages the proxy, restore its original value rather than clearing everything. Android generally uses system VPN authorization to send selected app traffic to the client; don’t copy desktop system proxy steps. Permission conflicts and app scope are covered in the TUN Mode chapter.

06Route Traffic Inside the Core

Routing and Split Tunneling: Match Conditions, Rule Order, and Default Outbound

Define the expected behavior before changing rules

Routing takes the destination domain or address the core actually receives as input and selects an outbound tag as output. Before you start, write down which destinations should go direct, which should use the proxy, and which outbound should handle everything else. If local devices are involved, distinguish LAN addresses from public sites. If a request never enters the core, go back to the previous chapter and check the proxy inbound instead of changing routing. Whether you use built-in or custom rules, test one minimal rule first, then add other conditions.

Xray checks routing rules in order, so narrower exceptions should usually come before broader rules. A domain subtree is not the same as an exact domain: domain:example.com matches that domain and its subdomains; full:example.com matches only the exact name. If the destination is already an IP address, a domain rule won’t reverse-resolve it into a name. When a rule has multiple different fields, consider whether all of them must match. To route private addresses or a specific test domain directly, split them into separate rules as shown below.

Read an Xray routing configuration

The following object is a routing snippet for the root of an Xray configuration, not a complete configuration that can be started on its own. It assumes the same configuration defines outbound tags named direct and proxy, and that the core can read geo-IP data containing the private category. Enter equivalent conditions using the client’s rule editor; don’t replace the entire client-generated configuration with this snippet.

{
  "routing": {
    "domainStrategy": "AsIs",
    "rules": [
      {
        "type": "field",
        "ip": ["geoip:private"],
        "outboundTag": "direct"
      },
      {
        "type": "field",
        "domain": ["full:example.com"],
        "outboundTag": "direct"
      },
      {
        "type": "field",
        "network": "tcp,udp",
        "outboundTag": "proxy"
      }
    ]
  }
}

Here, AsIs means routing won’t proactively resolve a domain to an IP address just to match an IP rule; it doesn’t mean DNS resolution never happens during a connection. Send a private address directly to test the first rule, and submit the exact test domain by name to test the second. The third rule catches other TCP and UDP requests that enter the core. Without an explicit fallback rule, Xray uses the first outbound for unmatched requests. A GUI client may also generate higher-priority rules, so check the effective configuration and request logs for the actual result.

If you need unmatched domains to be checked against their resolved IP addresses, look into IPIfNonMatch. But in this example, the final protocol-wide fallback catches typical TCP and UDP requests first; changing only the strategy name won’t trigger resolution after a failed match. A strategy that resolves domains for IP matching also means results can depend on DNS resolution, caching, and the resolver in use. Change this kind of setting only when you can state the requirement clearly and keep a baseline for comparison.

Keep a test case for each path

For each test, record the outbound tag for a private address, an exact test domain, and other authorized test destinations, then compare with the expected results. If a domain submitted by name matches the right rule but behaves differently in the browser, check whether the browser reused an old connection, resolved the domain earlier, or bypassed the proxy. With a geosite set, also confirm the rule-set file actually contains that category; a region-like label doesn’t mean it covers every domain in that region. For DNS resolution paths, see the V2Ray DNS configuration guide.

07Expand Traffic Capture

TUN Mode: Virtual Interfaces, Route Capture, and Testing

Enable it only when app proxy settings aren’t enough

TUN sends traffic that the operating system routes to a virtual network interface into the client, so it can handle apps that ignore the system proxy. It changes how traffic enters the client; it doesn’t add protocol support to a node. For example, enabling a virtual interface won’t provide remote UDP forwarding if the node’s connection doesn’t support it. If browser traffic through a manual proxy already fails, fix the basic path from the local inbound to the outbound before using TUN to extend the problem to more apps.

On desktop, check the interception method, system driver, and permissions required by your current v2rayN build. Grant elevated permissions only when the system requires them. On mobile, the client requests VPN authorization from Android; which traffic is captured depends on the selected apps, system settings, and client capabilities. A work VPN, always-on VPN, or another service using the same interception mechanism may conflict. Don’t disable managed network settings to experiment; first check whether you can test independently in an approved environment.

Keep a baseline and test traffic types one at a time

Before enabling TUN, note the existing network interfaces, system proxy, any per-app exclusions, and current DNS behavior. To test TUN by itself, turn off any system proxy the client adds for this test, then make a new connection from an app without explicit proxy settings and check whether its traffic appears in the logs. If you can’t change proxy settings in a managed environment, don’t use overlapping settings there to draw conclusions about TUN. Record the restrictions and choose a test method that complies with them.

For the first round, test only three kinds of destinations: a known working test domain, a LAN resource you’re authorized to access, and one UDP service you actually need. Record the results separately rather than treating one page load as a complete test. If the domain fails but its known IP address works, check DNS first. If only the LAN resource fails, review interface routing and LAN exceptions. If web pages work but the UDP service fails, compare the interception settings with the transport capabilities of the proxy outbound; don’t dismiss it as general network instability.

Diagnose network loss on startup and app-specific failures

If enabling TUN cuts off network access across the device, first return to the proxy mode you already verified. Then check whether the virtual interface was created, whether the default route changed as expected, and whether the proxy server connection is using the wrong interface. If the proxy server’s own connection is captured again, it can create a loop. Check the client’s outbound interface or loopback bypass settings rather than adding a broader default route at random. If the problem appears only after switching Wi-Fi networks, note when it happened and check whether interception updated to use the actual outbound interface.

If a single app never reaches the core, check whether it’s excluded by the per-app list, belongs to another user or work profile, or is still using an existing connection. After stopping interception, test ordinary internet access and local resources again to confirm that the proxy or system route added for this test has been removed. If the system hasn’t fully recovered, use the client’s stop and exit procedures first. Don’t also remove pre-existing proxies, routes, or management policies.

08Keep Troubleshooting Manageable

Maintenance: Update Cadence, Backups, and Recovery

Update the client, core, rule sets, and subscriptions separately

A client update can change the UI, data format, or how configurations are generated. A core update can change supported fields or protocol behavior. A rule-set update can change which destinations a category covers, while a subscription update changes server entries. Updating all four at once makes problems difficult to trace. Before maintenance, note the components in use and which groups work. Update one category at a time and repeat the same request test before moving on. If a release package upgrades several components together, treat it as one migration and keep the old environment for comparison.

At a minimum, back up importable subscription records, separately saved manual entries, routing order, DNS choices, and any important local ports. Prefer the client’s export feature. If you need to copy a data directory, exit the client normally first so it isn’t writing files. Exported data may include credentials and subscription URLs, so store it somewhere access-controlled. Don’t copy another machine’s local paths, network interface names, or interception settings directly to a new device; start with a minimal configuration and verify it again after migration.

Branch troubleshooting by the scope of the change

If every app fails at once, temporarily stop interception and check that the device’s regular network works before checking the local listener and process. If only apps that follow the system proxy fail, check whether it points to a port that is no longer listening. If only one type of destination fails, check whether it uses the same rule set, outbound, or DNS path. If just one entry fails, check its server parameters and what changed in its update. Don’t delete settings before narrowing down the cause. An unchanged control entry is more informative than clearing everything and seeing it work temporarily.

For a TLS handshake error, first check the device date, time zone, and time synchronization, then verify the server name required by the node against the actual settings. Don’t suppress the error by turning off certificate verification. If the log says a certificate isn’t trusted, distinguish whether the error comes from the destination site or the proxy server; they require different settings, and changing the wrong one makes the results harder to interpret. See TLS handshake and certificate error troubleshooting for a step-by-step check.

Keep a practical recovery path

If routing behavior changes after an update, use test requests to identify the step where it changed, then try reverting the latest rule change or restoring a single group. If you need to roll back the client, remember that the newer version may have migrated the configuration format, and an older version may not open the newly written data. Restore the program and its data from a matching backup set; don’t mix state from different formats. After recovery, check the system proxy address, active node, and TUN setting so old data doesn’t introduce network settings that don’t suit the current device.

Raise the log level temporarily only when needed to diagnose a problem, then restore your usual setting after reproducing it. A record of the symptom, trigger, result, and recovery is more useful for future reference than keeping full logs containing addresses. Before asking for help, remove subscription URLs, node credentials, and hostnames that don’t need to be public. Describe the relevant time window instead of posting unrelated browsing history. You can also compare common symptoms with the usage and troubleshooting FAQs.

09Explore Configuration in More Depth

Next Steps: Rule Testing, Core Comparisons, and Long-Term Configuration

Start with a repeatable set of test requests

Advanced configuration isn’t about turning on every feature; it’s about predicting the path a request will take. Create test cases for direct traffic, proxied traffic, an exact-domain match, and a request that doesn’t match any rule. Add a separate UDP test only if you need UDP in everyday use. For each case, record the app, destination type, inbound, expected outbound, and observed result. Run the same request with the old settings before changing anything, then repeat it afterward. Changing one variable at a time is more reliable than judging rule changes by how different websites load.

A test domain and its resolved IP address are different inputs, so record both. A domain resolving to multiple addresses doesn’t necessarily mean the rule is broken. Test the reverse case too: traffic that should go direct must not fall through to a proxy fallback, and traffic that should use the proxy must not bypass the app through a system proxy exception. When results differ, first check whether the app reused an old connection, then whether the core received a domain or an IP address, and finally whether a higher-priority rule selected the actual outbound.

Distinguish resolution, connection, and core differences

When learning about DNS split routing, map out two paths first: who sends the DNS request to which resolver, and which outbound establishes the actual connection once the destination address is known. They don’t have to be the same. Don’t change the DNS server, domain routing strategy, and system resolver cache all at once; keep one direct and one proxy control test whenever you add a setting. If you introduce DoH, also check how the resolver’s hostname is resolved initially and whether the first connection to that resolver depends on a DNS path that isn’t available yet.

To compare Xray and V2Fly, benchmark a set of parameters that both explicitly support. Record differences in the configuration generated by the client and in the cores’ actual startup behavior, then investigate an extension that applies to only one. The executable may accept fields that the current GUI can’t configure; the client may also generate different structures depending on the selected core. Check the effective configuration or logs provided by the client when needed. A configuration filename, dropdown label, or successful import alone does not prove compatibility. For terminology, see the Xray entry.

Record verification and recovery steps

For long-term use, separate a stable baseline from experimental changes. Keep working groups, the default outbound, and LAN exceptions in the baseline; document the reason, applicable devices, and rollback steps for each experiment. If a device switches between home and work networks, note the expected settings for each environment instead of permanently adding temporary LAN exceptions everywhere. When handing off to a colleague, provide repeatable test steps and the necessary settings—not an entire directory containing a private subscription.

Finish by verifying the path from inbound to outbound: installation and exit work normally, subscription updates land in a clearly identified group, the local inbound passes a single-app test, routing matches expectations, and TUN can be enabled and disabled when needed. Then perform a small rollback and confirm the control request still matches the baseline. For future requirements, make the smallest change at the relevant point in this flow. For a refresher on interface steps, return to the user guide; to understand why behavior differs, use this guide’s contents to revisit the relevant chapter.