OPNsense Forum

Archive => 20.7 Legacy Series => Topic started by: stop.eject on August 11, 2020, 06:59:03 AM

Title: Can't specify a port in firewall rules
Post by: stop.eject on August 11, 2020, 06:59:03 AM
I want to restrict traffic to RDP. When I save the rule, it still passes traffic on all ports. This issue is not restricted to RDP, any other port selection is also not saved.
See the attached screenshots.
Title: Re: Can't specify a port in firewall rules
Post by: lar.hed on August 11, 2020, 11:42:32 AM
You have to fill in from and to port.
Title: Re: Can't specify a port in firewall rules
Post by: franco on August 11, 2020, 03:46:44 PM
Or only from I think.


Cheers,
Franco
Title: Re: Can't specify a port in firewall rules
Post by: lar.hed on August 11, 2020, 04:29:44 PM
Correct, from will somehow copy itself to to :-)
Title: Re: Can't specify a port in firewall rules
Post by: stop.eject on August 12, 2020, 05:12:17 AM
Quote from: franco on August 11, 2020, 03:46:44 PM
Or only from I think.


Cheers,
Franco
Ha-ha, thanks! My inattentiveness bites again! Somehow I mistook "from" as "source port". Shame on me.
Title: Re: Can't specify a port in firewall rules
Post by: franco on August 12, 2020, 09:21:42 AM
No worries, was confused for a second there too :)
Title: Re: Can't specify a port in firewall rules
Post by: Vilhonator on August 12, 2020, 09:42:56 AM
You need to specify destination host, otherwise incoming RDP traffic from designated source (which are set to be all IPs which begin as 10.200.1) will be forwarded to next available RDP server within the network, which is something that can be exploited.

You must always specify destination host even with LAN to LAN connections. Source address is needed, if you want to allow connection from specific source IP or specific network.

If you mean to have multiple machines with RDP enabled in your LAN, and you want to allow access only within same LAN, then you don't need to create firewall rule for it (Devices within same network are always able to communicate with each other, you only need to add LAN rules, when you want to restrict LAN).

If you have multiple LANs on your firewall and want to allow only RDP connection between 2 separate networks, then you can create a rule like that, but I much rather would create VLAN, static route and add block rule for webgui, ICMP etc. for it.
Title: Re: Can't specify a port in firewall rules
Post by: stop.eject on August 12, 2020, 04:08:17 PM
You are correct, the rules should be defined as narrow as possible. I left "any" in the rule to take a screenshot withot exposing the server IP.