Qbik Helpsys

WinGate VPN events

WinGate VPN now registers events that take place during its operation with the WinGate Events module. Like other registered events in WinGate, you can use any of the available event processing systems (such as Policy, Run Javascript) to process these registered events when they occur. This allows you to have WinGate run a script, evaluate a policy etc. based on the VPN activity.

WinGate VPN will register a number of different events depending on whether you have configured a hosted VPN, or you have configured a remote VPN that this WinGate VPN Node should join.

Hosted VPNs

When you create a hosted VPN, each host configuration will register the following events.

  • Connected

    When a remote Node connects to the hosted VPN.

  • Disconnected

    When a remote Node disconnects from the hosted VPN.

Remote VPNs

  • Connected

    When this WG VPN Node joins the hosted VPN on the remote Master Node.

  • Disconnected

    When this WG VPN disconnects from the hosted VPN on the remote Master Node.

All events are registered by the name of the VPN in the configuration and the event type. For example if you have created a hosted VPN called Sales, the following events would be registered:

Sales : Connected

Sales : Disconnected

WinGate objects

The WinGate VPN will make available the Site object, which contains data about the remote VPN Nodes that are connecting to a hosted VPN on this WinGate server. As such the Site object will only provide data when there is a remote VPN Node connected. These methods can be accessed when using a WinGate script system (such as the Lua or Javascript event processors), or a configuration that has access to the Symbol Browser.

Site object

Member

Description

Name

This will give you the site name of the remote VPN Node that has joined this VPN.

PeerIP

  • Country
  • InSubnet(Text Network,Text Mask)
  • IsLocalhost()
  • IsMulticast()
  • IsPrivate()
  • NetOrderString()

This provides access to details about the remote VPN Nodes IP address.

e.g. a script could contain:

Site.PeerIP.Country

This would return the 2 letter country code associated with the IP address.

VPNName

The name of the hosted VPN the remote Node has connected to on this WinGate server.

VPNManager object

The WinGate VPN will also register the VPNManager object which contains functions that can be used to manage the WinGate VPN. These methods can be accessed when using a WinGate script system (such as the Lua or Javascript event processors), or a configuration that has access to the Symbol Browser.

VPNManager

Member

Description

Connect(Text VPNName)

This allows you to have WinGate join a configured remote VPN.

Disconnect(Text VPNName, Text DisconnectReason)

This will disconnect WinGate from a remote VPN it has been configured to join.

DisconnectSite(Text VPNName, Text SiteName, Text DisconnectReason)

This will forcibly disconnect the VPN Node specified in the Text SiteName parameter from the hosted VPN given in the VPNName parameter.

e.g. a script could contain:

VPNManager.DisconnectSite("Sales VPN", "North branch", "Routine VPN maintenance")

This would cause WinGate to disconnect the remote VPN Node with the site name North branch from one of its hosted VPNs called Sales VPN.

The Text Disconnect Reason parameter allows you to provide a reason for why the disconnection occurred. This will be included in the log file that the WinGate VPN has been configured to log information to.

You can use basic Full-Text Searches against the page title and body to find matching articles. Use the following search modifiers to refine your query:

  • event management (no quotes) will find all pages containing the words "event" OR "management"
  • "event management" (with quotes) will find all pages containing the phrase "event management"
  • +event -management will find all pages containing the word "event", AND NOT the word "management"