Forum Discussion

rgordon_01's avatar
rgordon_01
Icon for Nimbostratus rankNimbostratus
Mar 02, 2016

LTM I want to add 329 networks to be directed to a different pool than assigned to the VS. Could this be done by importing External file management?

Here is the situation. During testing we've setup an iRule and datagroup that says when client accepted if ip address equals what is in datagroupA send to this pool else send to this pool. Everything is working fine and now we want to implement with 300+ more stores. However when entering manually you can only do 1 at a time. I was wondering if I could import a file to do this? Would external data class work for this? I'm not sure how the key/value separator comes into play? I tried creating a file with the networks but the format must be incorrect. Would this work for what I am trying to do?

 

Network 10.184.37.0/24, Network 10.176.1.0/24, Network 10.185.52.0/24,

 

thanks!

 

5 Replies

  • Hi,

    You can easily script a data group generation (even from Excel - use CONCATENATE() ) that contains the subnet as key and the pool name as data so you can more easily assign the pool - then just copy and paste the entries in TMSH.

    create ltm data-group internal TEST-IP type ip
    
    modify ltm data-group internal TEST-IP records add { 10.1.0.0/24 { data "STOREA-POOL" } }
    modify ltm data-group internal TEST-IP records add { 10.2.0.0/24 { data "STOREB-POOL" } }
    

    ....

    ltm data-group internal TEST-IP {
        records {
            10.1.0.0/24 {
                data STOREA-POOL
            }
            10.2.0.0/24 {
                data STOREB-POOL
            }
        }
        type ip
    }
    

    Radu

    • rgordon_01's avatar
      rgordon_01
      Icon for Nimbostratus rankNimbostratus
      Hi Radu, thanks for the info. I've never used CONCATENATE before but I did a little research and was able to create a text file that I should be able to copy and paste in TMSH. I will get back to you hopefully tomorrow after I test and confirm it's doing what I need it to do. thanks!
    • rgordon_01's avatar
      rgordon_01
      Icon for Nimbostratus rankNimbostratus
      I created a text file -here's few lines as example: modify ltm data-group internal TEST-IP records add { 10.175.129.0/24 { data "silverlight" } } modify ltm data-group internal TEST-IP records add { 10.175.132.0/24 { data "silverlight" } } modify ltm data-group internal TEST-IP records add { 10.175.133.0/24 { data "silverlight" } } modify ltm data-group internal TEST-IP records add { 10.175.139.0/24 { data "silverlight" } } modify ltm data-group internal TEST-IP records add { 10.175.143.0/24 { data "silverlight" } } executed the command from TMSH on our test f5. It created the new data group which is good but when you view the address records from the GUI it's not what I'm looking for. They showed up as: 10.175.129.0/24:=silverlight 10.175.132.0/24:=Silverlight All the networks in my text file will go to the same pool which the iRule is already redirecting them to. So then I removed data "Silverlight from the command and ran this modify ltm data-group internal TEST-IP records add { 10.175.129.0/24 } modify ltm data-group internal TEST-IP records add { 10.175.132.0/24 } modify ltm data-group internal TEST-IP records add { 10.175.133.0/24 } modify ltm data-group internal TEST-IP records add { 10.175.139.0/24 } modify ltm data-group internal TEST-IP records add { 10.175.143.0/24 } the data looks more like I expected now EXCEPT the mask shows up as /24 instead of 255.255.255.0 like it's setup in our working production LTM. It may accept both ways but checking the help menu says it does not. So now I have to go back and redo excel to create a new text file with the correct mask format. Although this was easier than manually entering each network I've still had to do a lot of work to get the text file in the correct format. Can you confirm yes or no that the /24 does not work for the mask format?
    • raduioncu_16351's avatar
      raduioncu_16351
      Icon for Nimbostratus rankNimbostratus
      Hi, The mask notation, whether it is /24 or 255.255.255.0 should be irrelevant - you should still be able to match the client IP with the data group using [class match [IP::client_addr] equals TEST_IP]