Forum Discussion

ejohnson_27643's avatar
ejohnson_27643
Icon for Nimbostratus rankNimbostratus
Apr 20, 2007

Problems creating a Network Tunnel with API

I'm trying to create a Network Tunnel using the API. I tried to follow the steps listed in this post:

 

http://devcentral.f5.com/Default.aspx?tabid=53&forumid=4&postid=4013&view=topic

 

 

I took the sample VB6 AppTunnel application and replaced "APP TUNNEL" with "VPN" in appropriate locations. However, when I try to connect, the AppTunnel Application seems to make a network connection, but the URL that is connects to is not the same as the one I entered...which is possibly expected normal behavior, but when I do an ipconfig /all, there is only one network connection shown, whereas when I use the F5 client, there's two.

 

 

I've attached a screen shot of the AppTunnel application when it's connected (if it helps).

 

 

Here's my source code where I made replacements:

 

 

 

Private Sub AppTunnel_OnOpenSession(ByVal szWebtopUrl As String)

 

 

' Clear favorites list box

 

lb_Favorites.Clear

 

'Enable favorites frame box

 

Frame2.Enabled = True

 

 

'cleanup statistics

 

lReceived = 0

 

lSent = 0

 

l_Sent.Caption = ""

 

l_Received.Caption = ""

 

 

'dispaly message

 

l_Status.Caption = "Connected to " + szWebtopUrl

 

 

' Get favorites for APPTUNNELs

 

AppTunnel.GetFavorites "VPN"

 

 

End Sub

 

 

 

 

 

Private Sub btn_Open_Click()

 

Dim Name As String ' Favorite name variable

 

 

' Loop through favorite list

 

For i = 0 To lb_Favorites.ListCount - 1

 

 

' Open selected favorite

 

If lb_Favorites.Selected(i) Then

 

' Get favorite name

 

Name = lb_Favorites.List(i)

 

 

'Open favorite connection

 

AppTunnel.OpenByName "VPN", Name

 

End If

 

Next i

 

End Sub

 

 

 

 

Private Sub btn_Close_Click()

 

Dim Name As String ' Favorite name varible

 

 

For i = 0 To lb_Favorites.ListCount - 1

 

If lb_Favorites.Selected(i) Then

 

 

' Get favorite name

 

Name = lb_Favorites.List(i)

 

 

' Close favorite connection

 

AppTunnel.Close "VPN", Name

 

End If

 

Next i

 

 

End Sub

 

 

 

Any suggestions or ideas are welcome!

 

 

 

  • Alexander_Kova1's avatar
    Alexander_Kova1
    Historic F5 Account
    Favorite name is not highlighted\selected on the application picture above.

     

     

    There is a ‘Loop through favorite list’ in btn_Open_Click(). There is no error handling in the code and if favorite is not selected you application will skip OpenByName without any notification.

     

    This code can be rearranged to notify user or open first connection automatically (if only one connection name is displayed).

     

     

    If this example is based on VB6 sample you application might display something like "Connected: you_favorite_name" or "some_error: you_favorite_name" instead of Connected to http://..." on establishing VPN connection.

     

     

    Please let me know if this works.

     

    --

     

    Regards,

     

    Alexander