{"id":40550,"date":"2020-09-28T09:01:50","date_gmt":"2020-09-28T14:01:50","guid":{"rendered":"https:\/\/webirix.com\/?p=40550"},"modified":"2020-09-28T09:01:50","modified_gmt":"2020-09-28T14:01:50","slug":"iptables-que-debes-conocer","status":"publish","type":"post","link":"https:\/\/webirix.com\/en\/iptables-que-debes-conocer\/","title":{"rendered":"IPTABLES that you should know."},"content":{"rendered":"<div class=\"post-57 post type-post status-publish format-standard has-post-thumbnail hentry category-linux-server\">\n<div class=\"entry-content\">\n<p>Iptables is a command line utility for configuring the Linux kernel firewall. The term iptables is also commonly used to refer to such a kernel firewall. Can be configured directly with iptables, or using one of the many existing console and graphics frontend<\/p>\n<p>THE MOST COMMON IPTABLES ARE:<\/p>\n<p>BLOCK A PORT: In this example, port 111 is blocked<\/p>\n<pre class=\"wp-block-preformatted\">  iptables -A INPUT -p udp -m tcp \u2013dport -j DROP\r\n<\/pre>\n<p>ALLOW AN IP In this example all requests from ip 127.0.0.1 are accepted<\/p>\n<pre class=\"wp-block-preformatted\">  iptables -I INPUT -s 127.0.0.1\/30 -j ACCEPT\r\n<\/pre>\n<p>OPEN A PORT<\/p>\n<pre class=\"wp-block-preformatted\">  iptables -A INPUT -p tcp \u2013dport 22 -j ACCEPT\r\n<\/pre>\n<p>ALLOW AN IP RANGE in this option there are two ways to do it, the first is only if you want to allow an IP range (such as 162.168.10.20 to 192.168.10.80), the second is by segments placing \/ 24 in this option, take into account that \/ 24 allows a range of 254 hosts.<\/p>\n<pre class=\"wp-block-preformatted\">  iptables -A INPUT -i eth1 -m iprange \u2013src-range 162.168.10.20-80 -j ACCEPT\r\n<\/pre>\n<pre class=\"wp-block-preformatted\">  iptables -A INPUT -i eth1 -s 10.50.0.0\/16 -j ACCEPT\r\n<\/pre>\n<p>BLOCK ALL PORTS EXCEPT 80,443,22,25<\/p>\n<pre class=\"wp-block-preformatted\">  iptables -A INPUT -p tcp -m tcp -m multiport! \u2013Dports 80,443,22,25 -j DROP<\/pre>\n<\/div>\n<\/div>\n<nav class=\"navigation post-navigation\" role=\"navigation\" aria-label=\"Entradas\">\n<h2 class=\"screen-reader-text\"><\/h2>\n<\/nav>","protected":false},"excerpt":{"rendered":"<p>Iptables is a command line utility for configuring the Linux kernel firewall. The term iptables is also commonly used to refer to such a kernel firewall. It can be configured directly with iptables, or using one of the many existing console and graphics frontend. THE MOST COMMON IPTABLES ARE: BLOCK A PORT:\u2026<\/p>","protected":false},"author":27,"featured_media":40551,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2256,2024,2027,2025],"tags":[],"class_list":["post-40550","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ip","category-linux","category-seguridad","category-servidores"],"jetpack_featured_media_url":"https:\/\/webirix.com\/wp-content\/uploads\/2020\/09\/iptables-1.jpg","_links":{"self":[{"href":"https:\/\/webirix.com\/en\/wp-json\/wp\/v2\/posts\/40550","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webirix.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webirix.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webirix.com\/en\/wp-json\/wp\/v2\/users\/27"}],"replies":[{"embeddable":true,"href":"https:\/\/webirix.com\/en\/wp-json\/wp\/v2\/comments?post=40550"}],"version-history":[{"count":2,"href":"https:\/\/webirix.com\/en\/wp-json\/wp\/v2\/posts\/40550\/revisions"}],"predecessor-version":[{"id":40553,"href":"https:\/\/webirix.com\/en\/wp-json\/wp\/v2\/posts\/40550\/revisions\/40553"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/webirix.com\/en\/wp-json\/wp\/v2\/media\/40551"}],"wp:attachment":[{"href":"https:\/\/webirix.com\/en\/wp-json\/wp\/v2\/media?parent=40550"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webirix.com\/en\/wp-json\/wp\/v2\/categories?post=40550"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webirix.com\/en\/wp-json\/wp\/v2\/tags?post=40550"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}