HP-UX CMGR A.02.01 Administrator's and Developer's Guide
31
IPFilter Configuration (/tmp/example_ipf.conf):
@tag-start Example Dynamic IPFilter Service Rule="Rule_1" ;
block in quick proto tcp from 192.0.2.1 to any port = 1257
@tag-end ;
5. Add a second Rule for a different source, but the same port:
# cmgr -a -t /tmp/example.cst rule_id=Rule_2 ip_address=192.0.2.2
tcp_port=1257
add ipfilter rules succeeded
Verify the output:
# cmgr -l -v -t /tmp/example.cst
IPFilter Configuration (/tmp/example_ipf.conf):
@tag-start Example Dynamic IPFilter Service Rule="Rule_2" ;
block in quick proto tcp from 192.0.2.2 to any port = 1257
@tag-end ;
IPFilter Configuration (/tmp/example_ipf.conf):
@tag-start Example Dynamic IPFilter Service Rule="Rule_1" ;
block in quick proto tcp from 192.0.2.1 to any port = 1257
@tag-end ;
Read the configuration file:
# more /tmp/example_ipf.conf
#@tag-start Example Dynamic IPFilter Service Rule="Rule_2";
block in quick proto tcp from 192.0.2.2 to any port = 1257
#@tag-end;
#@tag-start Example Dynamic IPFilter Service Rule="Rule_1";
block in quick proto tcp from 192.0.2.1 to any port = 1257
#@tag-end;
6. Remove only the first rule:
# cmgr -r -t /tmp/example.cst rule_id=Rule_1
delete ipfilter rules succeeded
7. Examine the events as logged by the above template actions in the syslog file:
# tail /var/adm/syslog/syslog.log
Oct 27 08:07:48 hptem386 syslog: cmgr-IPFilter Example add - Rule:
Rule_1, IP Address: 192.0.2.1, Port:
2343
Oct 27 08:28:52 hptem386 syslog: cmgr-IPFilter Example add - Rule:
Rule_2, IP Address: 192.0.2.2, Port:
1257
Oct 27 08:44:56 hptem386 syslog: cmgr-IPFilter Example delete -
Rule: Rule_1
Verify the output:
# cmgr -l -v -t /tmp/example.cst
IPFilter Configuration (/tmp/example_ipf.conf):
@tag-start Example Dynamic IPFilter Service Rule="Rule_2" ;
block in quick proto tcp from 192.0.2.2 to any port = 1257
@tag-end ;
HP-UX SRP offers SRP example templates. To download HP-UX SRP, go to HP Software Depot:
http://software.hp.com
Once you have installed HP-UX SRP, the SRP template examples are located in the
/etc/opt/hpsrp/templates directory.