How to get the same functionality even if the app doesn't work?
All the similar functionalities can be easily implemented using the /flows
route in ONOS Core REST API.
use this JSON as reference(to set an DENY rule):
{
"flows" : [
{
"priority" : 127 ,
"timeout" : 0 ,
"isPermanent" : true ,
"deviceId" : <ID-OF-DEVICE-CONNECTED_TO_EITHER_SRC_OR_DST>,
"treatment" : {
"instructions" : [
]
},
"selector" : {
"criteria" : [
{
"type" : " ETH_TYPE" ,
"ethType" : " 0x0800"
},
{
"type" : " ETH_SRC" ,
"mac" : <MAC-OF-SRC>
},
{
"type" : " ETH_DST" ,
"mac" : <MAC-OF-DST>
},
{
"type" : " IP_PROTO" ,
"protocol" : <PROTOCOL-TO-BLOCK>
}
]
}
}
]
}
to make an ALLOW rule, replace the treatment section with this:
"treatment" : {
"instructions" : [
"type" : " OUTPUT" ,
"port" : " CONTROLLER"
]
}
Device wise port blocking:
Similar to that of above, just replace the selector section with this:
"selector" : {
"criteria" : [
{
"type" : " ETH_TYPE" ,
"ethType" : " 0x0800"
},
{
"type" : " IN_PORT" ,
"mac" : <PORT-TO-BLOCK>
},
{
"type" : " IN_PHY_PORT" ,
"mac" : <PORT-TO-BLOCK>
},
{
"type" : " IP_PROTO" ,
"protocol" : <PROTOCOL-TO-BLOCK>
}
]
}
For allow all, delete all rules that are denying traffic of the particular protocol.
For deny all, collect all device ids currently present, and add the following rule for every device Id:
{
"flows" : [
{
"priority" : 127 ,
"timeout" : 0 ,
"isPermanent" : true ,
"deviceId" : <ID-OF-DEVICE>,
"treatment" : {
"instructions" : [
]
},
"selector" : {
"criteria" : [
{
"type" : " ETH_TYPE" ,
"ethType" : " 0x0800"
},
{
"type" : " IP_PROTO" ,
"protocol" : <PROTOCOL-TO-BLOCK>
}
]
}
}
]
}