Tuesday, September 28, 2021

QoS on Cisco Router (IOS/IOS-XE/IOS-XR)

 for police:



https://www.ccexpert.us/qos-implementing/available-in-cisco-ios-release-1224t.html
http://web.archive.org/web/20210928055220/https://www.ccexpert.us/qos-implementing/available-in-cisco-ios-release-1224t.html


单速率单桶:


单速率双桶:





双速率双桶:
 

https://blog.csdn.net/gongxifacai_believe/article/details/89716997

http://web.archive.org/web/20210928060201/https://blog.csdn.net/gongxifacai_believe/article/details/89716997


configuration QoS On IOS-XR router,

policy-map sdfs

 class CORE_REAL_TIME_CM

  police rate percent 10 burst 10000 bytes peak-rate percent 20 peak-burst 20000 bytes 


CIR: rate                    Committed Information Rate

BC: burst                 Burst size (BC)

BE: peak-burst        Excess Burst size (BE)

PIR: peak-rate          Peak Information Rate

https://www.cisco.com/c/en/us/td/docs/routers/asr9000/software/asr9k-r6-2/qos/configuration/guide/b-qos-cg-asr9000-62x/b-qos-cg-asr9000-62x_chapter_0101.html




RP/0/RSP0/CPU0:ASR9001-K#sh qos interface tenGigE 0/0/2/3 output 
Sun Sep 26 16:49:23.239 UTC
Interface: TenGigE0_0_2_3 output 
Bandwidth configured: 10000000 kbps Bandwidth programed: 10000000 kbps
ANCP user configured: 0 kbps ANCP programed in HW: 0 kbps
Port Shaper programed in HW: 0 kbps 
Policy: fanan Total number of classes: 5
----------------------------------------------------------------------
Level: 0 Policy: anan Class: dscp40
QueueID: 65577 (Priority 2)
Queue Limit: 54 kbytes Abs-Index: 17 Template: 0 Curve: 6
Shape CIR Profile: INVALID
Policer Profile: 56 (SrTCM)
Conform: 4000 kbps (4000 kbps) Burst: 500000 bytes (750 kbytes)
Peak Burst: 500000 bytes (1500 kbytes)
Child Policer Conform: TX
Child Policer Exceed: TX
Child Policer Violate: DROP
----------------------------------------------------------------------
Level: 0 Policy: anan Class: dscp41
QueueID: 65579 (Priority 3)
Queue Limit: 16 kbytes Abs-Index: 8 Template: 0 Curve: 6
Shape CIR Profile: INVALID
Policer Profile: 57 (SrTCM)
Conform: 1000 kbps (1000 kbps) Burst: 12500 bytes (0 Default)   <<<<<<<<
Peak Burst: 12500 bytes (0 Default)
Child Policer Conform: TX
Child Policer Exceed: TX
Child Policer Violate: DROP
----------------------------------------------------------------------
Level: 0 Policy: anan Class: dscp45
QueueID: 65578 (class-default)
Policer Profile: 58 (TrTCM)
Conform: 5000 kbps (5000 kbps) Burst: 62500 bytes (0 Default)
Peak: 6000 kbps (6000 kbps) Burst: 75000 bytes (0 Default)
Child Policer Conform: TX
Child Policer Exceed: TX
Child Policer Violate: DROP
----------------------------------------------------------------------
Level: 0 Policy: anan Class: dscp42
QueueID: 65578 (class-default)
Policer Profile: 59 (Single)
Conform: 2000 kbps (2000000 bps) Burst: 25000 bytes (0 Default)
Child Policer Conform: TX
Child Policer Exceed: TX
Child Policer Violate: TX
----------------------------------------------------------------------
Level: 0 Policy: anan Class: class-default
QueueID: 65578 (Priority Normal)
Queue Limit: 126976 kbytes Abs-Index: 179 Template: 0 Curve: 0
Shape CIR Profile: INVALID
WFQ Profile: 1/9 Committed Weight: 10 Excess Weight: 10
Bandwidth: 0 kbps, BW sum for Level 0: 0 kbps, Excess Ratio: 1
----------------------------------------------------------------------
policy-map anan
 class dscp40
  police rate 4000 kbps burst 750 kbytes peak-burst 1500 kbytes 
   conform-action transmit
   exceed-action transmit
   violate-action drop
  !
  priority level 2 
 !
 class dscp41
  police rate 1000 kbps 
   conform-action transmit
   exceed-action transmit
   violate-action drop
  !
  priority level 3 
 !
 class dscp45
  police rate 5000 kbps peak-rate 6000 kbps 
   conform-action transmit
   exceed-action transmit
   violate-action drop
  !
 !
 class dscp42
  police rate 2000000 bps 
   conform-action transmit
   exceed-action transmit
  !
 !
 class class-default
 !
 end-policy-map
