{"id":1653,"date":"2025-02-06T14:04:08","date_gmt":"2025-02-06T17:04:08","guid":{"rendered":"https:\/\/blog.galsoft.com.ar\/?p=1653"},"modified":"2025-02-06T14:04:08","modified_gmt":"2025-02-06T17:04:08","slug":"persistencia-de-iptables","status":"publish","type":"post","link":"https:\/\/blog.galsoft.com.ar\/?p=1653","title":{"rendered":"Persistencia de IPTables"},"content":{"rendered":"<p>Para persistir la configuraci\u00f3n de iptables,\u00a0<mark>se puede usar el paquete iptables-persistent o el comando iptables-save<\/mark>.\u00a0<\/p>\n<p>iptables-persistent\u00a0<\/p>\n<ul class=\"wp-block-list\">\n<li>Se usa en sistemas basados en Debian, como Ubuntu<\/li>\n\n<li>Se instala con el comando\u00a0<code>sudo apt install iptables-persistent<\/code><\/li>\n\n<li>Durante la instalaci\u00f3n, se solicita guardar las reglas actuales<\/li>\n\n<li>Para guardar las reglas manualmente, se usa el comando\u00a0<code>sudo netfilter-persistent save<\/code><\/li>\n<\/ul>\n<p>iptables-save\u00a0<\/p>\n<ul class=\"wp-block-list\">\n<li>Se usa para guardar las reglas de iptables en un archivo<\/li>\n\n<li>Se escribe el comando\u00a0<code>iptables-save &gt; &lt;nombredearchivo&gt;<\/code>\u00a0como root<\/li>\n\n<li>Se puede usar para guardar las reglas del firewall de iptables para siempre<\/li>\n<\/ul>\n<p>Restaurar reglas<\/p>\n<ul class=\"wp-block-list\">\n<li>Se puede usar el comando\u00a0<code>iptables-restore<\/code>\u00a0para restaurar reglas y tablas de firewall IPv4 o IPv6 desde un archivo determinado\u00a0<\/li>\n\n<li>Se puede a\u00f1adir el comando\u00a0<code>sudo iptables-restore &lt; \/etc\/iptables\/rules.v4<\/code>\u00a0a un script de inicio\u00a0<\/li>\n<\/ul>\n<p>Eliminar reglas persistentes\u00a0<\/p>\n<ul class=\"wp-block-list\">\n<li>Se puede abrir el archivo\u00a0<code>\/etc\/sysconfig\/iptables<\/code>\u00a0o\u00a0<code>\/etc\/sysconfig\/ip6tables<\/code>\u00a0relevante y eliminar las l\u00edneas que contengan todas las reglas no deseadas<\/li>\n<\/ul>","protected":false},"excerpt":{"rendered":"<p>Para persistir la configuraci\u00f3n de iptables,\u00a0se puede usar el paquete iptables-persistent o el comando iptables-save.\u00a0 iptables-persistent\u00a0 iptables-save\u00a0 Restaurar reglas Eliminar reglas persistentes\u00a0<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ocean_post_layout":"","ocean_both_sidebars_style":"","ocean_both_sidebars_content_width":0,"ocean_both_sidebars_sidebars_width":0,"ocean_sidebar":"","ocean_second_sidebar":"","ocean_disable_margins":"enable","ocean_add_body_class":"","ocean_shortcode_before_top_bar":"","ocean_shortcode_after_top_bar":"","ocean_shortcode_before_header":"","ocean_shortcode_after_header":"","ocean_has_shortcode":"","ocean_shortcode_after_title":"","ocean_shortcode_before_footer_widgets":"","ocean_shortcode_after_footer_widgets":"","ocean_shortcode_before_footer_bottom":"","ocean_shortcode_after_footer_bottom":"","ocean_display_top_bar":"default","ocean_display_header":"default","ocean_header_style":"","ocean_center_header_left_menu":"","ocean_custom_header_template":"","ocean_custom_logo":0,"ocean_custom_retina_logo":0,"ocean_custom_logo_max_width":0,"ocean_custom_logo_tablet_max_width":0,"ocean_custom_logo_mobile_max_width":0,"ocean_custom_logo_max_height":0,"ocean_custom_logo_tablet_max_height":0,"ocean_custom_logo_mobile_max_height":0,"ocean_header_custom_menu":"","ocean_menu_typo_font_family":"","ocean_menu_typo_font_subset":"","ocean_menu_typo_font_size":0,"ocean_menu_typo_font_size_tablet":0,"ocean_menu_typo_font_size_mobile":0,"ocean_menu_typo_font_size_unit":"px","ocean_menu_typo_font_weight":"","ocean_menu_typo_font_weight_tablet":"","ocean_menu_typo_font_weight_mobile":"","ocean_menu_typo_transform":"","ocean_menu_typo_transform_tablet":"","ocean_menu_typo_transform_mobile":"","ocean_menu_typo_line_height":0,"ocean_menu_typo_line_height_tablet":0,"ocean_menu_typo_line_height_mobile":0,"ocean_menu_typo_line_height_unit":"","ocean_menu_typo_spacing":0,"ocean_menu_typo_spacing_tablet":0,"ocean_menu_typo_spacing_mobile":0,"ocean_menu_typo_spacing_unit":"","ocean_menu_link_color":"","ocean_menu_link_color_hover":"","ocean_menu_link_color_active":"","ocean_menu_link_background":"","ocean_menu_link_hover_background":"","ocean_menu_link_active_background":"","ocean_menu_social_links_bg":"","ocean_menu_social_hover_links_bg":"","ocean_menu_social_links_color":"","ocean_menu_social_hover_links_color":"","ocean_disable_title":"default","ocean_disable_heading":"default","ocean_post_title":"","ocean_post_subheading":"","ocean_post_title_style":"","ocean_post_title_background_color":"","ocean_post_title_background":0,"ocean_post_title_bg_image_position":"","ocean_post_title_bg_image_attachment":"","ocean_post_title_bg_image_repeat":"","ocean_post_title_bg_image_size":"","ocean_post_title_height":0,"ocean_post_title_bg_overlay":0.5,"ocean_post_title_bg_overlay_color":"","ocean_disable_breadcrumbs":"default","ocean_breadcrumbs_color":"","ocean_breadcrumbs_separator_color":"","ocean_breadcrumbs_links_color":"","ocean_breadcrumbs_links_hover_color":"","ocean_display_footer_widgets":"default","ocean_display_footer_bottom":"default","ocean_custom_footer_template":"","ocean_post_oembed":"","ocean_post_self_hosted_media":"","ocean_post_video_embed":"","ocean_link_format":"","ocean_link_format_target":"self","ocean_quote_format":"","ocean_quote_format_link":"post","ocean_gallery_link_images":"on","ocean_gallery_id":[],"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1653","post","type-post","status-publish","format-standard","hentry","category-linux","entry"],"_links":{"self":[{"href":"https:\/\/blog.galsoft.com.ar\/index.php?rest_route=\/wp\/v2\/posts\/1653","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.galsoft.com.ar\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.galsoft.com.ar\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.galsoft.com.ar\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.galsoft.com.ar\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1653"}],"version-history":[{"count":1,"href":"https:\/\/blog.galsoft.com.ar\/index.php?rest_route=\/wp\/v2\/posts\/1653\/revisions"}],"predecessor-version":[{"id":1655,"href":"https:\/\/blog.galsoft.com.ar\/index.php?rest_route=\/wp\/v2\/posts\/1653\/revisions\/1655"}],"wp:attachment":[{"href":"https:\/\/blog.galsoft.com.ar\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1653"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.galsoft.com.ar\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1653"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.galsoft.com.ar\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1653"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}