QoS with service-policy
![](https://assets.st-note.com/img/1689256919819-ForDukE2p9.png?width=1200)
初期設定
・画像の通りにアドレス振って全I/FでOSPFを起動
・iosv-1でiosv-2,0のパケットのDSCP値を変更する
service-policyの設定
[iosv-1にて]
access-list 1 permit host 192.168.12.3
class-map EF
match access-group 1
exit
policy-map EF
class EF
set dscp ef
exit
exit
int gi0/0
service-policy EF
!
access-list 1 permit host 192.168.10.3
class-map CS
match access-group 1
exit
policy-map CS
class EF
set dscp cs7
exit
exit
int gi0/0
service-policy input CS
end
パケットキャプチャ(iosv-1,3間)
![](https://assets.st-note.com/img/1689257921802-7hijljEhpR.png?width=1200)
![](https://assets.st-note.com/img/1689257995536-F8CX8l0yjU.png?width=1200)
CS7だけポリシングしてみる
iosv-3
class-map POLICE
match dscp cs7
exit
policy-map POLICE
class POLICE
police 8000
end
conf t
control-place
service-policy input POLICE
end
iosv-2
[2023-07-13 23:37:30.329] iosv-2#ping 192.168.13.3 repeat 1000
[2023-07-13 23:37:38.114] Type escape sequence to abort.
[2023-07-13 23:37:38.206] Sending 1000, 100-byte ICMP Echos to 192.168.13.3, timeout is 2 seconds:
[2023-07-13 23:37:38.312] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[2023-07-13 23:37:39.350] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[2023-07-13 23:37:40.928] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[2023-07-13 23:37:42.426] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[2023-07-13 23:37:44.033] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[2023-07-13 23:37:45.726] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[2023-07-13 23:37:46.979] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[2023-07-13 23:37:47.787] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[2023-07-13 23:37:49.156] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[2023-07-13 23:37:50.484] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[2023-07-13 23:37:51.417] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[2023-07-13 23:37:52.222] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[2023-07-13 23:37:53.276] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[2023-07-13 23:37:54.784] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[2023-07-13 23:37:55.803] !!!!!!!!!!!!!!!!!!!!
[2023-07-13 23:37:56.122] Success rate is 100 percent (1000/1000), round-trip min/avg/max = 2/9/33 ms
[2023-07-13 23:37:56.222] iosv-2#
iosv-0
[2023-07-13 23:37:31.956] iosv-0#ping 192.168.13.3 repeat 1000
[2023-07-13 23:37:35.483] Type escape sequence to abort.
[2023-07-13 23:37:35.583] Sending 1000, 100-byte ICMP Echos to 192.168.13.3, timeout is 2 seconds:
[2023-07-13 23:37:35.835] !!!!!!!!!!!!!!.!!!!!!!!!!!!!!.!!!!!!!!!!!!!.!!!!!!!!!!!!!!.!!!!!!!!!!!
[2023-07-13 23:37:49.555] !!!.!!!!!!!!!!!!!!.!!!!!!!!!!!!!!.!!!!!!!!!!!!!!.!!!!!!!!!!!!!!.!!!!!!
[2023-07-13 23:38:03.528] !!!!!!!!.!!!!!!!!!!!!!!.!!!!!!!!!!!!!!.!!!!!!!!!!!!!!.!!!!!!!!!!!!!!.!
[2023-07-13 23:38:17.287] !!!!!!!!!!!!!.!!!!!!!!!!!!!!.!!!!!!!!!!!!!!!.!!!!!!!!!!!!!!.!!!!!!!!!!
[2023-07-13 23:38:28.362] !!!!.!!!!!!!!!!!!!!!.!!!!!!!!!!!!!!.!!!!!!!!!!!!!!!.!!!!!!!!!!!!!!.!!!
[2023-07-13 23:38:40.945] !!!!!!!!!!!.!!!!!!!!!!!!!!.!!!!!!!!!!!!!!.!!!!!!!!!!!!!!.!!!!!!!!!!!!!
[2023-07-13 23:38:51.073] !.!!!!!!!!!!!!!!.!!!!!!!!!!!!!!.!!!!!!!!!!!!!!.!!!!!!!!!!!!!!.!!!!!!!!
[2023-07-13 23:39:03.615] !!!!!!.!!!!!!!!!!!!!!.!!!!!!!!!!!!!!.!!!!!!!!!!!!!!.!!!!!!!!!!!!!!.!!!
[2023-07-13 23:39:16.129] !!!!!!!!!!!.!!!!!!!!!!!!!!.!!!!!!!!!!!!!!.!!!!!!!!!!!!!!.!!!!!!!!!!!!!
[2023-07-13 23:39:25.488] !.!!!!!!!!!!!!!!.!!!!!!!!!!!!!!.!!!!!!!!!!!!!!.!!!!!!!!!!!!!!.!!!!!!!!
[2023-07-13 23:39:37.063] !!!!!!.!!!!!!!!!!!!!!.!!!!!!!!!!!!!!.!!!!!!!!!!!!!!.!!!!!!!!!!!!!!.!!!
[2023-07-13 23:39:48.923] !!!!!!!!!!!.!!!!!!!!!!!!!!.!!!!!!!!!!!!!!.!!!!!!!!!!!!!!.!!!!!!!!!!!!!
[2023-07-13 23:39:59.322] !.!!!!!!!!!!!!!!.!!!!!!!!!!!!!!.!!!!!!!!!!!!!!.!!!!!!!!!!!!!!.!!!!!!!!
[2023-07-13 23:40:11.978] !!!!!!.!!!!!!!!!!!!!!.!!!!!!!!!!!!!!.!!!!!!!!!!!!!!.!!!!!!!!!!!!!!.!!!
[2023-07-13 23:40:23.700] !!!!!!!!!!!.!!!!!!!!
[2023-07-13 23:40:26.074] Success rate is 93 percent (934/1000), round-trip min/avg/max = 1/10/39 ms
[2023-07-13 23:40:26.283] iosv-0#
タイムスタンプを見ればわかるが、ほとんど同じタイミングでpingを送信しており、CS7のDSCP値が付くiosv-0のトラフィックにだけポリシングがかかっている。
その結果iosv-0だけpingが定期的に途切れている。
QoSほんといろいろできそうでめっちゃ楽しい。
この記事が気に入ったらサポートをしてみませんか?