Community discussions

MikroTik App
 
mhitrov
newbie
Topic Author
Posts: 34
Joined: Mon Dec 27, 2004 10:30 am

marking packets

Wed Mar 26, 2008 5:00 pm

Hi,

Could you explain me when should i use just "action=mark-packet" and when i should use it in confunction with "action=mark-connection", for Queue tree shaping.

I saw several scripts from different guys.

Somebody just mark the packet (without any connection-mark actions):
1   ;;; UP TRAFFIC
    chain=prerouting in-interface=lan 
    src-address=172.21.1.0/24 action=mark-packet 
    new-packet-mark=test-up passthrough=no
Somebody fist of all, mark the connection, and after that mark the packet2:
2   ;;; CONN-MARK
    chain=forward src-address=172.21.1.0/24 
    action=mark-connection 
    new-connection-mark=test-conn passthrough=yes 

3   ;;; DOWN-DIRECT CONNECTION
    chain=forward in-interface=public 
    connection-mark=test-conn action=mark-packet 
    new-packet-mark=test-down passthrough=no 

4   ;;; DOWN-VIA PROXY
    chain=output out-interface=lan 
    dst-address=172.21.1.0/24 action=mark-packet 
    new-packet-mark=test-down passthrough=no
Could you explain me in more details how it works?

Thanks
 
User avatar
Ibersystems
Forum Guru
Forum Guru
Posts: 1686
Joined: Wed Apr 12, 2006 12:29 am
Location: Cabrils, Barcelona - Spain
Contact:

Re: marking packets

Wed Mar 26, 2008 8:24 pm

Hi,

I allways mark connection and later mark packet. This is how we make in training..

In mark connection u have to put passthrough=yes and in mark packet passthrough=no.


Martín.
 
mhitrov
newbie
Topic Author
Posts: 34
Joined: Mon Dec 27, 2004 10:30 am

Re: marking packets

Wed Mar 26, 2008 8:28 pm

.
Last edited by mhitrov on Wed Mar 26, 2008 8:31 pm, edited 1 time in total.
 
mhitrov
newbie
Topic Author
Posts: 34
Joined: Mon Dec 27, 2004 10:30 am

Re: marking packets

Wed Mar 26, 2008 8:30 pm

Thanks Martin,

But i want to know what is the difference.

Why to use two marking rules (connection, packet mark) if it is possible to use just one (direct packet mark).

I want to be sure how RouterOS works, in order to make the right configuration.

I saw this technics in the wiki pages.
Code link: http://wiki.mikrotik.com/wiki/Queue_wit ... _Web-Proxy

Thanks again
 
User avatar
hulk-bd
Member Candidate
Member Candidate
Posts: 231
Joined: Mon Sep 03, 2007 7:19 pm
Location: Uttara, Dhaka, Bangladesh

Re: marking packets

Wed Mar 26, 2008 8:56 pm

Dear mhitrov,

Basic of packet marking in MT, you should mark connection first then mark packet for the specific mangle rules. cause for connection tracking marking connection is needed and about passthrough it means the 1st rule will pass to the next one, so you'll always see that kind of passthrough and no passthrough in many rules. 1st passthrough rules stop to the next no passthrough rule, am I clear here? and someone written here that only mark packet rule consume more CPU consumption.

Regards
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8712
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: marking packets

Thu Mar 27, 2008 3:15 am

Why to use two marking rules (connection, packet mark) if it is possible to use just one (direct packet mark).
if it is possible - then you should use it =)

but when you mark connection between A.A.A.A and B.B.B.B, then in mark packet rule you mark both packets from A.A.A.A to B.B.B.B and packets from B.B.B.B to A.A.A.A. how do you plan mark it with one rule?
 
mhitrov
newbie
Topic Author
Posts: 34
Joined: Mon Dec 27, 2004 10:30 am

Re: marking packets

Thu Mar 27, 2008 11:53 am

I think a understand.

In that case it is used masquarading and queueing.

That person uses global-in parent interface for queueing the upload traffic (cause it is masquarading). In that case, we should mark just the uploading traffic (with one mark rule), because through global-in is passed upload and dowload traffic.

that is why you can't use mark conecction (with packet mark), because it will mark both : download and upload traffic (but we need just upload in order to use it in global-in virtual interface).

I hope i'm right.

Thanks to everybody for answers
 
User avatar
patagonia
newbie
Posts: 27
Joined: Mon Jul 24, 2006 8:22 pm
Location: Rawson - Chubut

Re: marking packets

Sun Mar 30, 2008 1:53 am

mhitrov, the difference is based on nat type, if you use masquerade you first need to mark the connection and then the packet because the routing mark need to know for where the flow comes to mark the packets.

Who is online

Users browsing this forum: BartoszP, DoryIII, yawpyng and 21 guests