Excellent resolution! Let me provide comprehensive guidance on configuring firewall policies for internal VPC traffic:
1. Firewall Policy Configuration Principles:
IBM Cloud VPCs use a combination of security groups and network ACLs for traffic control. Understanding the processing order is critical:
- Security Groups (Stateful): Attached to network interfaces, evaluate rules in any order (all allow rules are ORed together), return traffic is automatically allowed
- Network ACLs (Stateless): Attached to subnets, evaluate rules in priority order (lowest number first), require explicit rules for both directions
- Processing Order: Traffic entering a subnet first hits the network ACL, then the security group on the destination instance’s network interface
Your issue stems from a deny-all rule blocking internal traffic. The fix requires explicit allow rules for internal subnet communication.
2. Subnet CIDR Management for Internal Traffic:
When configuring firewall rules for multi-subnet applications, follow this pattern:
a) Identify all internal subnet CIDR ranges:
ibmcloud is subnets --output json | jq -r '.[] | "\(.name): \(.ipv4_cidr_block)"'
Document the CIDR ranges for each tier: web (10.240.10.0/24), app (10.240.11.0/24), data (10.240.12.0/24)
b) Create allow rules for internal traffic BEFORE deny rules:
If using network ACLs:
# Allow web -> app tier (port 8080)
ibmcloud is network-acl-rule-add ACL_ID allow inbound tcp \
--source-cidr 10.240.10.0/24 \
--destination-cidr 10.240.11.0/24 \
--destination-port-min 8080 --destination-port-max 8080 \
--priority 10
# Allow app -> data tier (port 5432)
ibmcloud is network-acl-rule-add ACL_ID allow inbound tcp \
--source-cidr 10.240.11.0/24 \
--destination-cidr 10.240.12.0/24 \
--destination-port-min 5432 --destination-port-max 5432 \
--priority 20
c) Add outbound rules for return traffic (network ACLs only):
# Allow return traffic from app -> web tier
ibmcloud is network-acl-rule-add ACL_ID allow outbound tcp \
--source-cidr 10.240.11.0/24 \
--destination-cidr 10.240.10.0/24 \
--source-port-min 8080 --source-port-max 8080 \
--priority 30
3. Rule Priority Troubleshooting:
Priority determines evaluation order (lower number = higher priority):
- Best Practice: Use priority increments of 10 (10, 20, 30…) to leave room for insertions
- Internal traffic rules: Priority 10-100
- External allow rules: Priority 100-200
- Deny rules: Priority 900-999 (evaluated last)
To reorder rules, you must delete and recreate them with new priorities. There’s no direct “update priority” command:
ibmcloud is network-acl-rule-delete ACL_ID RULE_ID
ibmcloud is network-acl-rule-add ACL_ID allow inbound tcp --priority 10 ...
4. Security Group Alternative (Recommended):
For internal application traffic, security groups are easier to manage than network ACLs:
a) Create security groups for each tier:
ibmcloud is security-group-create web-tier-sg VPC_ID
ibmcloud is security-group-create app-tier-sg VPC_ID
ibmcloud is security-group-create data-tier-sg VPC_ID
b) Add rules using security group references:
# Allow app tier to receive traffic from web tier on port 8080
ibmcloud is security-group-rule-add app-tier-sg inbound tcp \
--port-min 8080 --port-max 8080 \
--remote web-tier-sg
# Allow data tier to receive traffic from app tier on port 5432
ibmcloud is security-group-rule-add data-tier-sg inbound tcp \
--port-min 5432 --port-max 5432 \
--remote app-tier-sg
c) Attach security groups to instances:
ibmcloud is instance-network-interface-update INSTANCE_ID NIC_ID \
--security-groups web-tier-sg
5. Validation and Testing:
After configuring firewall policies:
a) Test connectivity between tiers:
# From web tier instance
telnet 10.240.11.5 8080
curl http://10.240.11.5:8080/health
b) Review effective rules:
ibmcloud is network-acl-rules ACL_ID --output json
ibmcloud is security-group-rules SG_ID --output json
c) Monitor for denied connections:
ibmcloud is flow-logs # Check VPC flow logs for dropped packets
Key Takeaways:
- Internal VPC traffic is subject to firewall policies just like external traffic
- Always place internal allow rules before deny-all rules
- Use security groups with remote references for application tier communication (stateful, easier)
- Reserve network ACLs for subnet-level policies and compliance requirements (stateless, complex)
- Document your subnet CIDR ranges and firewall rule priorities
- Test thoroughly after changes - firewall misconfigurations can cause complete service outages
Your specific issue was resolved by adding explicit allow rules for 10.240.10.0/24 → 10.240.11.0/24 traffic on port 8080 before the deny-all rule. For production environments, I strongly recommend migrating to security groups for application traffic control instead of network ACLs.