9/3/2023 0 Comments Iptables tutorial![]() $ sudo iptables -A INPUT -p tcp -dport 443 -j ACCEPT $ sudo iptables -A INPUT -p tcp -dport 80 -j ACCEPT $ sudo iptables -A INPUT -p tcp -dport 22 -j ACCEPT $ sudo iptables-restore < iptable_filenameĪllow only connection to port 22, 80 and 443 ![]() List specific chain rules (INPUT/FORWARD/OUTPUT)Ĭhain INPUT (policy ACCEPT 456 packets, 32854 bytes).Pkts bytes target prot opt in out source destinationĤ 220 DROP tcp - * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:80Ĭhain FORWARD (policy ACCEPT 0 packets, 0 bytes)Ĭhain OUTPUT (policy ACCEPT 345 packets, 74880 bytes) Here are some handy examples using iptables for IPv4 (for IPv6 use ip6tables, iptables-save, iptables-restore) List iptable rulesĬhain INPUT (policy ACCEPT 465 packets, 33446 bytes) Rules added using iptables are not persisted automatically.First matching rules applies in case multiple rules match.Linux iptables is a user-space application program that allows a system administrator to configure the tables provided by the Linux kernel firewall (implemented as different Netfilter modules) and the chains and rules it stores.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |