Forum Discussion

Wasim_Hassan_13's avatar
Wasim_Hassan_13
Icon for Nimbostratus rankNimbostratus
Jan 13, 2014

HTTP to 30000 Por redirection

Hi,

 

I have one web server running on port TCP 30000. I want to configure the F5 in a way that the user will only use the

 

http://abc

 

and it should redirect the user to the full URL.

 

http://acb:30000/default.aspx

 

I am searching the different iRules and different combinnations but not able to find the exact one.

 

Please assist.

 

13 Replies

  • you could create a virtual server listening on port 80 and mapp a class, which only redirect to your destination. Thats it - no irule needed

     

  • as mentioned you just need a VIP on port 80 and a default pool for the VIP for your server on port 30000.

     

    thx

     

  • Thanks for the reply but unfortunately it is not working for me :(

     

    I have created two nodes. 192.168.200.151 192.168.200.152

     

    Create a pool and add these two nodes in this pool. create a VIP (192.168.200.72) on port 80 and add these two nodes in this VIP. then same VIP (192.168.200.72) on port 30000 and add these nodes in this VIP.

     

    Now when I am opending http:\192.168.200.72

     

    it is taking me main web server not the web site which is running on port 30000.

     

    Also web server team wants to have the health check for different websites. Like if they shut down website which is running on port 30000 only this website should be unavailable. Not the full Server.

     

    please assist.

     

  • I think you have got this the wrong way around.

    Create the 2 server nodes - 192.168.200.151 192.168.200.152

    tmsh create ltm node server1 address 192.168.200.151
    and put them into a pool as members listening on port 30000.

    tmsh create ltm pool pool1 members add { server1:30000 server2:30000 }

    Add this pool to the Virtual Server running on 192.168.200.72 port 80. Now navigate to http://192.168.200.72 and it will send the traffic to the server on port 30000.

    Hope that makes sense.

  • Hi,

    I tried the same but still going to the portal which is running on port 80. Not to the specific website. Below is the configuration.

    description RETAIL_PORTAL
    members {
        SP1:http {
            address 192.168.200.151
            session monitor-enabled
            state up
        }
        SP2:http {
            address 192.168.200.152
            session monitor-enabled
            state up
        }
    }
    monitor PORT_30000 
    partition ABC_PRODUCTION
    
    
    
    ltm node SP1 {
    address 192.168.200.151
    
    monitor PORT_30000 
    partition ABC_PRODUCTION
    session monitor-enabled
    state up
    

    } ltm node SP2 ltm node SP2 { address 192.168.200.152

    monitor PORT_30000 
    partition ABC_PRODUCTION
    session monitor-enabled
    state up
    
    
    ltm virtual VS_RETAIL {
        destination 192.168.210.72:http
    ip-protocol tcp
    mask 255.255.255.255
    partition ABC_PRODUCTION
    persist {
        PROD_STICKY {
            default yes
        }
    }
    pool RETAIL_PORTAL
    profiles {
        /Common/tcp { }
    }
    snat automap
    vlans-disabled
    
    • PeteWhite's avatar
      PeteWhite
      Icon for Employee rankEmployee
      It is going to port 80 because you have specified port 80 (http) in the pool member: members { SP1:http { address 192.168.200.151 This should say SP1:30000, not SP1:http.
    • PeteWhite's avatar
      PeteWhite
      Icon for Employee rankEmployee
      If you then assign an HTTP monitor then it will be sent to the web server on port 30000
    • PeteWhite's avatar
      PeteWhite
      Icon for Employee rankEmployee
      tmsh modify ltm pool RETAIL_PORTAL members replace-all-with { SP1:30000 SP2:30000 }
  • Okay I have modified the port to 30000 but after this change I am able to land the website but now I want to access the port 80 portal as well.

     

    I am trying to create the new pool and new VIP but unable to add the nodes in it becauser it is saying already there though i m calling service port 80 at this time and monitor is setting to port 80 as well. Like that I have five other websites which are running on port 45000 36000 and other ports.

     

    • PeteWhite's avatar
      PeteWhite
      Icon for Employee rankEmployee
      OK, so now you don't need to add the nodes - they are just an IP address. You will need to add a pool and add pool members to that, using port 80 (or 45000, or 36000). Then create a virtual server and use the pool you just created. When you connect to the virtual server ip address it will proxy the connection through to the real server on port 80 or whatever you have configured. Simples.
  • Perfect it is working :)

     

    I have configured the monitor on the pool for port 80 and for other pool i have configured port 30000. Now Just one thing want to clear if web server team for the maintenance stop the service on port 30000, it will only impact the web site related to that port not the other websites which are running on port 80 and 45000.

     

    Please let me know if this is the right way of configuration.

     

    Once again many thanks for the assitance.

     

    • PeteWhite's avatar
      PeteWhite
      Icon for Employee rankEmployee
      When you say that you have configured the monitor for port 80, do you mean that you have created a new monitor and specified in the monitor that it uses port 80? If so, you don't need to do this - by default the port used will be that configured in the pool member eg 30000, 80, 45000, etc. If the web server running on port 30000 dies then that pool member will be removed from that pool - the pool member in a different pool running on port 45000 will not be affected. If you have an icmp monitor allocated at the node level then if the node fails to respond to icmp then the node will be removed from all pools in which it is assigned, no matter what port the pool member uses. I suggest you try these things out, and you may find that you need to improve the monitor as by default it uses HTTP 0.9 and is very simple. There is lots of information and examples on here and ask.f5.com for how to do that
  • Thanks for the reply and suggestion i will try and get back to you in case i need any assistance.