Home
Help
Search
Login
Register
OPNsense Forum
»
English Forums
»
General Discussion
»
Why firewall rules and vlans must use /32
« previous
next »
Print
Pages: [
1
]
Author
Topic: Why firewall rules and vlans must use /32 (Read 2815 times)
buildabob
Newbie
Posts: 3
Karma: 0
Why firewall rules and vlans must use /32
«
on:
January 21, 2020, 09:09:16 pm »
Can someone explain this to me? I did a brief search but couldn't find much.
I'm Cisco trained, have used pfSense for about a year and am on OPNSense, but do not understand why I need to use /32 instead of conventional notation.
I don't see this documented anywhere but have seen it in postings which lead me to use the /32 format for rules, vlans, etc with success.
Logged
fabian
Hero Member
Posts: 2769
Karma: 200
OPNsense Contributor (Language, VPN, Proxy, etc.)
Re: Why firewall rules and vlans must use /32
«
Reply #1 on:
January 21, 2020, 10:14:30 pm »
This is standard CIDR notation of the subnet mask if I understand your question correctly. It is the count of bits which are set (network part). /32 for IPv4 means you have an address identifying a single host.
Logged
buildabob
Newbie
Posts: 3
Karma: 0
Re: Why firewall rules and vlans must use /32
«
Reply #2 on:
January 21, 2020, 10:38:00 pm »
Right, but /24 is the actual network which OPNSense then blocks or passes the entire subnet. This CIDR notation works correctly on other systems, for example, /12, /26, but you have to use a "network of one" /32 on OPNSense when setting a rule for a single host. If I have a host with an IP of 192.168.1.5/24 I have to set that up as 192.168.1.5/32 for the rules to work correctly.
I've not seen that elsewhere, you would simply use 192.168.1.5/24.
«
Last Edit: January 21, 2020, 11:06:07 pm by buildabob
»
Logged
siga75
Full Member
Posts: 187
Karma: 11
Re: Why firewall rules and vlans must use /32
«
Reply #3 on:
January 22, 2020, 08:42:42 am »
192.168.1.5/24 is providing 2 information, the IP of the host and the netmask (from which of course you can calculate the network IP)
192.168.1.5 is just equivalent of 192.168.1.5/32, a single IP
the netmask is there so you can also specify the entire subnet, 192.168.1.0/24
you cannot specify 192.168.1.5/24 because it will not understand if you want the entire subnet or the single IP
«
Last Edit: January 22, 2020, 04:01:17 pm by siga75
»
Logged
https://www.signorini.ch
Protectli Pfsense Mi7500L6 Intel 7Th Gen Core I7 7500U 16Gb Ddr4 Ram
512Gb Msata Ssd
6 X Intel Gigabit Ethernet
buildabob
Newbie
Posts: 3
Karma: 0
Re: Why firewall rules and vlans must use /32
«
Reply #4 on:
January 22, 2020, 05:44:38 pm »
Ok, thanks, that's what I was asking. I completely understand that explanation. Kind of curious they do it that way relative to how most others do it but it works and that's what counts. Thanks!
Logged
Print
Pages: [
1
]
« previous
next »
OPNsense Forum
»
English Forums
»
General Discussion
»
Why firewall rules and vlans must use /32