Configuration saving

Pica8 support saving configuration of meters,groups or flows which need to configure again previously after restart the switch system from version 2.8.1.

There are two scripts on /ovs/bin, ovs-pica-save and ovs-pica-load. When you have configured meters,groups or flows, please run ovs-pica-save before restart switch system. And run ovs-pica-load after restart.

Path of ovs-pica-save and ovs-pica-load: /ovs/bin

1.Configure meters.

admin@PicOS-OVS$ovs-ofctl add-meter br0 meter=2,kbps,band=type=dscp_remark,rate=300000,prec_level=14
admin@PicOS-OVS$ovs-ofctl add-meter br0 meter=1,kbps,band=type=drop,rate=300000
admin@PicOS-OVS$ovs-ofctl add-meter br0 meter=3,kbps,burst,band=type=dscp_remark,rate=300000,prec_level=14,burst_size=30000

2.Configure groups.

admin@PicOS-OVS$ovs-ofctl add-group br0 group_id=1,type=indirect,bucket=output:3
admin@PicOS-OVS$ovs-ofctl add-group br0 group_id=2,type=indirect,bucket=set_field:66:66:66:00:00:00-\>dl_src,set_field:66:66:66:11:11:11-\>dl_dst,set_field:200-\>vlan_vid,group:1

3.Add flows.

admin@PicOS-OVS$ovs-ofctl add-flow br0 in_port=1,ip,dl_dst=22:22:22:22:22:22,actions=meter:1,group:1
admin@PicOS-OVS$ovs-ofctl add-flow br0 arp,arp_tpa=192.168.100.100,actions=2

4.Run ovs-pica-save.

admin@PicOS-OVS$ovs-pica-save
Meter configurations are saved to  : /ovs/config/meters
Group configurations are saved to  : /ovs/config/groups
Flow configurations are saved to  : /ovs/config/flows
 
 
Saved successfully!
admin@PicOS-OVS$

5.Restart the switch.

admin@XorPlus$sudo systemctl restart picos

6.Load configuration.

admin@PicOS-OVS$ovs-pica-load
 
Your configuration has been loaded successfully!
admin@PicOS-OVS$

If load failed,user should check files which has been saved in /ovs/config and then modify it.

7.Check after loading configuration.

admin@PicOS-OVS$ovs-ofctl dump-meters br0
OFPST_METER_CONFIG reply (OF1.4) (xid=0x2):
meter=1 kbps bands=
type=drop rate=300000
 
meter=2 kbps bands=
type=dscp_remark rate=300000 prec_level=14
 
meter=3 kbps burst bands=
type=dscp_remark rate=300000 burst_size=30000 prec_level=14
admin@PicOS-OVS$
admin@PicOS-OVS$
admin@PicOS-OVS$ovs-ofctl dump-groups br0
OFPST_GROUP_DESC reply (OF1.4) (xid=0x2):
 group_id=1,type=indirect,bucket=actions=output:3
 group_id=2,type=indirect,bucket=actions=set_field:66:66:66:00:00:00->eth_src,set_field:66:66:66:11:11:11->eth_dst,set_field:200->vlan_vid,group:1
admin@PicOS-OVS$
admin@PicOS-OVS$ovs-ofctl dump-flows br0
OFPST_FLOW reply (OF1.4) (xid=0x2):
 flow_id=6, cookie=0x0, duration=16.841s, table=0, n_packets=n/a, n_bytes=0, arp,arp_tpa=192.168.100.100 actions=output:2
 flow_id=7, cookie=0x0, duration=16.840s, table=0, n_packets=n/a, n_bytes=0, ip,in_port=1,dl_dst=22:22:22:22:22:22 actions=meter:1,group:1
admin@PicOS-OVS$

 

Note:

1)Related configuration in br0 will save to :

Meters: /ovs/config/meters/br0

Groups: /ovs/config/groups/br0

Flows: /ovs/config/flows/br0

User can modify above files to add or delete configuration and then load new configuration.

2)If there is error information when load configuration, user can modify above files too.

3)Load meters firstly and then groups and flows lastly.

 

Copyright © 2024 Pica8 Inc. All Rights Reserved.