Mark Routing YouTube Packet

hello all

i have a problem to mark routing on www.youtube.com

my rule :

/ip firewall layer7-protocol
add name=YouTube regexp="^.+(youtube).*$"

/ip firewall mangle
add action=mark-routing chain=prerouting layer7-protocol=YouTube \
    new-routing-mark=vpn passthrough=no
    
/ip route
add distance=1 gateway=192.168.11.1 routing-mark=vpn

please help me

Hello, see here the layer7 protocols:

https://www.wirelessinfo.be/mikrotik-layer7-codes/

It won’t be much help for routing purposes. Connections have to be routed from very first packet and there’s nothing identifiable in SYN packets.

Basically there are two options:

a) Find networks used by Google and route them as whole, but it will include more than just Youtube.
b) Do some trick with address list, where you can add addresses found by L7. Then mark routing based on this list. It won’t work for first connection, only subsequent ones.