Skip to content

V2ray Mikrotik [2021]

Set variables for the Xray container to connect to your V2Ray server:

The V2Ray container needs a virtual environment to communicate with RouterOS and the local network. 1. Create a Virtual Ethernet (VETH) Interface

/interface ethernet set ether1 tcp-segmentation-offload=no v2ray mikrotik

# Mark specific connections that need proxying /ip/firewall/mangle/add chain=prerouting src-address=192.168.88.0/24 dst-address-list=!local_subnets action=mark-routing new-routing-mark=to-v2ray passthrough=yes # Create a route that forces marked traffic to pass through the container's proxy IP /routing/table/add name=to-v2ray fib /ip/route/add dst-address=0.0.0.0/0 gateway=172.16.10.2@main routing-table=to-v2ray Use code with caution.

/ip/proxy/set enabled=yes port=8080 parent-proxy=172.16.10.2 parent-proxy-port=10808 Use code with caution. Set variables for the Xray container to connect

Now, target your desired traffic (either specific IP lists, domains, or an entire subnet) and direct it down the V2Ray tunnel.

: You might need to use a third-party package or manually install V2Ray on your MikroTik. Note that direct installation might not be straightforward due to MikroTik's specific OS. /ip/proxy/set enabled=yes port=8080 parent-proxy=172

: Your MikroTik must use an ARM, ARM64, or x86/CHR architecture. MIPSBE and MMIPS devices do not support containers due to hardware limitations.