Forum Discussion

Sulaiman_85782's avatar
Sulaiman_85782
Icon for Nimbostratus rankNimbostratus
Feb 05, 2014

Network type access via F5

Hi

 

How do a configure a Virtual Server so that when a user uses \x.x.x.x they are able to access the servers in the Pool?

 

I got one Admin team who use to use \x.x.x.x so that they can check which server they are accessing when they used NLB and want to do the same now that F5 is doing the LoadBalancing

 

When I use \x.x.x.x I only get a blank screen, saying folder is empty. However when I go to server directly I can see that there are shared Folders.

 

Any ideas?

 

3 Replies

  • I am assuming x.x.x.x is the IP address of a server in the pool attached to the virtual server you are accessing? And you want to access it directly using the IP address as the first path segment? And the portion of the path that is after the /x.x.x.x should be sent to the server? So http://myapp.com/1.2.3.4/admin will send request http://myapp.com/admin to server 1.2.3.4? If so try this;-

    when HTTP_REQUEST {
    
        if {![catch {IP::addr [getfield [HTTP::path] / 1] mask 255.255.255.255} ]} {
         The first path segment path is a valid IP - select member based on path name (remove leading "/")
            set i [string first "/" [substr [HTTP::path] 1]]
            if {$i} {
                 Drop off first path segment
                    HTTP::uri [substr [HTTP::uri] [expr {$i + 1}]]
            } else {
                HTTP::uri "/"
            }
            pool [LB::server pool] member [getfield [HTTP::path] / 1]
            return
        }
    }
    
    • Sulaiman_85782's avatar
      Sulaiman_85782
      Icon for Nimbostratus rankNimbostratus
      I think I might not have stated the scenario correctly. I got a site http://mysite which has 3 servers in the pool. The ServerOps team, want to be able to see which of the 3 servers they are accessing when going to http://mysite. When they were using NLB, they could see which server they were hitting by going \\mysite as it would list the file shares which had the name of the server. They want to be able to do the same now that the F5 is doing the LoadBalancing, however when i go \\mysite I get white Explorer Screen saying Folder empty. The question is thus how do I get the contents of the folder to show something when using \\mysite. I got a feeling that another VIP may have to be setup as which port would \\mysite be connecting on.
  • Right. So it won't work the same - as you say using an Explorer share is not going to use http. I would define a pathname they can use ie http://mysite.com/admin/host.html, then your iRule would look like this;-

    when LB_SELECTED {
        if {[HTTP::path] eq "/admin/host.html"} {
            HTTP::respond 200 content "[LB::server]"
            return
        }
    }
    

    So they will have the same effect (determining which server is being used) via a different method - note this will only work if you are using persistence and http/oneconnect profiles.