openmediavault / openmediavault

openmediavault is the next generation network attached storage (NAS) solution based on Debian Linux. Thanks to the modular design of the framework it can be enhanced via plugins. openmediavault is primarily designed to be used in home environments or small home offices.
https://www.openmediavault.org
Other
5.02k stars 476 forks source link

Add "Interface" option when creating firewall rules. #1808

Open delaviux opened 1 month ago

delaviux commented 1 month ago

Hi. I don't know if something like this would be possible, but I would like to see the option of manually entering the name of a network interface, so that I can create firewall rules equivalent to this one from the web GUI: iptables -A INPUT -i docker0 -p tcp --destination-port 22 -j DROP

I've been having the problem of wanting to add a global rule that prevents my docker containers from using SSH. I found that one way to do it is with iptables and specifying the network interface. But I can't do that from the OMV web GUI. Or at least I think so. Oh, and thanks for creating OMV, thanks to it and the docker plugin I have been creating and using amazing applications.

votdev commented 1 month ago

You can add additional command line arguments by using the Extra Options field.

delaviux commented 1 month ago

You can add additional command line arguments by using the Extra Options field.

I did that. But then the rule I would create would look like this: iptables -A INPUT -p tcp --destination-port 22 -j DROP -i docker0

Would this work? I don't think so, since when I did it this way I was still able to connect via SSH. So putting interface after DROP doesn't work, or the solution I found doesn't work anymore. Thanks for answering me anyway.

votdev commented 1 month ago

The -j option can be at any position within the iptables options list. Same applies to the -i option. So the position should not make any difference and result in different behaviour of the command.