centos ovn 搭建测试(七:QOS)

QOS 功能验证

# 逻辑交换机及逻辑port创建

# 创建logical switch
ovn-nbctl ls-add ls

# 创建 logical port ls-veth1
ovn-nbctl lsp-add ls ls-veth1
ovn-nbctl lsp-set-addresses ls-veth1 "aa:aa:aa:11:11:aa 1.1.1.100"

# 创建 logical port ls-veth3
ovn-nbctl lsp-add ls ls-veth3
ovn-nbctl lsp-set-addresses ls-veth3 "aa:aa:aa:11:11:bb 1.1.1.200"

# 命名空间配置

# ovn-master:
ip netns add ns1
ip link add veth1 type veth peer name veth2
ifconfig veth1 up
ifconfig veth2 up
ip link set veth2 netns ns1
ip netns exec ns1 ip link set veth2 address aa:aa:aa:11:11:aa
ip netns exec ns1 ip addr add 1.1.1.100/24 dev veth2
ip netns exec ns1 ip link set veth2 up

ovs-vsctl add-port br-int  veth1
ovs-vsctl set Interface veth1 external_ids:iface-id=ls-veth1 

ip netns exec ns1 ip addr show

# ovn-node1:
ip netns add ns2
ip link add veth3 type veth peer name veth4
ifconfig veth3 up
ifconfig veth4 up
ip link set veth4 netns ns2
ip netns exec ns2 ip link set veth4 address aa:aa:aa:11:11:bb
ip netns exec ns2 ip addr add 1.1.1.200/24 dev veth4
ip netns exec ns2 ip link set veth4 up

ovs-vsctl add-port br-int  veth3 
ovs-vsctl set Interface veth3 external_ids:iface-id=ls-veth3 

ip netns exec ns2 ip addr show

# 配置限速

ovn-nbctl set logical_switch_port ls-veth1 options:qos_max_rate=1000000
ovn-nbctl set logical_switch_port ls-veth1 options:qos_burst=1000000

# 查看配置

[root@ovn-master ~]# ovn-nbctl list logical_switch_port 
_uuid               : 88c5182c-71fa-40a2-ab58-f881bb26d9a6
addresses           : ["aa:aa:aa:11:11:bb 1.1.1.200"]
dhcpv4_options      : []
dhcpv6_options      : []
dynamic_addresses   : []
enabled             : []
external_ids        : {}
ha_chassis_group    : []
name                : "ls-veth3"
options             : {}
parent_name         : []
port_security       : []
tag                 : []
tag_request         : []
type                : ""
up                  : true

_uuid               : e3550e6b-4e5b-4643-aa3c-681880155ed3
addresses           : ["aa:aa:aa:11:11:aa 1.1.1.100"]
dhcpv4_options      : []
dhcpv6_options      : []
dynamic_addresses   : []
enabled             : []
external_ids        : {}
ha_chassis_group    : []
name                : "ls-veth1"
options             : {qos_burst="1000000", qos_max_rate="1000000"}
parent_name         : []
port_security       : []
tag                 : []
tag_request         : []
type                : ""
up                  : true

 

posted @ 2022-07-23 10:46  salami_china  阅读(390)  评论(0编辑  收藏  举报