Skip to content

Instantly share code, notes, and snippets.

@TheAnonymous
Created February 15, 2015 22:08
Show Gist options
  • Save TheAnonymous/778eda90004a7c9a6d28 to your computer and use it in GitHub Desktop.
Save TheAnonymous/778eda90004a7c9a6d28 to your computer and use it in GitHub Desktop.
curl "http://192.168.178.1:49000/upnp/control/WANIPConn1" -H 'Content-Type: text/xml; charset="utf-8"' -H 'SoapAction: urn:schemas-upnp-org:service:WANIPConnection:1#AddPortMapping' -d '<?xml version="1.0" encoding="utf-8"?> <s:Envelope s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:Body><u:AddPortMapping xmlns:u="urn:schemas-upnp-org:service:WANIPConnection:1"><NewRemoteHost /><NewExternalPort>44</NewExternalPort><NewProtocol>TCP</NewProtocol><NewInternalPort>55</NewInternalPort><NewInternalClient>192.168.178.55</NewInternalClient><NewEnabled>1</NewEnabled><NewPortMappingDescription /><NewLeaseDuration>0</NewLeaseDuration></u:AddPortMapping></s:Body> </s:Envelope>'
curl "http://192.168.1.xxx:49000/upnp/control/WANIPConn1" -H 'Content-Type: text/xml; charset="utf-8"' -H 'SoapAction: urn:schemas-upnp-org:service:WANIPConnection:1#DeletePortMapping' -d '<?xml version="1.0" encoding="utf-8"?> <s:Envelope s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:Body><u:DeletePortMapping xmlns:u="urn:schemas-upnp-org:service:WANIPConnection:1"><NewRemoteHost></NewRemoteHost><NewExternalPort>44</NewExternalPort><NewProtocol>TCP</NewProtocol></u:DeletePortMapping></s:Body> </s:Envelope>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment