Forum Discussion

kridsana_52318's avatar
kridsana_52318
Icon for Nimbostratus rankNimbostratus
May 09, 2017

iRule how to SNAT many client with limited snat ip

Hi everybody

 

I've scenario that we have application that need to perform snat 1:1 and we got 20 snat IP. so it's mean 20 concurrent user and just that.

 

The problem is how our client to use this 20 snat IP respectively ?

 

let's me example. at start client 1 IP 1.1.1.1 -> got snat to 2.2.2.1 then client 2 IP 1.1.1.2 -> got snat to 2.2.2.2 client 3 IP 1.1.1.3 -> got snat to 2.2.2.3 . . can iRule do something like above example?

 

not sure if iRule can see what snat ip is free and assign that ip to new client ?

 

Thank you

 

5 Replies

  • Hi,

    I did quick test and cant see any problem with simple version of iRule:

    when CLIENT_ACCEPTED {
        scan [IP::client_addr] %*d.%*d.%d.%d c d
        snat 192.168.$c.$d
        log local0. "Client IP: [IP::client_addr], 3rd: $c, 4th: $d"
    }
    

    Did you mean this one or one using table commands?

    Piotr

  • Hi Piotr

     

    Thank you very much. I try to use the one which using table commands.

     

    at first i got error on my vm. but after try to use on appliance, It's work fine.

     

    May be due to some problem on my VM that make it not work.

     

    Thank you

     

  • Hi,

     

    Credits are not mine :-) but glad that you found solution. Pretty strange that iRule was not working on VM but is working on physical device. Never had such issue.

     

    Piotr