Skip to content

Instantly share code, notes, and snippets.

@dangtrinhnt
Created February 6, 2018 13:45
Show Gist options
  • Save dangtrinhnt/f4bd833ca903754228fb021ddf2f412d to your computer and use it in GitHub Desktop.
Save dangtrinhnt/f4bd833ca903754228fb021ddf2f412d to your computer and use it in GitHub Desktop.
Deploy QoS VNF with OpenWRT
tosca_definitions_version: tosca_simple_profile_for_nfv_1_0_0
description: OpenWRT with QoS services
metadata:
template_name: OpenWRT
topology_template:
node_templates:
VDU1:
type: tosca.nodes.nfv.VDU.Tacker
capabilities:
nfv_compute:
properties:
num_cpus: 1
mem_size: 512 MB
disk_size: 1 GB
properties:
image: OpenWRT
config:
qos: |
package qos
# default openwrt QoS config
config interface 'wan'
option classgroup 'Default'
option upload '1000'
option download '16000'
option enabled '1'
config classify
option target 'Priority'
option ports '22,53'
option comment 'ssh, dns'
config classify
option target 'Normal'
option proto 'tcp'
option ports '20,21,25,80,110,443,993,995'
option comment 'ftp, smtp, http(s), imap'
config classify
option target 'Express'
option ports '5190'
option comment 'AOL, iChat, ICQ'
config default
option target 'Express'
option proto 'udp'
option pktsize '-500'
config reclassify
option target 'Priority'
option proto 'icmp'
config default
option target 'Bulk'
option portrange '1024-65535'
config classgroup 'Default'
option classes 'Priority Express Normal Bulk'
option default 'Normal'
config class 'Priority'
option packetsize '400'
option avgrate '10'
option priority '20'
config class 'Priority_down'
option packetsize '1000'
option avgrate '10'
config class 'Express'
option packetsize '1000'
option avgrate '50'
option priority '10'
config class 'Normal'
option packetsize '1500'
option packetdelay '100'
option avgrate '10'
option priority '5'
config class 'Normal_down'
option avgrate '20'
config class 'Bulk'
option avgrate '1'
option packetdelay '200'
mgmt_driver: openwrt
monitoring_policy:
name: ping
parameters:
count: 3
interval: 10
actions:
failure: respawn
CP1:
type: tosca.nodes.nfv.CP.Tacker
properties:
management: true
anti_spoofing_protection: false
requirements:
- virtualLink:
node: VL1
- virtualBinding:
node: VDU1
VL1:
type: tosca.nodes.nfv.VL
properties:
network_name: net_mgmt
vendor: Tacker
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment