Yeah, I've already searched the forum and found that most L7 threads inevitably link to that site. Looked there first.I checked http://l7-filter.sourceforge.net/protocols
but it doesn't have any regexp for mp4 and flv. But it have some useful regexp and you may need them in future.
/ip firewall layer7-protocol
add name="Extension \" .mp4 \"" regexp="\\.(mp4)"
add name="Extension \" .flv \"" regexp="\\.(flv)"
Thanks, Muqatil. I'll give those a try and post the results. It looks like this format would work for pretty much any sort of file extension, right?Code: Select all/ip firewall layer7-protocol add name="Extension \" .mp4 \"" regexp="\\.(mp4)" add name="Extension \" .flv \"" regexp="\\.(flv)"
/ip firewall mangle
add action=jump chain=prerouting content=youtube.com disabled=no jump-target=\
youtube
add action=add-dst-to-address-list address-list=Youtube address-list-timeout=\
5m chain=youtube comment=\
"All packets processed in this chain should be added to Youtube list." \
disabled=no dst-port=80 protocol=tcp
add action=mark-connection chain=youtube disabled=no dst-address-list=Youtube \
new-connection-mark=youtube_conn passthrough=yes
add action=mark-packet chain=output connection-mark=youtube_conn disabled=no \
layer7-protocol="Extension \".mp4 \"" new-packet-mark=youtube_mp4 \
passthrough=yes
add action=mark-packet chain=output connection-mark=youtube_conn disabled=no \
layer7-protocol="Extension \".mp4 \"" new-packet-mark=youtube_flv \
passthrough=yes
/ip firewall layer7-protocol
add name="Extension \".mp4 \"" regexp="\\.(mp4)"
add name="Extension \".flv \"" regexp="\\.(flv)"
/ip firewall mangle
add action=jump chain=prerouting content=youtube.com disabled=no jump-target=\
youtube
add action=add-dst-to-address-list address-list=Youtube address-list-timeout=\
5m chain=youtube comment=\
"All packets processed in this chain should be added to Youtube list." \
disabled=no dst-port=80 protocol=tcp
add action=mark-connection chain=youtube disabled=no dst-address-list=Youtube \
new-connection-mark=youtube_conn passthrough=yes
add action=mark-packet chain=forward connection-mark=youtube_conn disabled=no \
layer7-protocol="Extension \".mp4 \"" new-packet-mark=youtube_mp4 \
passthrough=yes src-address-list=Youtube
add action=mark-packet chain=forward connection-mark=youtube_conn disabled=no \
layer7-protocol="Extension \".mp4 \"" new-packet-mark=youtube_flv \
passthrough=yes src-address-list=Youtube
Actually i didn't know about the proxy service. Forward Chain would not be used by your traffic. Your logic was correctOkay, I corrected a couple of things here. First of all, I wasn't specifying the address list I wanted it to pull from. Second, I did have it in the output chain. I'm running a proxy on this device. My logic was that since it was a proxy redirect, it would be seen as coming from the router, but you're right. It should be in the forward chain.
The idea here is to have packets containing the "youtube.com" string get kicked to the "Youtube" chain. There, the IPs will be added to an address list. IPs on the address list get marked with the "youtube_conn" mark and sent through the L7 filter. The "packet-mark" rules still aren't getting hit.
What did you have in mind for the prerouting chain? Can you give me an example?Actually i didn't know about the proxy service. Forward Chain would not be used by your traffic. Your logic was correctOkay, I corrected a couple of things here. First of all, I wasn't specifying the address list I wanted it to pull from. Second, I did have it in the output chain. I'm running a proxy on this device. My logic was that since it was a proxy redirect, it would be seen as coming from the router, but you're right. It should be in the forward chain.
The idea here is to have packets containing the "youtube.com" string get kicked to the "Youtube" chain. There, the IPs will be added to an address list. IPs on the address list get marked with the "youtube_conn" mark and sent through the L7 filter. The "packet-mark" rules still aren't getting hit.
Can you use prerouting chain or is it used for other purposes?