Forum Discussion

mroark_150398's avatar
mroark_150398
Icon for Nimbostratus rankNimbostratus
Aug 04, 2014

Need to create a Virtual Server that needs to have a range of ports coming in and and the same range going out.

I'm new to F5 and have very little experience. Need to create a Virtual Server that needs to have a range of ports coming in and and the same range going out to the pool memebers. We are wanting to allow ports 6400 through 6440 to the virtual server and 6400 to 6440 to the pool members. I read that this can be accomplished by allowing all ports and the setup an iRule. But will i need to create a pool for each port?

 

1 Reply

  • e.g.

     config
    
    root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm virtual bar
    ltm virtual bar {
        destination 172.28.24.10:0
        ip-protocol tcp
        mask 255.255.255.255
        pool foo
        profiles {
            http { }
            tcp { }
        }
        rules {
            qux
        }
        source 0.0.0.0/0
        source-address-translation {
            type automap
        }
        translate-port disabled
        vs-index 60
    }
    root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm pool foo
    ltm pool foo {
        members {
            200.200.200.101:0 {
                address 200.200.200.101
            }
        }
    }
    root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm rule qux
    ltm rule qux {
        when CLIENT_ACCEPTED {
      if { [TCP::local_port] < 6400 or [TCP::local_port] > 6440 } {
        reject
      }
    }
    }
    
     test
    
    [root@ve11a:Active:In Sync] config  curl -I http://172.28.24.10:6401/
    HTTP/1.1 200 OK
    Date: Mon, 04 Aug 2014 12:43:54 GMT
    Server: Apache/2.2.3 (CentOS)
    Last-Modified: Sun, 09 Feb 2014 08:39:51 GMT
    ETag: "41879c-59-2a9c23c0"
    Accept-Ranges: bytes
    Content-Length: 89
    Content-Type: text/html; charset=UTF-8
    
    [root@ve11a:Active:In Sync] config  curl -I http://172.28.24.10:6501/
    curl: (56) Failure when receiving data from the peer