curl을 사용하여 upnp 요청을 보내는 방법


3

UPnP를 사용하여 포트 포워드를 추가하는 방법을 찾으려고합니다 .upnp를 켜고 http://192.168.1.254:52869/gateconnSCPD.xmlupnp 서비스가 켜져있는 메나에 액세스 할 수 는 있지만 검색을 사용하여 실제로 미란다 가 upnp 서버를 찾을 수는 없습니다. 그 부분은 실제로 작동하지 않습니다. 나는 요청의 순수한 예를 찾았지만 workig도 찾지 못했습니다.

curl 'http://192.168.1.254:52869/Public_UPNP_C3' \
  -X 'POST' \
  -H 'Content-Type: text/xml; charset="utf-8"' \
  -H 'Connection: close' \
  -H 'SOAPAction: "urn:schemas-upnp-org:service:WANIPConnection:1#AddPortMapping"' \
  -d '<?xml version="1.0"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<u:AddPortMapping xmlns:u="urn:schemas-upnp-org:service:WANIPConnection:1">
  <NewRemoteHost></NewRemoteHost>
  <NewExternalPort>27015</NewExternalPort>
  <NewProtocol>TCP</NewProtocol>
  <NewInternalPort>27015</NewInternalPort>
  <NewInternalClient>192.168.1.2</NewInternalClient>
  <NewEnabled>1</NewEnabled>
  <NewPortMappingDescription>node:nat:upnp</NewPortMappingDescription>
  <NewLeaseDuration>10</NewLeaseDuration>
</u:AddPortMapping>
</s:Body>
</s:Envelope>'

upnp를 통해 포트 포워드를 열 수있는 "간단한"요청이 있습니까?


1
일반적으로 UPnP 설정의 무언가가 제대로 작동하지 않지만 찾을 정보가 충분하지 않은 것 같습니다. 라우터는 UPnP 설정이 작동하면, 당신은 사용 예 수 upnpc로부터를 miniupnpc라우터에 포트 포워딩을 추가 할 수 있습니다. 나는 그것을 curl손수 만든 요청 으로 할 수 있는지 확실하지 않습니다 .
— dirkt

TNX upnpc를 시도했지만 GetExternalIPAddress 오류가 발생했습니다. (errorcode = 399)
— Slobodan Vidovic

소스 호스트에서 upnpc를 사용하고 있습니까?
— laplasz

아니, 나는 그것을 씹지 않을거야 tnx
— Slobodan Vidovic
당사 사이트를 사용함과 동시에 당사의 쿠키 정책과 개인정보 보호정책을 읽고 이해하였음을 인정하는 것으로 간주합니다.
Licensed under cc by-sa 3.0 with attribution required.