Skip to content

Latest commit

 

History

History
117 lines (104 loc) · 2.31 KB

HELP.md

File metadata and controls

117 lines (104 loc) · 2.31 KB

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.

Src to Dst blocking:

  • 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>
          }
        ]
      }

Allow All/Deny All:

  • 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>
          }
        ]
      }
    }
  ]
}