-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvoip-qos
73 lines (57 loc) · 3.88 KB
/
voip-qos
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
Differentiated Service Code Point (DSCP)
'Differentiated Services' is a default network protocol designed to classify and manage network traffic.
It makes use of DSCP values to prioritise latency for certain traffic types over others.
DSCP Name DS Field Value (Dec) IP Precedence (Description)
CS0 0 0: Best Effort
LE 1 n/a
CS1, AF11-13 8, 10, 12, 14 1: Priority
CS2, AF21-23 16, 18, 20, 22 2: Immediate
CS3, AF31-33 24, 26, 28, 30 3: Flash - mainly used for voice signaling
CS4, AF41-43 32, 34, 36, 38 4: Flash Override
CS5, EF 40, 46 5: Critical - mainly used for voice RTP
CS6 48 6: Internetwork Control
CS7 56 7: Network Control
/ip firewall mangle
add action=mark-connection chain=forward comment=SIP dst-address=1.2.3.4 dst-port=5060 \
new-connection-mark=SIP_Connection passthrough=yes protocol=udp
add action=mark-packet chain=forward connection-mark=SIP_Connection new-packet-mark=SIP_Packet \
passthrough=yes
add action=mark-connection chain=forward comment=RTP dst-address=1.2.3.4 new-connection-mark=\
RTP_Connection passthrough=yes port=10000-12000 protocol=udp
add action=mark-packet chain=forward connection-mark=RTP_Connection new-packet-mark=RTP_Packet \
passthrough=yes protocol=udp
add action=change-dscp chain=postrouting comment="DSCP Priority" dst-address=1.2.3.4 new-dscp=46 \
packet-mark=RTP_Packet passthrough=yes
/queue tree
add limit-at=20M max-limit=20M name=Upload parent=pppoe-out1 queue=default
add limit-at=128k max-limit=128k name=Priority1-Up packet-mark=RTP_Packet parent=Upload priority=1 queue=\
default
add limit-at=20k max-limit=20k name=Priority2-Up packet-mark=SIP_Packet parent=Upload priority=2 queue=\
default
add name=Priority3-Up packet-mark=no-mark parent=Upload priority=3 queue=default
add limit-at=20M max-limit=20M name=Download parent=bridge queue=default
add limit-at=128k max-limit=128k name=Priority1-Down packet-mark=RTP_Packet parent=Download priority=1 \
queue=default
add limit-at=20k max-limit=20k name=Priority2-Down packet-mark=SIP_Packet parent=Download priority=2 \
queue=default
add name=Priority3-Down packet-mark=no-mark parent=Download priority=3 queue=default
/ip firewall mangle
add action=mark-connection chain=forward connection-state=new dst-address-list=eutelia dst-port=5060 new-connection-mark=sip-connection passthrough=no protocol=tcp
add action=mark-connection chain=forward connection-state=established,related,new dst-address-list=eutelia dst-port=5060 new-connection-mark=sip-connection passthrough=no \
protocol=udp
add action=mark-connection chain=forward connection-state=established,related,new dst-address-list=eutelia dst-port=3478 new-connection-mark=stun-connection passthrough=\
no protocol=udp
add action=mark-packet chain=forward connection-mark=sip-connection new-packet-mark=SIP passthrough=no
add action=mark-connection chain=forward connection-state=established,related,new dst-address-list=eutelia new-connection-mark=rtp-connection passthrough=no protocol=udp \
src-port=10000-20000
add action=mark-packet chain=forward connection-mark=rtp-connection new-packet-mark=RTP passthrough=no
add action=change-dscp chain=postrouting new-dscp=46 out-interface=bridge1 packet-mark=RTP passthrough=no
/queue tree
add max-limit=20M name=upload parent=ether1 queue=default
add limit-at=2M max-limit=2M name=upload_pri_1 packet-mark=RTP parent=upload priority=1
add limit-at=2M max-limit=2M name=upload_pri_2 packet-mark=SIP parent=upload priority=2
add max-limit=16M name=upload_pri_8 packet-mark=no-mark parent=upload queue=default
add max-limit=50M name=download parent=bridge1 queue=default
add limit-at=2M max-limit=2M name=download_pri_1 packet-mark=RTP parent=download priority=1 queue=default
add limit-at=2M max-limit=2M name=download_pri_2 packet-mark=SIP parent=download priority=2 queue=default
add max-limit=46M name=download_pri_8 packet-mark=no-mark parent=download queue=default