This repository has been archived by the owner on Jun 8, 2024. It is now read-only.
forked from alanmcgovern/Mono.Nat
-
Notifications
You must be signed in to change notification settings - Fork 99
ConsoleTest
lontivero edited this page Apr 29, 2015
·
1 revision
ConsoleTest is a simple windows console .NET applications that performs just a couple of verifications in order to determinate if the NAT device is there and has UPnp or PNP enabled. It
- Gets the external IP address,
- Creates a new mapping [ExternalIP]:1700 -> [InternalIP]:1600,
- Gets the existing port mapping list and display it,
- Deletes the created mapping [ExternalIP]:1700 -> [InternalIP]:1600 and,
- Verifies it was deleted
Use ConsoleTest to perform a quick test and to detect problem. Following you have a detailed-real-world output where you can see (in different color) what's going on, the full trace, client's requests and server's response, additional information, warnings, errors and more.
OpenNat - Information > Initializing
OpenNat - Information > StartDiscovery
OpenNat - Information > Searching
OpenNat - Information > Searching for: UpnpSearcher
OpenNat - Information > Searching for: PmpSearcher
OpenNat - Verbose > UPnP Response: HTTP/1.1 200 OK
Server: Custom/1.0 UPnP/1.0 Proc/Ver
EXT:
Location: http://10.0.0.2:5431/dyndev/uuid:0000e068-20a0-00e0-20a0-48a8000808e0
Cache-Control:max-age=1800
ST:urn:schemas-upnp-org:service:WANIPConnection:1
USN:uuid:0000e068-20a0-00e0-20a0-48a802086048::urn:schemas-upnp-org:service:WANIPConnection:1
OpenNat - Information > UPnP Response: Router advertised a 'urn:schemas-upnp-org:service:WANIPConnection:1' service!!!
OpenNat - Information > Found device at: http://10.0.0.2:5431/dyndev/uuid:0000e068-20a0-00e0-20a0-48a8000808e0
OpenNat - Information > 10.0.0.2:5431: Fetching service list
OpenNat - Information > Found device at: http://10.0.0.2:5431/dyndev/uuid:0000e068-20a0-00e0-20a0-48a8000808e0
OpenNat - Information > 10.0.0.2:5431: Parsed services list
OpenNat - Information > 10.0.0.2:5431: Found service: urn:schemas-upnp-org:service:WANPPPConnection:1
OpenNat - Information > 10.0.0.2:5431: Found upnp service at: /uuid:0000e068-20a0-00e0-20a0-48a802086048/WANPPPConnection:1
OpenNat - Information > 10.0.0.2:5431: Handshake Complete
OpenNat - Information > UpnpNatDevice device found.
OpenNat - Information > ---------------------VVV
EndPoint: 10.0.0.2:5431
Control Url: http://10.0.0.2:5431/uuid:0000e068-20a0-00e0-20a0-48a802086048/WANPPPConnection:1
Service Type: urn:schemas-upnp-org:service:WANPPPConnection:1
Last Seen: 20/05/2014 12:12:56 a.m.
OpenNat - Verbose > SOAPACTION: **GetExternalIPAddress** url:http://10.0.0.2:5431/uuid:0000e068-20a0-00e0-20a0-48a802086048/WANPPPConnection
:1
OpenNat - Verbose > <s:Envelope
xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"
s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<u:GetExternalIPAddress xmlns:u="urn:schemas-upnp-org:service:WANPPPConnection:1">
</u:GetExternalIPAddress>
</s:Body>
</s:Envelope>
OpenNat - Information > Searching for: PmpSearcher
OpenNat - Verbose > UPnP Response: HTTP/1.1 200 OK
Server: Custom/1.0 UPnP/1.0 Proc/Ver
EXT:
Location: http://10.0.0.2:5431/dyndev/uuid:0000e068-20a0-00e0-20a0-48a8000808e0
Cache-Control:max-age=1800
ST:urn:schemas-upnp-org:service:WANPPPConnection:1
USN:uuid:0000e068-20a0-00e0-20a0-48a802086048::urn:schemas-upnp-org:service:WANPPPConnection:1
OpenNat - Information > UPnP Response: Router advertised a 'urn:schemas-upnp-org:service:WANPPPConnection:1' service!!!
OpenNat - Information > Found device at: http://10.0.0.2:5431/dyndev/uuid:0000e068-20a0-00e0-20a0-48a8000808e0
OpenNat - Verbose > Response:
<?xml version="1.0"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<m:GetExternalIPAddressResponse xmlns:m="urn:schemas-upnp-org:service:WANPPPConnection:1">
<NewExternalIPAddress>181.110.171.204</NewExternalIPAddress>
</m:GetExternalIPAddressResponse>
</s:Body>
</s:Envelope>
OpenNat - Verbose > SOAPACTION: **AddPortMapping** url:http://10.0.0.2:5431/uuid:0000e068-20a0-00e0-20a0-48a802086048/WANPPPConnection:1
OpenNat - Verbose > <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:WANPPPConnection:1">
<NewRemoteHost></NewRemoteHost>
<NewExternalPort>1700</NewExternalPort>
<NewProtocol>TCP</NewProtocol>
<NewInternalPort>1600</NewInternalPort>
<NewInternalClient>10.0.0.6</NewInternalClient>
<NewEnabled>1</NewEnabled>
<NewPortMappingDescription>Open.Nat Testing</NewPortMappingDescription>
<NewLeaseDuration>0</NewLeaseDuration>
</u:AddPortMapping>
</s:Body>
</s:Envelope>
OpenNat - Information > Searching for: PmpSearcher
OpenNat - Verbose > Response:
<?xml version="1.0"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<m:AddPortMappingResponse xmlns:m="urn:schemas-upnp-org:service:WANPPPConnection:1">
</m:AddPortMappingResponse>
</s:Body>
</s:Envelope>
OpenNat - Verbose > SOAPACTION: **GetGenericPortMappingEntry** url:http://10.0.0.2:5431/uuid:0000e068-20a0-00e0-20a0-48a802086048/WANPPPConn
ection:1
OpenNat - Verbose > <s:Envelope
xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"
s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<u:GetGenericPortMappingEntry xmlns:u="urn:schemas-upnp-org:service:WANPPPConnection:1">
<NewPortMappingIndex>0</NewPortMappingIndex>
</u:GetGenericPortMappingEntry>
</s:Body>
</s:Envelope>
OpenNat - Verbose > Response:
<?xml version="1.0"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<m:GetGenericPortMappingEntryResponse xmlns:m="urn:schemas-upnp-org:service:WANPPPConnection:1">
<NewRemoteHost>
</NewRemoteHost>
<NewExternalPort>21807</NewExternalPort>
<NewProtocol>TCP</NewProtocol>
<NewInternalPort>32400</NewInternalPort>
<NewInternalClient>10.0.0.5</NewInternalClient>
<NewEnabled>1</NewEnabled>
<NewPortMappingDescription>Plex Media Server</NewPortMappingDescription>
<NewLeaseDuration>0</NewLeaseDuration>
</m:GetGenericPortMappingEntryResponse>
</s:Body>
</s:Envelope>
OpenNat - Verbose > SOAPACTION: **GetGenericPortMappingEntry** url:http://10.0.0.2:5431/uuid:0000e068-20a0-00e0-20a0-48a802086048/WANPPPConn
ection:1
OpenNat - Verbose > <s:Envelope
xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"
s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<u:GetGenericPortMappingEntry xmlns:u="urn:schemas-upnp-org:service:WANPPPConnection:1">
<NewPortMappingIndex>1</NewPortMappingIndex>
</u:GetGenericPortMappingEntry>
</s:Body>
</s:Envelope>
OpenNat - Verbose > Response:
<?xml version="1.0"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<m:GetGenericPortMappingEntryResponse xmlns:m="urn:schemas-upnp-org:service:WANPPPConnection:1">
<NewRemoteHost>
</NewRemoteHost>
<NewExternalPort>25911</NewExternalPort>
<NewProtocol>UDP</NewProtocol>
<NewInternalPort>25911</NewInternalPort>
<NewInternalClient>10.0.0.6</NewInternalClient>
<NewEnabled>1</NewEnabled>
<NewPortMappingDescription>Skype UDP at 10.0.0.6:25911 (2695)</NewPortMappingDescription>
<NewLeaseDuration>0</NewLeaseDuration>
</m:GetGenericPortMappingEntryResponse>
</s:Body>
</s:Envelope>
OpenNat - Verbose > SOAPACTION: **GetGenericPortMappingEntry** url:http://10.0.0.2:5431/uuid:0000e068-20a0-00e0-20a0-48a802086048/WANPPPConn
ection:1
OpenNat - Verbose > <s:Envelope
xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"
s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<u:GetGenericPortMappingEntry xmlns:u="urn:schemas-upnp-org:service:WANPPPConnection:1">
<NewPortMappingIndex>2</NewPortMappingIndex>
</u:GetGenericPortMappingEntry>
</s:Body>
</s:Envelope>
OpenNat - Verbose > Response:
<?xml version="1.0"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<m:GetGenericPortMappingEntryResponse xmlns:m="urn:schemas-upnp-org:service:WANPPPConnection:1">
<NewRemoteHost>
</NewRemoteHost>
<NewExternalPort>25911</NewExternalPort>
<NewProtocol>TCP</NewProtocol>
<NewInternalPort>25911</NewInternalPort>
<NewInternalClient>10.0.0.6</NewInternalClient>
<NewEnabled>1</NewEnabled>
<NewPortMappingDescription>Skype TCP at 10.0.0.6:25911 (2695)</NewPortMappingDescription>
<NewLeaseDuration>0</NewLeaseDuration>
</m:GetGenericPortMappingEntryResponse>
</s:Body>
</s:Envelope>
OpenNat - Verbose > SOAPACTION: **GetGenericPortMappingEntry** url:http://10.0.0.2:5431/uuid:0000e068-20a0-00e0-20a0-48a802086048/WANPPPConn
ection:1
OpenNat - Verbose > <s:Envelope
xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"
s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<u:GetGenericPortMappingEntry xmlns:u="urn:schemas-upnp-org:service:WANPPPConnection:1">
<NewPortMappingIndex>3</NewPortMappingIndex>
</u:GetGenericPortMappingEntry>
</s:Body>
</s:Envelope>
OpenNat - Verbose > Response:
<?xml version="1.0"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<m:GetGenericPortMappingEntryResponse xmlns:m="urn:schemas-upnp-org:service:WANPPPConnection:1">
<NewRemoteHost>
</NewRemoteHost>
<NewExternalPort>1700</NewExternalPort>
<NewProtocol>TCP</NewProtocol>
<NewInternalPort>1600</NewInternalPort>
<NewInternalClient>10.0.0.6</NewInternalClient>
<NewEnabled>1</NewEnabled>
<NewPortMappingDescription>Open.Nat Testing</NewPortMappingDescription>
<NewLeaseDuration>0</NewLeaseDuration>
</m:GetGenericPortMappingEntryResponse>
</s:Body>
</s:Envelope>
OpenNat - Verbose > SOAPACTION: **GetGenericPortMappingEntry** url:http://10.0.0.2:5431/uuid:0000e068-20a0-00e0-20a0-48a802086048/WANPPPConn
ection:1
OpenNat - Verbose > <s:Envelope
xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"
s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<u:GetGenericPortMappingEntry xmlns:u="urn:schemas-upnp-org:service:WANPPPConnection:1">
<NewPortMappingIndex>4</NewPortMappingIndex>
</u:GetGenericPortMappingEntry>
</s:Body>
</s:Envelope>
OpenNat - Information > Searching for: PmpSearcher
OpenNat - Warning > Server failed with error: 713 - SpecifiedArrayIndexInvalid
OpenNat - Verbose > SOAPACTION: **DeletePortMapping** url:http://10.0.0.2:5431/uuid:0000e068-20a0-00e0-20a0-48a802086048/WANPPPConnection:1
OpenNat - Verbose > <s:Envelope
xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"
s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<u:DeletePortMapping xmlns:u="urn:schemas-upnp-org:service:WANPPPConnection:1">
<NewRemoteHost></NewRemoteHost>
<NewExternalPort>1700</NewExternalPort>
<NewProtocol>TCP</NewProtocol>
</u:DeletePortMapping>
</s:Body>
</s:Envelope>
OpenNat - Verbose > Response:
<?xml version="1.0"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<m:DeletePortMappingResponse xmlns:m="urn:schemas-upnp-org:service:WANPPPConnection:1">
</m:DeletePortMappingResponse>
</s:Body>
</s:Envelope>
OpenNat - Verbose > SOAPACTION: **GetGenericPortMappingEntry** url:http://10.0.0.2:5431/uuid:0000e068-20a0-00e0-20a0-48a802086048/WANPPPConn
ection:1
OpenNat - Verbose > <s:Envelope
xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"
s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<u:GetGenericPortMappingEntry xmlns:u="urn:schemas-upnp-org:service:WANPPPConnection:1">
<NewPortMappingIndex>0</NewPortMappingIndex>
</u:GetGenericPortMappingEntry>
</s:Body>
</s:Envelope>
OpenNat - Verbose > Response:
<?xml version="1.0"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<m:GetGenericPortMappingEntryResponse xmlns:m="urn:schemas-upnp-org:service:WANPPPConnection:1">
<NewRemoteHost>
</NewRemoteHost>
<NewExternalPort>21807</NewExternalPort>
<NewProtocol>TCP</NewProtocol>
<NewInternalPort>32400</NewInternalPort>
<NewInternalClient>10.0.0.5</NewInternalClient>
<NewEnabled>1</NewEnabled>
<NewPortMappingDescription>Plex Media Server</NewPortMappingDescription>
<NewLeaseDuration>0</NewLeaseDuration>
</m:GetGenericPortMappingEntryResponse>
</s:Body>
</s:Envelope>
OpenNat - Verbose > SOAPACTION: **GetGenericPortMappingEntry** url:http://10.0.0.2:5431/uuid:0000e068-20a0-00e0-20a0-48a802086048/WANPPPConn
ection:1
OpenNat - Verbose > <s:Envelope
xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"
s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<u:GetGenericPortMappingEntry xmlns:u="urn:schemas-upnp-org:service:WANPPPConnection:1">
<NewPortMappingIndex>1</NewPortMappingIndex>
</u:GetGenericPortMappingEntry>
</s:Body>
</s:Envelope>
OpenNat - Verbose > Response:
<?xml version="1.0"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<m:GetGenericPortMappingEntryResponse xmlns:m="urn:schemas-upnp-org:service:WANPPPConnection:1">
<NewRemoteHost>
</NewRemoteHost>
<NewExternalPort>25911</NewExternalPort>
<NewProtocol>UDP</NewProtocol>
<NewInternalPort>25911</NewInternalPort>
<NewInternalClient>10.0.0.6</NewInternalClient>
<NewEnabled>1</NewEnabled>
<NewPortMappingDescription>Skype UDP at 10.0.0.6:25911 (2695)</NewPortMappingDescription>
<NewLeaseDuration>0</NewLeaseDuration>
</m:GetGenericPortMappingEntryResponse>
</s:Body>
</s:Envelope>
OpenNat - Verbose > SOAPACTION: **GetGenericPortMappingEntry** url:http://10.0.0.2:5431/uuid:0000e068-20a0-00e0-20a0-48a802086048/WANPPPConn
ection:1
OpenNat - Verbose > <s:Envelope
xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"
s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<u:GetGenericPortMappingEntry xmlns:u="urn:schemas-upnp-org:service:WANPPPConnection:1">
<NewPortMappingIndex>2</NewPortMappingIndex>
</u:GetGenericPortMappingEntry>
</s:Body>
</s:Envelope>
OpenNat - Verbose > Response:
<?xml version="1.0"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<m:GetGenericPortMappingEntryResponse xmlns:m="urn:schemas-upnp-org:service:WANPPPConnection:1">
<NewRemoteHost>
</NewRemoteHost>
<NewExternalPort>25911</NewExternalPort>
<NewProtocol>TCP</NewProtocol>
<NewInternalPort>25911</NewInternalPort>
<NewInternalClient>10.0.0.6</NewInternalClient>
<NewEnabled>1</NewEnabled>
<NewPortMappingDescription>Skype TCP at 10.0.0.6:25911 (2695)</NewPortMappingDescription>
<NewLeaseDuration>0</NewLeaseDuration>
</m:GetGenericPortMappingEntryResponse>
</s:Body>
</s:Envelope>
OpenNat - Verbose > SOAPACTION: **GetGenericPortMappingEntry** url:http://10.0.0.2:5431/uuid:0000e068-20a0-00e0-20a0-48a802086048/WANPPPConn
ection:1
OpenNat - Verbose > <s:Envelope
xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"
s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<u:GetGenericPortMappingEntry xmlns:u="urn:schemas-upnp-org:service:WANPPPConnection:1">
<NewPortMappingIndex>3</NewPortMappingIndex>
</u:GetGenericPortMappingEntry>
</s:Body>
</s:Envelope>
OpenNat - Warning > Server failed with error: 713 - SpecifiedArrayIndexInvalid
Your IP: 181.110.171.204
Added mapping: 181.110.171.204:1700 -> 127.0.0.1:1600Mapping List
+------+-------------------------------+--------------------------------+----------------------------------+
| PROT | PUBLIC (Reacheable) | PRIVATE (Your computer) | Descriptopn |
+------+----------------------+--------+-----------------------+--------+----------------------------------+
| | IP Address | Port | IP Address | Port | |
+------+----------------------+--------+-----------------------+--------+----------------------------------+
| TCP | 181.110.171.204 | 21807 | 10.0.0.5 | 32400 | Plex Media Server |
| UDP | 181.110.171.204 | 25911 | 10.0.0.6 | 25911 | Skype UDP at 10.0.0.6:25911 (2695)|
| TCP | 181.110.171.204 | 25911 | 10.0.0.6 | 25911 | Skype TCP at 10.0.0.6:25911 (2695)|
| TCP | 181.110.171.204 | 1700 | 10.0.0.6 | 1600 | Open.Nat Testing |
+------+----------------------+--------+-----------------------+--------+----------------------------------+
[Removing TCP mapping] 181.110.171.204:1700 -> 127.0.0.1:1600
[Done]
[SUCCESS]: Test mapping effectively removed ;)
OpenNat - Information > Searching for: PmpSearcher
OpenNat - Information > StopDiscovery
Press any kay to exit...