For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

Renjith_p_Mathe's avatar
Renjith_p_Mathe
Icon for Nimbostratus rankNimbostratus
May 19, 2014

Virtual Server creation & mapping

Dears

 

Kindly assist me on F5 for the following requirement.

 

A new virtual Server creation and its mapping to existing back end webserver listening on a specific port (eg: 8080)?

 

14 Replies

  • A new virtual Server creation and its mapping to existing back end webserver listening on a specific port (eg: 8080)?

     

    isn't it normal setup? is there any specific problem you are experiencing?

     

    • Renjith_p_Mathe's avatar
      Renjith_p_Mathe
      Icon for Nimbostratus rankNimbostratus
      Hi Thanks for your reply. i have one webservice (eg:abc.com) is piblished on internet and its working fine through f5 now. lets say virtual ip 1.2.3.4 and back end ip 8.7.6.5 on port 8080 My new requirement is publish a new webservice (eg:xyz.com) to be published on internet through F5 by using the same public IP. but the back end server is same like 8.7.6.5 listening on a different port ;ets say 8081. in that case pls guide me the step by step procedure for the same....
  • A new virtual Server creation and its mapping to existing back end webserver listening on a specific port (eg: 8080)?

     

    isn't it normal setup? is there any specific problem you are experiencing?

     

    • Renjith_p_Mathe's avatar
      Renjith_p_Mathe
      Icon for Nimbostratus rankNimbostratus
      Hi Thanks for your reply. i have one webservice (eg:abc.com) is piblished on internet and its working fine through f5 now. lets say virtual ip 1.2.3.4 and back end ip 8.7.6.5 on port 8080 My new requirement is publish a new webservice (eg:xyz.com) to be published on internet through F5 by using the same public IP. but the back end server is same like 8.7.6.5 listening on a different port ;ets say 8081. in that case pls guide me the step by step procedure for the same....
  • e.g.

     config
    
    root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm virtual bar
    ltm virtual bar {
        destination 172.28.24.10:80
        ip-protocol tcp
        mask 255.255.255.255
        profiles {
            http { }
            tcp { }
        }
        rules {
            qux
        }
        source 0.0.0.0/0
        source-address-translation {
            type automap
        }
        vs-index 30
    }
    root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm pool foo8080
    ltm pool foo8080 {
        members {
            200.200.200.101:8080 {
                address 200.200.200.101
            }
        }
    }
    root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm pool foo8081
    ltm pool foo8081 {
        members {
            200.200.200.101:8081 {
                address 200.200.200.101
            }
        }
    }
    root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm rule qux
    ltm rule qux {
        when HTTP_REQUEST {
      set host [HTTP::host]
      switch $host {
        "abc.com" {
          pool foo8080
        }
        "xyz.com" {
          pool foo8081
        }
        default {
           do something
        }
      }
    }
    when HTTP_RESPONSE {
      log local0. "client=[IP::client_addr]:[TCP::client_port] host=$host pool=[LB::server pool] server=[IP::server_addr]:[TCP::server_port]"
    }
    }
    
     /var/log/ltm
    
    [root@ve11a:Active:In Sync] config  tail -f /var/log/ltm
    May 20 04:12:37 ve11a info tmm[14715]: Rule /Common/qux : client=172.28.24.1:38358 host=abc.com pool=/Common/foo8080 server=200.200.200.101:8080
    May 20 04:12:46 ve11a info tmm1[14715]: Rule /Common/qux : client=172.28.24.1:38359 host=xyz.com pool=/Common/foo8081 server=200.200.200.101:8081
    
    • Renjith_p_Mathe's avatar
      Renjith_p_Mathe
      Icon for Nimbostratus rankNimbostratus
      Hello nitass there is some change in my requiremnt i have one webservice (eg:abc.com) is published on internet and its working fine now through F5. Its virtual server IP 1.2.3.4 (port 80) & Back end Server IP 5.6.7.8 (port 8080). My new requirement is publish a new 2 webservices (xyz1.com & xyz2.com) to be published on internet through F5 by using the same public IP. but the Back end Server IP is same 5.6.7.8 on differnt port 8081. Which way is better to achieve this redirection either through i rule or HTTP Class Profile ? Please share with me GUI steps for this HTTP Class profile for the same....
  • e.g.

     config
    
    root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm virtual bar
    ltm virtual bar {
        destination 172.28.24.10:80
        ip-protocol tcp
        mask 255.255.255.255
        profiles {
            http { }
            tcp { }
        }
        rules {
            qux
        }
        source 0.0.0.0/0
        source-address-translation {
            type automap
        }
        vs-index 30
    }
    root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm pool foo8080
    ltm pool foo8080 {
        members {
            200.200.200.101:8080 {
                address 200.200.200.101
            }
        }
    }
    root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm pool foo8081
    ltm pool foo8081 {
        members {
            200.200.200.101:8081 {
                address 200.200.200.101
            }
        }
    }
    root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm rule qux
    ltm rule qux {
        when HTTP_REQUEST {
      set host [HTTP::host]
      switch $host {
        "abc.com" {
          pool foo8080
        }
        "xyz.com" {
          pool foo8081
        }
        default {
           do something
        }
      }
    }
    when HTTP_RESPONSE {
      log local0. "client=[IP::client_addr]:[TCP::client_port] host=$host pool=[LB::server pool] server=[IP::server_addr]:[TCP::server_port]"
    }
    }
    
     /var/log/ltm
    
    [root@ve11a:Active:In Sync] config  tail -f /var/log/ltm
    May 20 04:12:37 ve11a info tmm[14715]: Rule /Common/qux : client=172.28.24.1:38358 host=abc.com pool=/Common/foo8080 server=200.200.200.101:8080
    May 20 04:12:46 ve11a info tmm1[14715]: Rule /Common/qux : client=172.28.24.1:38359 host=xyz.com pool=/Common/foo8081 server=200.200.200.101:8081
    
    • Renjith_p_Mathe's avatar
      Renjith_p_Mathe
      Icon for Nimbostratus rankNimbostratus
      Hello nitass there is some change in my requiremnt i have one webservice (eg:abc.com) is published on internet and its working fine now through F5. Its virtual server IP 1.2.3.4 (port 80) & Back end Server IP 5.6.7.8 (port 8080). My new requirement is publish a new 2 webservices (xyz1.com & xyz2.com) to be published on internet through F5 by using the same public IP. but the Back end Server IP is same 5.6.7.8 on differnt port 8081. Which way is better to achieve this redirection either through i rule or HTTP Class Profile ? Please share with me GUI steps for this HTTP Class profile for the same....
  • Which way is better to achieve this redirection either through i rule or HTTP Class Profile ?

     

    i think either one is fine. if you are more familiar with http class, go http class.

     

    please be noted that http class is no longer available in 11.4.0 and later.

     

    sol14409: The HTTP Class profile is no longer available in BIG-IP 11.4.0 and later

     

    http://support.f5.com/kb/en-us/solutions/public/14000/400/sol14409.html

     

  • HTTP classes are replaced with policies in 11.4, and are much more robust than before. If you choose the iRule route though, here's what that may look like:

    when HTTP_REQUEST {
        switch [string tolower [HTTP::host]] {
            "abc.com" {
                pool abc_pool
            }
            "xyz1.com" {
                pool xyz1_pool
            }
            "xyz2.com" {
                pool xyz2_pool
            }
        }
    }
    

    For each new request, assign a pool based on the incoming HTTP Host header.

  • Thanks for the info. Currenytly we are running 11.3.0 also Unfortunately not that much familiar with this device. Can you send me step by step prodeure for creating HTTP class profile and its mapping,.. or reapective i rule ...

     

  • Here's an overview of HTTP classes:

     

    http://support.f5.com/kb/en-us/solutions/public/7000/200/sol7280.html?sr=37507118

     

    And a step-by-step:

     

    http://support.f5.com/kb/en-us/products/big-ip_asm/manuals/product/asm-config-11-2-0/asm_app_sec_classes.html?sr=37507118

     

    The iRule would look very similar to the one posted above. Create three pools to define the three individual services, create and edit the iRule to reflect the real host and pool names, and assign the iRule to the virtual server.