SrTCM:Single Rate Three Color Marker
TrTCM:Two Rate Three Color Marker

Friday, September 24, 2021

Docker install on the RHEL 7

1. install yum-utils 

yum install -y yum-utils

2.  install Docker Yum repo

yum-config-manager  --add-repo https://download.docker.com/linux/centos/docker-ce.repo

3. install Docker Engine

yum install docker-ce docker-ce-cli containerd.io

4 done.


if you have some error log report when setp 3 as below.


[root@japan-tac-161-117 yum.repos.d]# yum install docker-ce
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Resolving Dependencies
--> Running transaction check
---> Package docker-ce.x86_64 3:20.10.8-3.el7 will be installed
--> Processing Dependency: containerd.io >= 1.4.1 for package: 3:docker-ce-20.10.8-3.el7.x86_64
--> Processing Dependency: docker-ce-cli for package: 3:docker-ce-20.10.8-3.el7.x86_64
--> Processing Dependency: docker-ce-rootless-extras for package: 3:docker-ce-20.10.8-3.el7.x86_64
--> Running transaction check
---> Package containerd.io.x86_64 0:1.4.9-3.1.el7 will be installed
---> Package docker-ce-cli.x86_64 1:20.10.8-3.el7 will be installed
--> Processing Dependency: docker-scan-plugin(x86-64) for package: 1:docker-ce-cli-20.10.8-3.el7.x86_64
---> Package docker-ce-rootless-extras.x86_64 0:20.10.8-3.el7 will be installed
--> Processing Dependency: fuse-overlayfs >= 0.7 for package: docker-ce-rootless-extras-20.10.8-3.el7.x86_64
--> Processing Dependency: slirp4netns >= 0.4 for package: docker-ce-rootless-extras-20.10.8-3.el7.x86_64
--> Running transaction check
---> Package docker-ce-rootless-extras.x86_64 0:20.10.8-3.el7 will be installed
--> Processing Dependency: fuse-overlayfs >= 0.7 for package: docker-ce-rootless-extras-20.10.8-3.el7.x86_64
--> Processing Dependency: slirp4netns >= 0.4 for package: docker-ce-rootless-extras-20.10.8-3.el7.x86_64
---> Package docker-scan-plugin.x86_64 0:0.8.0-3.el7 will be installed
--> Finished Dependency Resolution
Error: Package: containerd.io-1.3.7-3.1.el7.aarch64 (docker-ce-stable)
           Requires: container-selinux >= 2:2.74
Error: Package: docker-ce-rootless-extras-20.10.8-3.el7.x86_64 (docker-ce-stable)
           Requires: fuse-overlayfs >= 0.7
Error: Package: docker-ce-rootless-extras-20.10.8-3.el7.x86_64 (docker-ce-stable)
           Requires: slirp4netns >= 0.4
 You could try using --skip-broken to work around the problem

fix step asblow:


[root@japan-tac-161-117 yum.repos.d]#   yum -y install http://mirror.centos.org/centos/7/extras/x86_64/Packages/container-selinux-2.107-3.el7.noarch.rpm
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
container-selinux-2.107-3.el7.noarch.rpm                                                             |  39 kB  00:00:00     
Examining /var/tmp/yum-root-D77sQf/container-selinux-2.107-3.el7.noarch.rpm: 2:container-selinux-2.107-3.el7.noarch
Marking /var/tmp/yum-root-D77sQf/container-selinux-2.107-3.el7.noarch.rpm to be installed
Resolving Dependencies

