Skip to content

Firewall Rules: show loopback auto-rules#4868

Closed
kulikov-a wants to merge 1 commit intoopnsense:masterfrom
kulikov-a:patch-12
Closed

Firewall Rules: show loopback auto-rules#4868
kulikov-a wants to merge 1 commit intoopnsense:masterfrom
kulikov-a:patch-12

Conversation

@kulikov-a
Copy link
Member

Hi!
ref. https://forum.opnsense.org/index.php?topic=22278.0
Probably more of a question than a request and definitely not urgent.
Now the "Automatically generated rules" 'pass loopback' and 'Pass all loopback IPv6' for the Loopback interface are not displayed in Firewall: Rules: Loopback.
confusing a little..
and it seems that this is due to that this rules is registered with the loopback interface, and the GET request goes with the value if=lo0.
if, for these rules, only lo0->loopback is mapped (not lo group)

public function setInterfaceMapping(&$mapping)
{
$this->interfaceMapping = array();
$this->interfaceMapping['loopback'] = array('if' => 'lo0', 'descr' => 'loopback');
$this->interfaceMapping = array_merge($this->interfaceMapping, $mapping);
// generate virtual IPv6 interfaces

then perhaps we can register rules directly with the lo0 interface? then these rules are displayed in the GUI for Loopback if.
rule management is too complex and I'm probably missing something

thanks!

@fichtner
Copy link
Member

I suspect there is some internal plumbing and rewrite that should die with said transition (loopback => lo0 correction somewhere internally), but avoiding breakage in all edge cases is difficult...

@AdSchellevis AdSchellevis self-assigned this Mar 26, 2021
@AdSchellevis
Copy link
Member

We added loopback last year (57bd1f2), which was at first more or less an experiment to be able to configure direct rules on loopback (partly because additional loopbacks don't receive loopback traffic, opnsense/src#65).

Now it's in, we should at least try to make sure it's as transparant as possible, will check this out when I have some time available.

@AdSchellevis AdSchellevis added the cleanup Low impact changes label Mar 26, 2021
@kulikov-a
Copy link
Member Author

@fichtner @AdSchellevis thanks for the clarifications!
I'll leave the changes from the request on my test vm and take a look at rules management behavior (still playing with spinning icons) - maybe some side effect will come out.
is there anything I should do with this request? (convert to draft, close?)

@AdSchellevis
Copy link
Member

just leave it as is, I'll take it from here

AdSchellevis added a commit that referenced this pull request Mar 27, 2021
o cleanup remnants of previous loopback construction, which is redundant with 57bd1f2 in place
@AdSchellevis
Copy link
Member

@kulikov-a can you try bd26a58 ? the loopback seemed to be redundant indeed.

@kulikov-a
Copy link
Member Author

@AdSchellevis works great! thanks!

@kulikov-a kulikov-a deleted the patch-12 branch March 27, 2021 19:23
@AdSchellevis
Copy link
Member

@kulikov-a thanks for conforming!

fichtner pushed a commit that referenced this pull request Apr 19, 2021
o cleanup remnants of previous loopback construction, which is redundant with 57bd1f2 in place

(cherry picked from commit bd26a58)
oshogbo pushed a commit to DynFi/opnsense-core that referenced this pull request Mar 3, 2022


o cleanup remnants of previous loopback construction, which is redundant with opnsense/core@57bd1f2 in place
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cleanup Low impact changes

Development

Successfully merging this pull request may close these issues.

3 participants