For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

Eddy_161863's avatar
Eddy_161863
Icon for Nimbostratus rankNimbostratus
May 06, 2016

data group list import- invalid format

I have a list of 100 IPs that I want to use in an irule. I have created a data group list and was trying to import it but keep getting the error message that "the data group external file has an invalid format, line 1"

 

so I have tried different formats:

 

network 10.0.0.0 mask 255.255.255.255,

 

network 20.0.0.0 mask 255.255.255.255, and so on....

 

and I have tried host 10.0.0.0, host 20.0.0.0

 

I have tried both with and without commas but nothing is working. what is the correct format?

 

any help would be appreciated.

 

16 Replies

  • Hello,

     

    Why not using a simple "address" Data-group ? you can then add 10.0.0.0/8 in the address field for example.

     

    You can then use tmsh or iControl Rest API to update dynamically your data-group

     

    • Eddy_161863's avatar
      Eddy_161863
      Icon for Nimbostratus rankNimbostratus
      Thanks. I used 10.0.0.0 and 20.0.0.0 as an example. but originally it is a list of 100 IPs which I cannot summarize. I have to add them individually. Do you know the format for that?
    • Eddy_161863's avatar
      Eddy_161863
      Icon for Nimbostratus rankNimbostratus
      thanks Yann. Below is what that article says about external IP data group. Do you know if I have to add this format to the external data group list I created? where will I add the IPs? External Data Group------------------------- ltm data-group external addr_testclass_ext { external-file-name addr_testclass.class type ip }
  • Hello,

     

    Why not using a simple "address" Data-group ? you can then add 10.0.0.0/8 in the address field for example.

     

    You can then use tmsh or iControl Rest API to update dynamically your data-group

     

    • Eddy_161863's avatar
      Eddy_161863
      Icon for Nimbostratus rankNimbostratus
      Thanks. I used 10.0.0.0 and 20.0.0.0 as an example. but originally it is a list of 100 IPs which I cannot summarize. I have to add them individually. Do you know the format for that?
    • Yann_Desmarest_'s avatar
      Yann_Desmarest_
      Icon for Nacreous rankNacreous
      ok no problem, just check this article from Jason Rahm : You will find the exact syntax for external data-groups https://devcentral.f5.com/s/articles/v11-irules-data-group-updates
    • Eddy_161863's avatar
      Eddy_161863
      Icon for Nimbostratus rankNimbostratus
      thanks Yann. Below is what that article says about external IP data group. Do you know if I have to add this format to the external data group list I created? where will I add the IPs? External Data Group------------------------- ltm data-group external addr_testclass_ext { external-file-name addr_testclass.class type ip }
  • Very frustrating. He simply wants to know the format of the file to be imported to create a datagroup of IP addresses. Will no one answer that question? I'm struggling to find the same information, which should be readily available.

     

    • cjunior's avatar
      cjunior
      Icon for Nacreous rankNacreous

      Please, don't be frustated. I don't know if in comments they mentioned the format, so you can use this way:

      network 10.0.0.0 prefixlen 8 := "Network1",
      network 172.16.0.0 prefixlen 12 := "Network2",
      network 192.168.0.0 prefixlen 16 := "Network3",
      host 192.168.20.1 := "Host1",
      host 172.16.1.1 := "Host2"
      

      Regards.

    • Stan_Ward's avatar
      Stan_Ward
      Icon for Altocumulus rankAltocumulus

      cjunior, Thank you for providing the info; it was the lead I needed.

      But I share the frustration; I've been working on that exact problem for the last hour, and stumbled across this thread while trying to solve it. The external format does not match that of the internal data group ip type, and all of the references I saw to using the above format were in the context of v9, so I ignored them. Does anyone know where the definitive reference is? I only know of Jason Rahm's article on external data groups, and it doesn't show an example of ip type, just string and integer.

      However, after experimenting, I found that these formats also work:

      host 172.31.140.222 := "Host A",
      
      network 172.31.140.223/32 := "Host B",
      
      network 172.31.140.0/24 := "Network C",
      

      Cheers,

      Stan

    • cjunior's avatar
      cjunior
      Icon for Nacreous rankNacreous

      Thank you Stan,

       

      I inherit that syntax on past and this still keep works for today on new versions.

       

      By the way, your example is very clean to use, nice job!