User Tools

Site Tools


сервис_qos

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Next revision Both sides next revision
сервис_qos [2009/03/26 08:16]
val created
сервис_qos [2018/09/12 14:46]
val [Cisco]
Line 1: Line 1:
 ====== Сервис QOS ====== ====== Сервис QOS ======
-Использование ​ipfw+ 
 +  * [[https://​habr.com/​post/​420525/​|Сети для ​самых матёрых. Часть ​пятнадцатая. QoS]] 
 +===== Cisco ===== 
 + 
 +  * [[https://​www.cisco.com/​c/​en/​us/​support/​docs/​switches/​catalyst-3750-series-switches/​91862-cat3750-qos-config.html|Cisco Catalyst 3750 QoS Configuration Examples]] 
 +  * [[https://​reggle.wordpress.com/​2013/​05/​14/​qos-part-v-hardware-queues-on-35603750-switch-platform/​|QoS part V: hardware queues on 3560/3750 switch platform]] 
 +  * [[http://​cisco-conf.ru/​qos/​90-qos-catalyst-3750-.html|3750 QOS: Общие принципы]] 
 + 
 +==== Включение ==== 
 + 
 +<​code>​ 
 +mls qos 
 +</​code>​ 
 +==== Назначение QOS для трафика c определенным DSCP  ==== 
 + 
 +  * [[https://​dreamforccie.wordpress.com/​2010/​04/​23/​convert-phb-af-to-dscp-decimal-and-vise-versa-its-so-easy/​|Convert PHB AF to DSCP Decimal and Vise Versa: It’s So Easy!]] 
 +  * [[https://​supportforums.cisco.com/​t5/​wan-routing-and-switching/​dscp-qos-value/​td-p/​920725|DSCP - QOS value]] 
 + 
 +<​code>​ 
 +TOS: 0x000068b8 
 + 
 +show mls qos maps dscp-output-q 
 + 
 +interface GigabitEthernet1/​0/​1 
 + mls qos trust dscp 
 +</​code>​ 
 + 
 +==== Назначение DSCP для трафика c определенным профилем ==== 
 + 
 +<​code>​ 
 +no ip access-list extended IP-Communicator 
 +ip access-list extended IP-Communicator 
 +! permit udp any any range 10000 20000 
 +! permit ip any host 195.19.32.11 
 + ​permit ip host 195.19.32.11 any 
 + 
 +class-map match-all Class-B 
 + match access-group name IP-Communicator 
 + 
 +policy-map sample-policy2 
 + class Class-B 
 +  set dscp ef 
 + 
 +interface GigabitEthernet1/​0/​2 
 + ​service-policy input sample-policy2 
 +</​code>​ 
 + 
 +==== Назначение QOS для трафика отдельного порта ==== 
 + 
 +<​code>​ 
 +show mls qos maps cos-output-q 
 + 
 +interface GigabitEthernet1/​0/​1 
 + mls qos cos 5 
 + mls qos trust cos  
 +</​code>​ 
 + 
 +==== Выделение полосы ​в магистральном соединении для трафика с определенным QOS ==== 
 + 
 +<​code>​ 
 +sh mls qos queue-set 
 + 
 +show mls qos interface g1/0/47 queueing 
 + 
 +interface GigabitEthernet1/​0/​47 
 +! Full priority for q1 
 + ​srr-queue bandwidth shape 0 0 0 0 
 + ​srr-queue bandwidth share 255 1 1 1 
 + 
 +! 1/20 band for q1 
 + ​srr-queue bandwidth shape 20 0 0 0 
 + ​srr-queue bandwidth share 1 1 1 1 
 + 
 +clear mls qos interface g1/0/47 statistics 
 +show mls qos interface g1/0/47 statistics | inc queue 
 +</​code>​
  
 ===== Равномерное ограничение полосы для всех с исключениями ===== ===== Равномерное ограничение полосы для всех с исключениями =====
 +
 +==== FreeBSD (ipfw) ====
 <​code>​ <​code>​
-[gX:~] # cat /​etc/​ipfw.conf +[gate:~] # cat /​etc/​ipfw.conf 
-pipe 1 config bw 64kbit/s mask dst-ip 0xffffffff +</​code><​code>​ 
-pipe 2 config bw 100mbit/s+pipe 1 config bw 100mbit/s 
 +pipe 2 config bw 64kbit/s mask dst-ip 0xffffffff
  
-add 10 pipe ip from any to 192.168.100+X.2 +add 10 pipe ip from any to 192.168.100+X.2 
-add 20 pipe ip from any to 192.168.100+X.0/​24+add 20 pipe ip from any to 192.168.100+X.0/​24
  
 add 100 allow ip from any to any add 100 allow ip from any to any
- +</​code><​code>​ 
-[gX:~] # cat /​etc/​rc.conf +[gate:~] # cat /​etc/​rc.conf 
-+</​code><​code>​ 
 +... 
 +dummynet_enable=yes
 firewall_enable="​YES"​ firewall_enable="​YES"​
 firewall_type="/​etc/​ipfw.conf"​ firewall_type="/​etc/​ipfw.conf"​
-+</​code><​code>​ 
 +[gate:~] # /​etc/​rc.d/​ipfw start 
 + 
 +[gate:~] # ipfw pipe show 
 +</​code>​ 
 +===== Балансировка нагрузки между провайдерами ===== 
 + 
 +==== FreeBSD (pf) ==== 
 + 
 +http://​www.openbsd.org/​faq/​pf/​pools.html 
 +<​code>​ 
 +[gate:~] # cat /​etc/​pf.conf 
 +</​code><​code>​ 
 +lan_net = "​192.168.1X.0/​24"​ 
 +int_if ​ = "​tap0"​ 
 +ext_if1 = "​fxp0"​ 
 +ext_if2 = "​rl0"​ 
 +ext_gw1 = "​10.10.105.100"​ 
 +ext_gw2 = "​172.16.7.2"​ 
 + 
 +nat on $ext_if1 from $lan_net to any -> ($ext_if1) 
 +nat on $ext_if2 from $lan_net to any -> ($ext_if2)
  
-[gX:~] # kldload dummynet+pass in on $int_if route-to \ 
 +    { ($ext_if1 $ext_gw1), ($ext_if2 $ext_gw2) } round-robin \ 
 +    proto tcp from $lan_net to any flags S/SA modulate state 
 +pass in on $int_if route-to \ 
 +    { ($ext_if1 $ext_gw1), ($ext_if2 $ext_gw2) } round-robin \ 
 +    proto { udp, icmp } from $lan_net to any keep state
  
-[gX:~] # /​etc/​rc.d/​ipfw start+pass out on $ext_if1 route-to ($ext_if2 $ext_gw2) from $ext_if2 \ 
 +   to any 
 +pass out on $ext_if2 route-to ($ext_if1 $ext_gw1) from $ext_if1 \ 
 +   to any
 </​code>​ </​code>​
сервис_qos.txt · Last modified: 2020/05/07 07:37 by val