| name | network-operations |
| description | Use when working with IPs, ports, firewall rules, routing, or diagnosing network connectivity issues |
Network Operations
Mode Detection
- Repo mode — can read and modify firewall configs, network manifests, cloud security group definitions.
- Chat mode — user describes connectivity issue or pastes output. Provide diagnosis and commands.
Connectivity Debugging Toolkit
ss -tlnp | grep <port>
netstat -tlnp | grep <port>
ping <host>
traceroute <host>
telnet <host> <port>
nc -zv <host> <port>
curl -v http://<host>:<port>/health
dig <hostname>
nslookup <hostname>
host <hostname>
lsof -i :<port>
fuser <port>/tcp
Firewall (Linux — iptables / ufw / firewalld)
ufw status verbose
ufw allow 443/tcp
ufw deny 22/tcp
ufw reload
firewall-cmd --list-all
firewall-cmd --add-port=443/tcp --permanent
firewall-cmd --reload
iptables -L -n -v
iptables -A INPUT -p tcp --dport 443 -j ACCEPT
Cloud Security Groups
AWS:
aws ec2 describe-security-groups --group-ids sg-xxxxxxxx
aws ec2 authorize-security-group-ingress \
--group-id sg-xxxxxxxx \
--protocol tcp --port 443 --cidr 0.0.0.0/0
GCP:
gcloud compute firewall-rules list
gcloud compute firewall-rules create allow-https \
--allow tcp:443 --source-ranges 0.0.0.0/0
Common Network Issues
| Symptom | Diagnosis |
|---|
| Connection refused | Service not running or wrong port |
| Connection timed out | Firewall blocking, wrong IP, routing issue |
| No route to host | Routing table, VPC/subnet misconfiguration |
| Intermittent drops | MTU mismatch, packet loss — run mtr |
| DNS not resolving | DNS server unreachable, wrong search domain |
IP & Routing
ip addr show
ip route show
ip route add 10.0.0.0/8 via <gateway>
kubectl get pods -o wide
kubectl get svc
kubectl get networkpolicy