In this article:
    Applicable to:
    • Twingate Component: Client, Connector
    • Third Party: Any network port testing or scanning tools such as Nmap, telnet, or netcat.


    Running port connectivity tests against Twingate Resources from the Twingate Client doesn't provide real-life results. This article will help to provide understanding as to how port tests or scans, such as Nmap or telnet, operate with Twingate.


    Twingate restricted port

    One can review how the Twingate Client handles traffic by the below. 

    1. In the below example we have the Twingate Resource of stor​ with port restrictions to allow only TCP/UDP 8001​ and ICMP traffic.
    2. Enable debug level logs for the Twingate Client (if not already).
    3. Run an Nmap scan to the Twingate Resource.
    4. The scan will return several ports that are open, when in fact they are not.
    5. Review the logs and see that the traffic flows are not allowed, and therefore, not forwarded. This can be further confirmed by a packet capture if necessary.
    2022-01-17 10:33:59.5408 [DEBUG] <no type>.log [SDWAN] Core::authorize_hydra_viper_flow: route_id=192 conntrack_proto=TCP fqdn=stor tuple=> 
    2022-01-17 10:33:59.5408 [DEBUG] <no type>.log [SDWAN] match: no matching rule
    2022-01-17 10:33:59.5408 [DEBUG] <no type>.log [SDWAN] Node[AN 6925]::authorize_hydra_viper_flow: new flow route_id=192 conntrack_proto=TCP fqdn=stor tuple=> does not match any policy, use bypass
    2022-01-17 10:33:59.5408 [DEBUG] <no type>.log [SDWAN] operator (): rule stor:TCP[[8001]]:UDP[[8001]]:ICMP
    2022-01-17 10:33:59.5408 [DEBUG] <no type>.log [SDWAN] is_protocol_port_allowed: protocol TCP, port 7 is not allowed

    Twingate unrestricted port

    One can review how the Twingate Client to the Twingate Connector handles traffic by the below.

    1. In the below example we have the Twingate Resource of with no Twingate port restrictions applied.
    2. The Resource of has a firewall rule that blocks port 5656
    3. From the Twingate Client test TCP port connectivity via curl -v telnet:// .
    4. A false positive will be returned: Connected to ( port 56556.
    5. Powering down the Resource will still result in Connected to
    6. If there is a single Connector deployed for this Resource, powering it down will finally result in the connection to return failed.


    When Twingate restricts ports for a resource, traffic matching the user's available Resources will be intercepted by the Twingate Client. The Twingate Client will then determine which traffic to forward based on the defined Resources and the underlying ruleset. As a result of this interception of traffic, Nmap scanning from the Twingate Client will result in seeing ports that are unexpectedly open, when in fact they are not.


    When Twignate doesn't restrict ports, the Twingate Client will leverage the Twingate Connector to proxy the connection. The initial TCP/IP connection will take place against the Connector, as such, a false positive is returned.


    Testing connectivity to Twingate Resources from the Twingate Client should not be dependent on TCP/IP port tests/scans. Tests should be performed against the applicable application session, such as interactive SSH or RDP client connections being established, or HTTPS connections returning a 200 response.