V2Fly.orgV2Fly.org
Quick Start
Config Reference
Config Reference (v5, WIP)
Tools
Developer Guide
New concise guide
  • 简体中文
  • English
GitHub
Quick Start
Config Reference
Config Reference (v5, WIP)
Tools
Developer Guide
New concise guide
  • 简体中文
  • English
GitHub
  • Config Reference

    • Configuration File Format (Draft)
    • Inbounds
    • Outbounds
    • Proxy Protocol
    • Stream
    • Service
    • DNS
    • Router
    • Geo
  • Proxy Protocol

    • Blackhole
    • DNS
    • Dokodemo
    • Freedom
    • HTTP
    • Socks
    • VMess
    • VLite
    • Shadowsocks
    • Shadowsocks2022
    • Trojan
    • Hysteria2
    • VLESS
    • Loopback
  • Stream Transport Protocol

    • TCP
    • WebSocket
    • KCP(mKCP)
    • gRPC
    • QUIC
    • Meek
    • HTTPUpgrade
    • Hysteria2
    • mekya
  • Service

    • Stats
    • Policy
    • Browser Forwarder
    • Burst Observatory
    • Background Observatory
    • Tun
      • Tun
      • IPObject
      • RouteObject
    • Subscription Manager
    • File System Storage

Tun

  • Name: tun
  • Type: Service
  • ID: service.tun

Tun is an interface that accepts and forwards packet based network traffic, and converts traffic processed by inbounds to streams. (v5.9.0+)

Look at its pull request for working examples of how to configure it.

Supports Linux operating system on amd64 and arm64.

Tun

name: string

The name of the tun interface.

mtu: number

The mtu of the tun interface. The recommanded value is 1500.

tag: string

The inbound tag associated with tun generated traffic.

ips: [ IPObject ]

The ip address associated with tun. You will need to add them to tun on the operating system side as well.

routes: [ RouteObject ]

The routes associated with tun. You will need to add them to tun on the operating system side as well.

enablePromiscuousMode: bool

Recommanded to set to true.

enableSpoofing: bool

Recommanded to set to true.

packetEncoding: ["None" | "Packet"]

UDP packet encoding method,None by default。

When this value is None , UDP connections will be split into streams based on their destination (Address and Port-Dependent Mapping)。

When this value is Packet, UDP connections from a single source connection will be encoded as UDP packet addr connection, which will be restored to its original form by a supported outbound as an Endpoint Independent Mapping UDP connection. This UDP behaviour is also known as FullCone or NAT1.

sniffingSettings: SniffingObject

The sniffing settings for the tun inbound. It allows the connection to be routed based on its content and metadata.(v5.11.0+)

IPObject

ip: [ number ]

The IP address in base 10 expression.

prefix: number

RouteObject

ip: [ number ]

prefix: number

Edit this page on GitHub
Last Updated:
Contributors: Shelikhoo, AkinoKaede, Arınç ÜNAL
Prev
Background Observatory
Next
Subscription Manager