In the following example, we will be creating rules to match the following conditions:
- Source: 10.0.0.1/32, destination: 10.0.0.2/32, protocol: ICMP, and permission: allow
- Source: 10.0.0.2/32, destination: 10.0.0.1/32, protocol: ICMP, permission: allow
It should be noted that the rule ID is assigned automatically. To implement the first rule, we will execute the following command on the xterm of the controller:
curl -X POST -d '{"nw_src": "10.0.0.1/32", "nw_dst": "10.0.0.2/32", "nw_proto": "ICMP"}' http://localhost:8080/firewall/rules/0000000000000001
Similarly, we will implement the second rule using the following command:
curl -X POST -d '{"nw_src": "10.0.0.2/32", "nw_dst": "10.0.0.1/32", "nw_proto": "ICMP"}' http://localhost:8080/firewall/rules/0000000000000001