<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<atom:link href="https://dev1galaxy.org/extern.php?action=feed&amp;tid=4558&amp;type=rss" rel="self" type="application/rss+xml" />
		<title><![CDATA[Dev1 Galaxy Forum / How should I open up another port / set up extra firewall rules?]]></title>
		<link>https://dev1galaxy.org/viewtopic.php?id=4558</link>
		<description><![CDATA[The most recent posts in How should I open up another port / set up extra firewall rules?.]]></description>
		<lastBuildDate>Tue, 12 Oct 2021 21:57:09 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title><![CDATA[Re: How should I open up another port / set up extra firewall rules?]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=32059#p32059</link>
			<description><![CDATA[<p>For Devuan packages, use <a href="https://pkginfo.devuan.org/cgi-bin/policy-query.html?c=file&amp;q=ferm.conf" rel="nofollow">https://pkginfo.devuan.org/cgi-bin/poli … =ferm.conf</a></p>]]></description>
			<author><![CDATA[dummy@example.com (ralph.ronnquist)]]></author>
			<pubDate>Tue, 12 Oct 2021 21:57:09 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=32059#p32059</guid>
		</item>
		<item>
			<title><![CDATA[Re: How should I open up another port / set up extra firewall rules?]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=32051#p32051</link>
			<description><![CDATA[<p>@kjpetrie: There&#039;s an <span class="bbc">/etc/nftables.conf</span> , and nothing in <span class="bbc">/etc/init.d</span>.</p><p>I had a look at the man page for <span class="bbc">iptables-legacy</span> and it didn&#039;t tell me much; are you suggesting rules be added using this binary? Ok, that sounds reasonable; but it&#039;s only half the answer: Where/how are the existing rules added?</p><p>....</p><p><strong>Edit:</strong> Oh, I think I&#039;ve found a partial solution. Your grepping suggestion gave me the idea:</p><div class="codebox"><pre><code># grep -r iptables *
default/ferm:# use iptables-restore for fast firewall initialization?
multitail.conf:# linux iptables firewall</code></pre></div><p>the second line is a dud, but the first is part of a package called <span class="bbc">ferm</span>, and its <span class="bbc">/etc/ferm/ferm.conf</span> has syntax which would translate into almost all of the rules on my system:</p><div class="codebox"><pre class="vscroll"><code>domain (ip ip6) {
    table filter {
        chain INPUT {
            policy DROP;

            # connection tracking
            mod state state INVALID DROP;
            mod state state (ESTABLISHED RELATED) ACCEPT;

            # allow local packet
            interface lo ACCEPT;

            # respond to ping
            proto icmp ACCEPT; 

            # allow IPsec
            proto udp dport 500 ACCEPT;
	    @if @eq($DOMAIN, ip) {
	      proto (esp ah) ACCEPT;
	    } @else {
	      proto (esp) ACCEPT;
	    }

            # allow SSH connections
            proto tcp dport ssh ACCEPT;
        }
        chain OUTPUT {
            policy ACCEPT;

            # connection tracking
            #mod state state INVALID DROP;
            mod state state (ESTABLISHED RELATED) ACCEPT;
        }
        chain FORWARD {
            policy DROP;

            # connection tracking
            mod state state INVALID DROP;
            mod state state (ESTABLISHED RELATED) ACCEPT;
        }
    }
}</code></pre></div><p>I think only the SSH port being open is unaccounted for in this file. Where could it be coming from?</p>]]></description>
			<author><![CDATA[dummy@example.com (einpoklum)]]></author>
			<pubDate>Tue, 12 Oct 2021 17:27:57 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=32051#p32051</guid>
		</item>
		<item>
			<title><![CDATA[Re: How should I open up another port / set up extra firewall rules?]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=32047#p32047</link>
			<description><![CDATA[<div class="codebox"><pre><code>man iptables-legacy</code></pre></div><p> for more information.</p><p>What do </p><div class="codebox"><pre><code>ls /etc/*tables*</code></pre></div><p> and </p><div class="codebox"><pre><code>/etc/init.d/*tables*</code></pre></div><p> show?</p>]]></description>
			<author><![CDATA[dummy@example.com (kjpetrie)]]></author>
			<pubDate>Tue, 12 Oct 2021 11:09:30 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=32047#p32047</guid>
		</item>
		<item>
			<title><![CDATA[How should I open up another port / set up extra firewall rules?]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=32036#p32036</link>
			<description><![CDATA[<p>I&#039;m using Devuan Chimaera on a (physical) machine of mine.</p><p>I am running an app which needs to take incoming connections over some TCP port (say 5123). I had (mistakenly) assumed my ports would be open by default if I listened on them - since SSH to my machine to other, and I haven&#039;t done anything to open up port 22. However - that&#039;s not the case. It&#039;s not even the case for sshd itself: If I add a <span class="bbc">Port 5123</span> statement to <span class="bbc">/etc/sshd_config</span>, I can ssh through port 5123 from localhost, but not from other machines.</p><p>So, I started looking into the Linux firewall business, which I haven&#039;t really touched for many years; and specifically to the situation on Devuan (without me having installed any special relevant packages).</p><p>It seems that there are some &quot;legacy iptables&quot; rules in effect; <span class="bbc">iptables-legacy-save</span> yields:</p><div class="codebox"><pre><code>*filter
:INPUT DROP [23:3096]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [21257:2268987]
-A INPUT -m state --state INVALID -j DROP
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -p udp -m udp --dport 500 -j ACCEPT
-A INPUT -p esp -j ACCEPT
-A INPUT -p ah -j ACCEPT
-A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
-A FORWARD -m state --state INVALID -j DROP
-A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
-A OUTPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
COMMIT</code></pre></div><p>but nothing with <span class="bbc">nft flush ruleset</span>.</p><p>Now, I&#039;m able to manually write an extra iptables rule for the port I want. But - I don&#039;t know where and when these rules are applied, so that I could add to them in a persistent manner. I&#039;m also able (I think) to generate an <span class="bbc">/etc/nftables.conf</span> to suit my needs - but that doesn&#039;t get loaded at all (AFAICT). I could ensure it&#039;s loaded with an <span class="bbc">/etc/init.d</span> to load it, but - that would clash with whatever loads the iptables rules right now, wouldn&#039;t it?</p><p>So, bottom line: How should I add another persistent rule for opening additional ports?</p>]]></description>
			<author><![CDATA[dummy@example.com (einpoklum)]]></author>
			<pubDate>Mon, 11 Oct 2021 16:40:51 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=32036#p32036</guid>
		</item>
	</channel>
</rss>
