How To
Summary
This document explains how to configure AIX IP Security filtering to block all network traffic by default and permit only the required connections.
The example in this document demonstrates how to allow SSH access on port 22 while denying all other traffic.
Objective
This document covers:
- Configuring IP Security filters from scratch
- Changing the default filter rule to deny all traffic
- Creating filter rules to allow specific ports
- Activating the filter rules
Environment
All supported AIX releases
Console access is strongly recommended
Important: Before enabling a deny-all policy, ensure you have console access to the system. An incorrect filter configuration can prevent network access to the LPAR.
Steps
Step 1: Change the Default Rule to Deny All Traffic
Navigate to:
smit ipsec4 --> Advanced IP Security Configuration --> Configure IP Security Filter Rules --> Change IP Security Filter Rules.
Select the default filter rule:
0 permit 0.0.0.0 0.0.0.0 0.0.0.0 0.0.0.0 yes all any 0 any 0 both both n
Change Rule Action from permit to deny as below:
Change IP Security Filter Rules
Type or select values in entry fields.
Press Enter AFTER making all desired changes.
[TOP] [Entry Fields]
Filter ID 0
Rule Action [deny] + <<<<<<<<
IP Source Address [0.0.0.0]
IP Source Mask [0.0.0.0]
IP Destination Address [0.0.0.0]
IP Destination Mask [0.0.0.0]
Press Enter to apply the change.
A successful update displays a message similar to:
Filter rule 0 for IPv4 has been changed successfully.
At this point, the default policy is configured to deny all traffic. Additional permit rules must be added for any traffic that should be allowed.
Step 2: Create a Rule to Allow Incoming SSH Connections
Navigate to:
smit ipsec4 --> Advanced IP Security Configuration --> Configure IP Security Filter Rules --> Add an IP Security Filter Rule
Configure the rule as follows:
[TOP] [Entry Fields]
* Rule Action [permit] +
* IP Source Address [0.0.0.0] <<<<<<<<
* IP Source Mask [0.0.0.0] <<<<<<<<
IP Destination Address [0.0.0.0] <<<<<<<<
IP Destination Mask [0.0.0.0] <<<<<<<<
* Apply to Source Routing? (PERMIT/inbound only) [yes] +
* Protocol [all] +
* Source Port / ICMP Type Operation [any] +
* Source Port Number / ICMP Type [0] #
* Destination Port / ICMP Code Operation [eq] + <<<<<<<< Change it to "eq"
* Destination Port Number / ICMP Type [22] # <<<<<<<< Choose the port we need
* Routing [both] +
* Direction [both] +
* Log Control [no] +
* Fragmentation Control [0] +
* Interface [all] +
Expiration Time (sec) [] #
Pattern Type [none] +
Pattern / Pattern File []
Description []
[BOTTOM]
F1=Help F2=Refresh F3=Cancel F4=List
Esc+5=Reset F6=Command F7=Edit F8=Image
F9=Shell F10=Exit Enter=Do
This rule permits traffic destined for TCP port 22 from any source address.
Step 3: Create a Rule to Allow SSH Responses
SSH requires return traffic to be permitted. Create a second rule:
Navigate to:
smit ipsec4 --> Advanced IP Security Configuration --> Configure IP Security Filter Rules --> Add an IP Security Filter Rule
Configure the rule as follows:
[TOP] [Entry Fields]
* Rule Action [permit] +
* IP Source Address [0.0.0.0] <<<<<<<<
* IP Source Mask [0.0.0.0] <<<<<<<<
IP Destination Address [0.0.0.0] <<<<<<<<
IP Destination Mask [0.0.0.0] <<<<<<<<
* Apply to Source Routing? (PERMIT/inbound only) [yes] +
* Protocol [all] +
* Source Port / ICMP Type Operation [eq] + <<<<<<<< Change it to "eq"
* Source Port Number / ICMP Type [22] # <<<<<<<< Choose the port we need
* Destination Port / ICMP Code Operation [any] +
* Destination Port Number / ICMP Type [0] #
* Routing [both] +
* Direction [both] +
* Log Control [no] +
* Fragmentation Control [0] +
* Interface [all] +
Expiration Time (sec) [] #
Pattern Type [none] +
Pattern / Pattern File []
Description []
[BOTTOM]
This rule allows response traffic originating from port 22.
Step 4: Start IP Security
Navigate to:
smit ipsec4 -->Start/Stop IP Security -->Start IP Security
Specify:
Start IP Security
Type or select values in entry fields.
Press Enter AFTER making all desired changes.
[Entry Fields]
Start IP Security [Now and After Reboot] +
Deny All Non_Secure IP Packets [no] +
Press Enter.
Step 5: Activate the Filter Rules
Navigate to:
smit ipsec4 -->Advanced IP Security Configuration -->Activate/Update/Deactivate IP Security Filter Rule --> Activate / Update ( Enter )
Press Enter to activate the updated rule set.
Verification
After the rules are activated:
Verify SSH Access:
Attempt to establish an SSH connection to the LPAR:
ssh <hostname>
The connection should succeed.
Verify Other Traffic Is Blocked:
Attempt to ping the LPAR from another system:
ping <hostname>
The ping request should fail because ICMP traffic has not been explicitly permitted.
Similarly, all other ports should remain inaccessible unless corresponding permit rules are configured.
Step 6: Allowing Additional Ports ( Optional):
To enable additional services, create two permit rules for each required port:
A rule permitting traffic to the port.
A rule permitting traffic from the port.
For example, to allow HTTPS traffic, create equivalent rules for port 443 instead of port 22.
This approach provides a default-deny security posture while allowing only the services required by the system.
---------------------------------------------------------------------------------------------------------
Additional Information
SUPPORT:
If more assistance is required, follow these step-by-step instructions to contact IBM:
Open a case for software under warranty or an active and valid support contract.
The technical support specialist assigned to your case confirms these steps are completed:
a. Document and collect screen captures of all symptoms, errors, and messages that occurred
b. Capture any logs or data relevant to the situation
c. Contact IBM to open a case:
-For electronic support, visit the IBM Support Community:
https://www.ibm.com/mysupport
-If you require telephone support, visit the web page:
https://www.ibm.com/planetwide/
d. Provide a good description of your issue and refer to this document:
Working with IBM AIX Support: Collecting snap data
e. Upload all of the details and data to your case
-You can attach files to your case in the IBM Support Community
-Or upload to the IBM Enhanced Customer Data Repository
https://www.secure.ecurep.ibm.com/app/upload_sf
Document Location
Worldwide
Was this topic helpful?
Document Information
Modified date:
10 November 2026
UID
ibm17296131