Hi, i try to set up VLESS client on Mikrotik AX3 using containers.
Generally XRay container works and i can route traffic to VLESS client and server.
The only thing that i can not understand - how to send all traffic to VLESS client but not only selected hosts.
for ex:
firewall rule:
/ip firewall mangle add action=mark-routing chain=prerouting dst-address-list=route_proxy new-routing-mark=proxy_mark passthrough=yes
In real a lot of addresses have to be added to that list and more simple to send all traffic through VLESS channel.
But how to tell address list to add all adresses in internet? ^)
or how to change /ip firewall mangle rule not to use address list, but send all traffic to VLESS container?
Thanks
If you want all traffic to be routed through your vpn, the usual way is to base the marking not on dst-address, but on in-interface (the interface from which the packets you want to go through your firewall originate).
Often you want to exclude certain addresses instead, by additionally including something like dst-address=!192.168.88.0/24 to exclude packets to your local subnet(s) from getting pushed through the tunnel.
Thanks,
But i not very experienced in firewall rules. Could you share example of your suggestion?
I have several Mikrotik’s devices and could understand general setup process but did not go deep in firewall.
@Mikchel how did you setup routing over Xray in container? Did you use tun2proxy or similar to bind tunnel interface for proxy in container since Xray itself does not have such functionality (it can only listen on port for proxy protocol).
I did not use second container. Actually as i did not see whole schema i could not understand the reason to use second container. After that i found comment that you have to use proxy or tunnel to route traffic to vless container. Same time i did not understand why i saw setup of listening port in config.json.
So for test i just used system proxy to route traffic in vless container and that worked.
I decided to add additional Mirotik router to my home network and connect to that network only that devices who need vpn access.
That is why i want to route all traffic - that devices don’t need any other acces instead vpn
where the “selector” or “matcher” is “dst-address-list=route_proxy”, try replacing it with a matcher for the “in-interface” (no idea what this could be), i.e.:
Using proxy for connections and routing are not same thing. Routing is on L3, to achieve routing over proxy, some tunnel interface needs to be added somwhere, in this case in container since ROS does not have feature to create tun2proxy interface (would be great to have such feature so that whole routing can be configured inside ROS), also some routing rules needs to be added inside container where tunnel interface is binded so that container then routes traffic over such interface, something like is mentioned here.
Deicide by yourself what is best suitable for you, would you build single container containing Xray, some tun2proxy solution and routing rules script or to have it separate… Either way you will need some customization inside container to add routing rules.