V2ray Mikrotik
/disk/set [find] filesystem=ext4 /disk/mount [find]
/ip route add gateway=192.168.88.10 routing-mark=proxy-route
Create a guide on (e.g., bypassing local websites).
You can pull the official V2Ray image directly from Docker Hub. Configure the registry URL: /container/config/set registry-url=https://docker.io Use code with caution. v2ray mikrotik
# Create a virtual ethernet interface for the container /interface/veth/add name=veth-v2ray address=172.16.10.2/24 gateway=172.16.10.1 # Create a bridge to link the virtual interface /interface/bridge/add name=bridge-v2ray /interface/bridge/port/add bridge=bridge-v2ray interface=veth-v2ray # Assign the gateway IP to the router's bridge side /ip/address/add address=172.16.10.1/24 interface=bridge-v2ray Use code with caution. Step 3: Set Up the V2Ray Container Environment
While MikroTik’s RouterOS doesn't natively support V2Ray/Xray, the addition of support in RouterOS v7 has changed the game. Why V2Ray on Your Router?
Instead of routing all traffic, create an address list for traffic that must go through the proxy. You can populate this list dynamically using DNS or BGP feeds. # Create a virtual ethernet interface for the
Send all traffic matching the routing mark route-to-proxy to your V2Ray device instead of your primary ISP gateway.
"inbounds": [ "port": 12345, "protocol": "dokodemo-door", "settings": "network": "tcp,udp", "followRedirect": true , "sniffing": "enabled": true, "destOverride": ["http", "tls"] ] Use code with caution. Step 2: Create a Firewall Mangle Rule in MikroTik
"inbounds": [ "port": 12345, "protocol": "dokodemo-door", "settings": "network": "tcp,udp", "followRedirect": true , "sniffing": "enabled": true, "destOverride": ["http", "tls"] ], "outbounds": [ "protocol": "vless", "settings": "vnext": [ "address": "your-remote-vps-ip.com", "port": 443, "users": [ "id": "your-uuid-here", "encryption": "none", "flow": "xtls-rprx-vision" ] ] , "streamSettings": "network": "tcp", "security": "reality", "realitySettings": "serverName": "://microsoft.com", "publicKey": "your-public-key" ] Use code with caution. Instead of routing all traffic, create an address
She picked up her tablet, connected to the new WiFi, and typed in a restricted URL. For a second, the browser spun—a heartbeat of uncertainty. Then, the page snapped into view. High-definition images, uncensored news, and the global hum of a world she had missed.
If you run legacy MIPSBE hardware (like the hEX series) or resource-constrained boards, you cannot run containers locally. Instead, you deploy V2Ray on an external single-board computer (such as a Raspberry Pi or an x86 mini-PC) connected to your local network. The MikroTik acts as the intelligent traffic interceptor and routes specific traffic to this proxy gateway.
]
/ip firewall address-list add address=192.168.88.50 list=Proxy_Devices add address=192.168.88.60 list=Proxy_Devices /ip firewall mangle add chain=prerouting src-address-list=Proxy_Devices dst-address-type=!local \ action=mark-routing new-routing-mark=to_v2ray passthrough=yes Use code with caution.