<html>
<head>
<base href="https://bugzilla.netfilter.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - iptables-save not showing default chains"
href="https://bugzilla.netfilter.org/show_bug.cgi?id=1752#c7">Comment # 7</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - iptables-save not showing default chains"
href="https://bugzilla.netfilter.org/show_bug.cgi?id=1752">bug 1752</a>
from <span class="vcard"><a class="email" href="mailto:phil@nwl.cc" title="Phil Sutter <phil@nwl.cc>"> <span class="fn">Phil Sutter</span></a>
</span></b>
<pre>Hi,
(In reply to ervrkharade from <a href="show_bug.cgi?id=1752#c4">comment #4</a>)
<span class="quote">>
> The main issue here is why iptables-save command not showing any output
> including default chains which are visible on Redhat, centOS etc.</span >
Here's a freshly booted CentOS-Stream-9 VM:
| [root@vm-10-0-185-242 ~]# uname -a
| Linux vm-10-0-185-242.hosted.upshift.rdu2.redhat.com 5.14.0-452.el9.x86_64 #1
SMP PREEMPT_DYNAMIC Sat May 18 20:39:48 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
| [root@vm-10-0-185-242 ~]# cat /etc/redhat-release
| CentOS Stream release 9
| [root@vm-10-0-185-242 ~]# iptables-save
| [root@vm-10-0-185-242 ~]#
<span class="quote">> for example in any Ubuntu it's not showing any default chains and In other
> Linux example CentOS , Redhat it shows default chains when we run
> iptables-save command example mentioned in the ticket description.
>
> you can try to run iptables-save command on redhat and ubuntu machine and
> see the difference in output.</span >
It is a misconception that iptables-save should print "default chains". In
fact, it will print only existing ones. See what happens on the same machine
when adding a rule to filter table's FORWARD chain:
| [root@vm-10-0-185-242 ~]# iptables -A FORWARD -j ACCEPT
| [root@vm-10-0-185-242 ~]# iptables-save
| # Generated by iptables-save v1.8.10 (nf_tables) on Tue Jun 11 08:02:35 2024
| *filter
| :INPUT ACCEPT [0:0]
| :FORWARD ACCEPT [0:0]
| :OUTPUT ACCEPT [0:0]
| -A FORWARD -j ACCEPT
| COMMIT
| # Completed on Tue Jun 11 08:02:35 2024</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are watching all bug changes.</li>
</ul>
</body>
</html>