SD-WAN

 View Only
last person joined: 12 days ago 

Forum to discuss HPE Aruba EdgeConnect SD-WAN and SD-Branch solutions. This includes SD-WAN Orchestration WAN edge network functions - routing, security, zone-based firewall, segmentation and WAN optimization, micro-branch solutions, best practics, and third-party integrations. All things SD-WAN!
Expand all | Collapse all

CURL with an drop "apply_actions"

This thread has been viewed 0 times
  • 1.  CURL with an drop "apply_actions"

    Posted Mar 25, 2014 10:44 AM

    Hello, 

     

    I don't know how to add "drop" as an apply_actions:

     

     

    curl --noproxy 130.223.16.128 --header 'X-Auth-Token: a97daad3ea18489eb38c8c6a7ae5236e' --header "Accept: application/json" --header "Content-type: application/json" --fail -ksSfL -X POST -d '{"flow":{"priority":20,"table_id":100,"idle_timeout":60,"match":[{"eth_type":"arp"}],"instructions":[{"apply_actions":[{"drop"}]}]}}' --url https://130.223.16.128:8443/sdn/v2.0/of/datapaths/00:14:f0:92:1c:21:fa:c0/flows

     

    I obtained:  curl: (22) The requested URL returned error: 400 Bad Request

     

    Do you know how to do that ?



  • 2.  RE: CURL with an drop "apply_actions"

    EMPLOYEE
    Posted Mar 25, 2014 05:14 PM

    Hi sbotkine,

     

    The way to accomplish a drop is with an empty list of actions. That's the way it's accomplished in the OpenFlow spec, so that's how it's accomplished through the controller's REST API as well.



  • 3.  RE: CURL with an drop "apply_actions"

    Posted Mar 28, 2014 04:57 PM

    Hello sbotkine,

     

    We hope the response from Shaun answers your query.

    Please feel free to reply incase you have more questions around the same topic or open a new thread if new topic.

     

    Thanks

    HP SDN Team



  • 4.  RE: CURL with an drop "apply_actions"

    Posted Aug 27, 2015 06:24 AM

    Please can you give an example of the curl command for this.

    I keep getting ivaliud json format.

     

    Cheers,

    Dave.



  • 5.  RE: CURL with an drop "apply_actions"

    EMPLOYEE
    Posted Aug 27, 2015 07:23 AM

     

    Hi,

     

    as per the answer already marked as the solution of this thread, please just leave the apply_action section empty.

    This will drop packets:

     

    curl --noproxy 130.223.16.128 --header 'X-Auth-Token: a97daad3ea18489eb38c8c6a7ae5236e' --header "Accept: application/json" --header "Content-type: application/json" --fail -ksSfL -X POST -d '{"flow":{"priority":20,"table_id":100,"idle_timeo​ut":60,"match":[{"eth_type":"arp"}],"instructions"​:[{"apply_actions":[{""}]}]}}'

     

    Regards,

     

    Antonio

    SDN Team



  • 6.  RE: CURL with an drop "apply_actions"

    Posted Aug 27, 2015 08:36 AM

    OK, I worked it out.

     

    To add or remove a drop action for specific IP or IP range>

     

    curl --header "X-Auth-Token:$AUTH_TOKEN" -H "Content-Type:application/json" -ksS --url "https://$CONTROLER_IP:8443/sdn/v2.0/of/datapaths/$SW_DPID/flows" -d "{\"flow\": {\"priority\": 20100,\"table_id\":100,\"idle_timeout\": 60000,\"match\": [{\"ipv4_dst\":\"10.0.0.120\",\"mask\":\"255.255.255.255\"},{\"eth_type\": \"ipv4\"}]}}" --request POST


    curl --header "X-Auth-Token:$AUTH_TOKEN" -H "Content-Type:application/json" -ksS --url "https://$CONTROLER_IP:8443/sdn/v2.0/of/datapaths/$SW_DPID0/flows" -d "{\"flow\": {\"priority\": 20100,\"table_id\":100,\"idle_timeout\": 60000,\"match\": [{\"ipv4_dst\":\"10.1.0.120\",\"mask\":\"255.255.255.255\"},{\"eth_type\": \"ipv4\"}]}}" --request DELETE

     

    Dave.


    #SDN
    #droppackets
    #VAN
    #rest