I wasn”t aware before that ipfilter (ipf) has a concept of pools. In other words list of IP addresses etc..
I previously had this basic article on enabling ipf in Solaris and following here is a little on pools.
** Note this was a Solaris 10 LDOM so therefore NIC was vnet0. You have to check your NIC it”s most likely net0 in Solaris 11.
Setup the pools you need as follow.
# pwd/etc/ipf# cat ippool.conf### Pool 13 some essential static addressestable role = ipf type = tree number = 13{ 10.1.11.34/32, 10.2.10.6/32 };### Pool 14 some temporary IP'stable role = ipf type = tree number = 14{ 192.168.8.0/24, 10.200.97.82/32 };Use the pools in your ipf.conf.
# cat ipf.conf[...]pass in quick on lo0 allpass out quick on lo0 all
### Block all inbound and outbound traffic by defaultblock in log on vnet0 all head 100block out log on vnet0 all head 150
### Allow inbound SSH connectionspass in quick on vnet0 proto tcp from any to 10.1.11.87 port = 22 keep state group 100
### Use /etc/ipf/ippool.conf for poolspass in on vnet0 from pool/13 group 100pass in on vnet0 from pool/14 group 100
### Allow my box to utilize all UDP, TCP and ICMP servicespass out quick allOf course flush and reload from file.
# ipf -Fa -f /etc/ipf/ipf.confCheck the running set.
# ipfstat -iopass out quick on lo0 allblock out log on vnet0 all head 150pass out quick all# Group 150pass in quick on lo0 allblock in log on vnet0 all head 100# Group 100pass in quick on vnet0 proto tcp from any to 10.1.11.87/32 port = ssh keep state group 100pass in on vnet0 from pool/13 to any group 100pass in on vnet0 from pool/14 to any group 100Note that updating the ippools you might need to reload also.
# ippool -F; ippool -f /etc/ipf/ippool.confFor me that did not always work so I also did.
# svcadm disable ipfilter# svcadm refresh ipfilter# svcadm enable ipfilterListing the pools will save you a lot of time root causing rules that are actually correct.
# ippool -ltable role = ipf type = tree number = 14 { 192.168.8.0/24; 10.200.97.82/32; };table role = ipf type = tree number = 13 { 10.1.11.34/32; 10.2.10.6/32 };As always with firewalls test test test.