Forum Discussion

Srinivasan_Reng's avatar
Srinivasan_Reng
Icon for Nimbostratus rankNimbostratus
Aug 17, 2005

Create VIP and SNAT

I have the BigIP connected and couple of nodes have been added. FYI.

 

--------------------------------------------------------------------

 

 

Instead of manually creating VIP, I would like to do it programmatically with a Form based- (using iControl-4[1].6.3 version).

 

using: ASP.NET/C (or) using Windows Forms(C).

 

 

Kindly provide me one sample so that i will go from here.

 

 

I don't see any samples for this version.

 

 

Please do provide a solution...

 

 

Regards

 

Srini

 

 

 

1 Reply

  • A little background first. Unfortunately we don't have the resources to build sample applications that cover all 1500 or so methods exposed in iControl. We've tried to include samples that cover all the data types, thus illustrating how to maniuplate arrays, structures, etc. DevCentral is run by the development staff (the ones writing code for the products). We take time off our current work schedules to help out with customer questions, but don't have the resources to write full custom applications for our users (we do have a consulting group who I'm sure would be interested in taking on the work though...). We really want to have our users build the applications themselves and then come here for debugging issues or tips on optimizing their existing code. We're glad to point you in general directions and give snippets of code when we can though....

     

     

    Now, back to your question (and hopefully enough code to get you going)...

     

     

    For BIG-IP v4.x there are several types of virtual servers you can create so the method you will want to use will depend on the type of virtual server you are creating.

     

     

    The following methods can be used to create virtual servers:

     

     

    
    void create_forwarding(
        in IPPortDefinition virtual_server,
        in long unit_id
    );
    Creates a forwarding virtual server.
    void create_from_pool(
        in IPPortDefinition virtual_server,
        in long unit_id,
        in String pool_name
    );
    Creates or updates a virtual server from the specified pool.
    Takes only required parameters.
    void create_from_pool_ex(
        in IPPortDefinition virtual_server,
        in long unit_id,
        in String netmask,
        in String broadcast_addr,
        in String pool_name
    );
    Creates or updates a virtual server from the specified pool. 
    Takes additional, optional parameters that enable you to 
    override the default optional values.
    void create_from_rule(
        in IPPortDefinition virtual_server,
        in long unit_id,
        in String rule_name
    );
    Creates or updates a virtual server from the specified rule. 
    Takes only required parameters.
    void create_from_rule_ex(
        in IPPortDefinition virtual_server,
        in long unit_id,
        in String netmask,
        in String broadcast_addr,
        in String rule_name
    );
    Creates or updates a virtual server from the specified rule. 
    Takes additional, optional parameters that enable you to 
    override the default optional values.
    void create_vlan_wildcard_forwarding(
        in VLANWildcardVS virtual_server,
        in long unit_id
    );
    Creates a forwarding VLAN-based wildcard virtual server.
    void create_vlan_wildcard_from_pool(
        in VLANWildcardVS virtual_server,
        in long unit_id,
        in String pool_name
    );
    Creates or updates a VLAN-based wildcard virtual server 
    from the specified pool.
    void create_vlan_wildcard_from_rule(
        in VLANWildcardVS virtual_server,
        in long unit_id,
        in String rule_name
    );
    Creates or updates a VLAN-based wildcard virtual server 
    from the specified rule.

     

     

    So, the simplest version (a forwarding pool), would have code looking something like this:

     

     

    .
    .
    .
    ITCMCommonIPPortDefinition virtual_server = new ITCMCommonIPPortDefinition();
    virtual_server.address = "1.2.3.4";
    virtual_server.port = 80;
    long unit_id = 0;
    oVirtualServer.create_forwarding(virtual_server, unit_id);

     

     

    In v9.0 we've simplified the creation process to a single create() method which encapsulates most of these separate functions into one depending on the arguments passed in.

     

     

    Hope this helps!

     

     

    -Joe