iptables
Configure tables, chains, and rules of the Linux kernel IPv4 firewall. tldr-pages
On Linux 3 Sigma rules name it
Linux
Configure tables, chains, and rules of the Linux kernel IPv4 firewall. Use ip6tables to set rules for IPv6 traffic.
View chains, rules, packet/byte counters, and line numbers for the filter table
sudo iptables --verbose --numeric --list --line-numbersIdentifyTrips 1 Sigma rule: informationalSystem Network Discovery - Linux by Ömer Günal and remotephone, oscd.community
Set chain policy rule
sudo iptables --policy chain ruleIdentifyTrips 1 Sigma rule: informationalSystem Network Discovery - Linux by Ömer Günal and remotephone, oscd.community
Append rule to chain policy for IP
sudo iptables --append chain --source ip_address --jump ruleIdentifyTrips 1 Sigma rule: informationalSystem Network Discovery - Linux by Ömer Günal and remotephone, oscd.community
Append rule to chain policy for IP considering protocol and port
sudo iptables --append chain --source ip_address --protocol tcp --dport port --jump ruleIdentifyTrips 1 Sigma rule: informationalSystem Network Discovery - Linux by Ömer Günal and remotephone, oscd.community
Add a NAT rule to translate all traffic from the 192.168.0.0/24 subnet to the host's public IP
sudo iptables --table nat --append POSTROUTING --source 192.168.0.0/24 --jump MASQUERADEIdentifyTrips 1 Sigma rule: informationalSystem Network Discovery - Linux by Ömer Günal and remotephone, oscd.community
Delete chain rule
sudo iptables --delete chain rule_line_numberIdentifyTrips 1 Sigma rule: informationalSystem Network Discovery - Linux by Ömer Günal and remotephone, oscd.community