OPNsense Forum

Archive => 18.1 Legacy Series => Topic started by: advcron on February 09, 2018, 11:04:14 am

Title: Sorting aliases [Solved]
Post by: advcron on February 09, 2018, 11:04:14 am
1. Is any way to sort entries in alisess.
For example. I created host alias (attach screen).
I want add entry 192.168.0.12. Entry appeard on last position, but I want on second.
Is any way to add entry on second position from shell may be?

2. Also I have question. In faq  https://docs.opnsense.org/manual/aliases.html
I can create lists in lists.
    critical_servers {10.0.1.1 , 10.0.1.2}
    other_servers {10.0.1.100 , 10.0.1.200}
Then concatenate both by defining a new list:
    servers { critical_servers , other_servers}.

But I can't do that or I don't now how. I created two alias host list.
Next Firewall -> Aliasses -> View -> Add new aliase. I choose Host and in host field paste critical_servers and other_servers. And I can't save.
Error appeard:
Quote
The following input errors were detected:
    Entry "IP_Admin_Stacje0_INT " is not a valid hostname or IP address.
    Entry "IP_Admin_Stacje50_INT " is not a valid hostname or IP address.
    The name must be less than 32 characters long and may only consist of the following characters: a-z, A-Z, 0-9, _
I think there must be anather way to create list in list but i dont now how.


Title: Re: Sorting aliases
Post by: nqnguyen2 on February 10, 2018, 03:36:09 am
1. You want the IP addresses to be in numerical order? I believe it's impossible to do it in GUI after the fact. You'd have to do it in CLI at which point there's md5 hashes of the aliases which I'd have to experiment and verify before giving you a solid answer. See for yourself; /var/db/aliastables/IP_Stacje0_INT.md5.txt

2. Your aliases aren't recognized because you pasted the Aliases with a space after each name. See the extra space before the closing quotes? It's not recommended to paste the Alias you created earlier. Instead, type the first letter and there will be a selection box (attached image).
"IP_Admin_Stacje0_INT "
"IP_Admin_Stacje50_INT "
Title: Re: Sorting aliases
Post by: advcron on February 10, 2018, 09:01:40 pm
Thank you very much it works !!!