Import a long list of IP's for usage in a "host-group" - How to do this?

Hello,

I have a list of 70 IP’s which I want to use as a host group. Adding them manually one by one is very time-consuming. Any way to import the whole bunch at once?
Maybe there’s a way to do this via shell-access?

Greetings ArgH

Stefan, I am trying to do the same thing. Noone has responded I see.

I have located /var/ipfire/fwhosts which seems to be where the custom lists are located, but I can’t tell yet how to properly import. Looks like there is a number at the head of each row. Not sure what that is about yet.

There are various lists of hosts in IPFire and it’s unclear which you are trying to edit. Which page on the Web UI are you finding time-consuming ?

There are the following:
Hosts
Networks
Services

Then there are groups for each. I am talking about general use. There isn’t an import button in the GUI anywhere on any of these screens. I figured out how to manually edit the path file on the BASH shell, but shouldn’t need to do that. I would like to see a button for import in the future. It would really help.

Thanks

Hi

I already solved it, but forgot to close this toppic - sorry.

Solution was:
(If you try this in a production enviroment, make a backup of your installation)

  1. Go to /var/ipfire/fwhosts

  2. (make backup-copy of file “customhosts”)

  3. Edit file “customhosts”

  4. save file and check results in webinterface

Example from my customhosts-file:

[…]
120,WHATSAPP SERVER 32,ip,209.95.33.68/255.255.255.255,WHATSAPP SERVER
121,WHATSAPP SERVER 33,ip,208.43.115.202/255.255.255.255,WHATSAPP SERVER
122,WHATSAPP SERVER 34,ip,208.43.122.131/255.255.255.255,WHATSAPP SERVER
[…]

The syntax(as of 05/2020) seems to be:

  • => comma is used as a field seperator.

  • => First field is some kind of index number, which must be unique in the file

  • => The second field is the name, which also should be unique

  • => The third field is “ip” - there maybe more options (eg “mac” for mac-address), I didn’t check them out, since I didn’t need them for my case.

  • => The fourth field is the actual ip address with a 255.255.255.255 netmask => 1.2.3.4/255.255.255.255

  • => The fifth and last field is the comment-field, no restrictions there (but be wary of special characters and length)