{"id":402,"date":"2018-01-07T06:35:12","date_gmt":"2018-01-07T06:35:12","guid":{"rendered":"https:\/\/mellowhost.com\/blog\/?p=402"},"modified":"2018-01-07T06:35:12","modified_gmt":"2018-01-07T06:35:12","slug":"linux-assertion-failed-on-job-for-iptables-service","status":"publish","type":"post","link":"https:\/\/mellowhost.com\/blog\/linux-assertion-failed-on-job-for-iptables-service.html","title":{"rendered":"Linux: Assertion failed on job for iptables.service."},"content":{"rendered":"<p>If you are using Centos 7 or RHEL 7 or any of it&#8217;s variant, you are probably using &#8216;Firewalld&#8217; by default. Although, if you are a iptables fan like me, who likes it&#8217;s simplicity and manipulative nature instead of a full form firewall, then you probably have disabled firewalld from your CentOS 7 instance and using iptables. There are couple of servers, where I use runtime iptables rules for postrouting and masquerading. These rules are dynamically generated by my scripts instead of the sysconfig file under:<\/p>\n<p><code>\/etc\/sysconfig\/iptables<\/code><\/p>\n<p>This file is generated upon running the iptables save command:<\/p>\n<p><code>service iptables save<\/code><\/p>\n<p>which I rarely do so.<\/p>\n<p><strong>Error Details<\/strong><\/p>\n<p>Which is why, I don&#8217;t have a \/etc\/sysconfig\/iptables file in those servers and a common error I see while restarting iptables in those system is the following:<\/p>\n<p><code># systemctl restart iptables.service<br \/>\nAssertion failed on job for iptables.service.<\/code><\/p>\n<p><strong>How to Fix The Error<\/strong><\/p>\n<p>The error appears because you don&#8217;t have any rule in \/etc\/sysconfig\/iptables or the file doesn&#8217;t exist either. You can ignore the error as iptables would still run. To eradicate the error, simply make sure you have some iptables rules loaded on your system using the status command:<\/p>\n<p><code>iptables -S<\/code><\/p>\n<p>And then, run:<\/p>\n<p><code>service iptables save<\/code><\/p>\n<p>Once done, restarting iptables shouldn&#8217;t show the error any longer.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you are using Centos 7 or RHEL 7 or any of it&#8217;s variant, you are probably using &#8216;Firewalld&#8217; by default. Although, if you are a iptables fan like me, who likes it&#8217;s simplicity and manipulative nature instead of a full form firewall, then you probably have disabled firewalld from your CentOS 7 instance and &hellip; <a href=\"https:\/\/mellowhost.com\/blog\/linux-assertion-failed-on-job-for-iptables-service.html\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Linux: Assertion failed on job for iptables.service.&#8221;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[180,34,12,20,21,150,26],"tags":[156,220,199,219,70,218,221,198],"_links":{"self":[{"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/posts\/402"}],"collection":[{"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/comments?post=402"}],"version-history":[{"count":1,"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/posts\/402\/revisions"}],"predecessor-version":[{"id":403,"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/posts\/402\/revisions\/403"}],"wp:attachment":[{"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/media?parent=402"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/categories?post=402"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/tags?post=402"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}