[root@japan-tac-161-117 yum.repos.d]#   yum -y install http://mirror.centos.org/centos/7/extras/x86_64/Packages/fuse-overlayfs-0.7.2-6.el7_8.x86_64.rpm
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
fuse-overlayfs-0.7.2-6.el7_8.x86_64.rpm                                                              |  54 kB  00:00:00     
Examining /var/tmp/yum-root-D77sQf/fuse-overlayfs-0.7.2-6.el7_8.x86_64.rpm: fuse-overlayfs-0.7.2-6.el7_8.x86_64
Marking /var/tmp/yum-root-D77sQf/fuse-overlayfs-0.7.2-6.el7_8.x86_64.rpm to be installed
Resolving Dependencies

[root@japan-tac-161-117 yum.repos.d]#   yum -y install http://mirror.centos.org/centos/7/extras/x86_64/Packages/slirp4netns-0.4.3-4.el7_8.x86_64.rpm
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
slirp4netns-0.4.3-4.el7_8.x86_64.rpm                                                                 |  81 kB  00:00:00     
Examining /var/tmp/yum-root-D77sQf/slirp4netns-0.4.3-4.el7_8.x86_64.rpm: slirp4netns-0.4.3-4.el7_8.x86_64
Marking /var/tmp/yum-root-D77sQf/slirp4netns-0.4.3-4.el7_8.x86_64.rpm to be installed
Resolving Dependencies



[root@japan-tac-161-117 yum.repos.d]# yum install docker-ce
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Resolving Dependencies
--> Running transaction check
---> Package docker-ce.x86_64 3:20.10.8-3.el7 will be installed
--> Processing Dependency: containerd.io >= 1.4.1 for package: 3:docker-ce-20.10.8-3.el7.x86_64
--> Processing Dependency: docker-ce-cli for package: 3:docker-ce-20.10.8-3.el7.x86_64
--> Processing Dependency: docker-ce-rootless-extras for package: 3:docker-ce-20.10.8-3.el7.x86_64
--> Running transaction check
---> Package containerd.io.x86_64 0:1.4.9-3.1.el7 will be installed
---> Package docker-ce-cli.x86_64 1:20.10.8-3.el7 will be installed
--> Processing Dependency: docker-scan-plugin(x86-64) for package: 1:docker-ce-cli-20.10.8-3.el7.x86_64
---> Package docker-ce-rootless-extras.x86_64 0:20.10.8-3.el7 will be installed
--> Running transaction check
---> Package docker-scan-plugin.x86_64 0:0.8.0-3.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

============================================================================================================================
 Package                               Arch               Version                        Repository                    Size
============================================================================================================================
Installing:
 docker-ce                             x86_64             3:20.10.8-3.el7                docker-ce-stable              23 M
Installing for dependencies:
 containerd.io                         x86_64             1.4.9-3.1.el7                  docker-ce-stable              30 M
 docker-ce-cli                         x86_64             1:20.10.8-3.el7                docker-ce-stable              29 M
 docker-ce-rootless-extras             x86_64             20.10.8-3.el7                  docker-ce-stable             8.0 M
 docker-scan-plugin                    x86_64             0.8.0-3.el7                    docker-ce-stable             4.2 M

Transaction Summary
============================================================================================================================
Install  1 Package (+4 Dependent packages)

Total download size: 94 M
Installed size: 380 M
Is this ok [y/d/N]: y




[guangxil@japan-tac-161-117 ~]$ docker run hello-world
docker: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/containers/create": dial unix /var/run/docker.sock: connect: permission denied.
See 'docker run --help'.
[guangxil@japan-tac-161-117 ~]$ sudo g
Display all 241 possibilities? (y or n)
[guangxil@japan-tac-161-117 ~]$ sudo gpasswd -a guangxil docker
[sudo] password for guangxil: 
Adding user guangxil to group docker
[guangxil@japan-tac-161-117 ~]$ docker run hello-world
docker: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/containers/create": dial unix /var/run/docker.sock: connect: permission denied.
See 'docker run --help'.

[guangxil@japan-tac-161-117 ~]$ exit
logout

Last login: Fri Sep 24 13:01:07 2021 from 
[guangxil@japan-tac-161-117 ~]$ docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
2db29710123e: Pull complete 
Digest: sha256:393b81f0ea5a98a7335d7ad44be96fe76ca8eb2eaa