Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop deprecating OpenWrt's firewall package #139

Merged
merged 2 commits into from
Mar 27, 2023

Conversation

ilario
Copy link
Member

@ilario ilario commented Jun 13, 2021

See discussion on libremesh/lime-packages#280

@G10h4ck
Copy link
Member

G10h4ck commented Jun 14, 2021

Everytime I have tested building with OpenWrt firewall bundled in, and flashed in real world networks I ended up with a hurdle of problems and debugging them rapidly ended up in some weird interaction between OpenWrt firewall which is designed around home gateway setup and how the packets flow in a mesh. So I am against stopping suggesting to remove firewall package and for keeping compatibility as much as possible both with plain iptables and OpenWrt firewall.

@ilario
Copy link
Member Author

ilario commented Jun 14, 2021

@ilario
Copy link
Member Author

ilario commented Jul 14, 2021

@G10h4ck hint for answering: none is problematic.

@ilario
Copy link
Member Author

ilario commented Nov 7, 2022

Update on this: since OpenWrt 22.03 now firewall4 is the default choice, and the default rules are these ones

https://git.openwrt.org/?p=project/firewall4.git;a=blob;f=root/etc/config/firewall;hb=HEAD

@ilario
Copy link
Member Author

ilario commented Feb 1, 2023

Update on this: since OpenWrt 22.03 now firewall4 is the default choice, and the default rules are these ones

https://git.openwrt.org/?p=project/firewall4.git;a=blob;f=root/etc/config/firewall;hb=HEAD

I went through the rules, they can be resumed as:
Allow everything out
Allow everything in forwarding
Block everything incoming from WAN port
Create a lot of exceptions for the previous rule

So I hold my opinion also for firewall4: it should be ok with LibreMesh.

@ilario
Copy link
Member Author

ilario commented Feb 1, 2023

We could document how to easily enable the SSH port on the WAN, or enable it by default and document how to disable it, see discussion on libremesh/lime-packages#280

Another reason for blocking the 80 and 443 ports is that when FirstBootWizard is used, it spreads the hash of the root password via a file accessible via HTTP on http://thisnode.info/cgi-bin/lime/lime-community

https://github.com/libremesh/lime-packages/blob/8b54080ff47554028eec6aa9325e70ab064128af/packages/lime-system/files/usr/lib/lua/lime/utils.lua#L360

https://github.com/libremesh/lime-packages/blob/2289487914b9488669acd5b62a51bde5f4700abc/packages/first-boot-wizard/files/www/cgi-bin/lime/lime-community

There are reports of people using WAN-WAN connections for limiting the broadcast traffic going across this link @nicopace , for example if they use this link for connecting two clouds. This on a first sight seems a very bad idea (see my comments on libremesh/lime-packages#280 ) but actually the LAN-LAN connections can carry more broadcast (supposing that WAN and LAN are not in the same bridge, thing that I don't remember) even if the batman-adv clouds are on different VLANs. If we don't find a better way to do the same, we could support and document the usage of WAN-WAN connections.
Which rules would be needed in this case?

@ilario
Copy link
Member Author

ilario commented Feb 14, 2023

Answering to @G10h4ck here: libremesh/lime-packages#959 (comment)

Ilario: why the WAN interface was added to bat0? With the current code, there are interfaces like eth0-2_29 (a VLAN created on top of the WAN) being added to bat0, but this sounds useless and unsafe to me. So I did not add WAN interface to bat0, but only LAN ones.

G10h4ck: It is not useless, and not dangerous, please keep this behaviour unchanged, so keep the wan interface used for mesh too by default

Ilario: Ok, anyway the firewall will block it, so ok.

G10h4ck: Also because of that it should not be installed :-p

The people who need the WAN-WAN mesh connections should just add one line of configuration for allowing the connections on that port, configuring the firewall, as suggested in the discussion above. Obviously, we need to document that.

@ilario
Copy link
Member Author

ilario commented Feb 24, 2023

Another reason for blocking the 80 and 443 ports is that when FirstBootWizard is used, it spreads the hash of the root password via a file accessible via HTTP on http://thisnode.info/cgi-bin/lime/lime-community

This specific thing is commented more in detail here:
libremesh/lime-packages#849

@ilario
Copy link
Member Author

ilario commented Mar 24, 2023

I added the documentation in ab7491f

I specified both how to connect via SSH from the WAN port (opening port 22) and how to open it completely for WAN-WAN connections.

Please, people using WAN-WAN connections, can you confirm that the documentation is correct?
Maybe @nicopace @nicoechaniz @altergui @G10h4ck @spiccinini ?

In the meantime, for the rest of the users I am sure it is better to have the firewall up (see the conversation above), can we merge this?

@G10h4ck G10h4ck merged commit b60b301 into libremesh:master Mar 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants