Hi all,
My first time setting this up, but I write software for a living so I'm reasonably ok with technical help.
I set my WAN (which goes to the internet provider) to a non DHCP setup, my ISP can't provide it for some reason.
I enter my IP address *.*.*.201
Then Enter the new Wan IPv4 subnet bit count to 31. The subnet should be 255.255.255.254.
I get the error:-
"You cannot set network address to an interface"
Any ideas?
Cheers
Clinton
hi
It seems that the setaddr.php script makes no exception for /31, /32 networks on address validation.
you can try to set /24 (or some) network on wizard and then change this settings in web-GUI
Thanks for that idea mate.
I actually edited the conf XML file and put the values in manually.
I also looked at the code on GitHub to see how it works and there is probably a pull request I could do to fix it.
Cheers
/31 has the problem that only two addresses exist and the first is the network address and the second one is the broadcast address. There is no room to fit a host address and both setport.sh and interfaces.php do validate this in the IPv4 case.
Circumventing this restriction is not great...
Cheers,
Franco
Quote from: franco on July 13, 2021, 11:58:21 AM
/31 has the problem that only two addresses exist and the first is the network address and the second one is the broadcast address. There is no room to fit a host address and both setport.sh and interfaces.php do validate this in the IPv4 case.
That is not correct. 31 has two host addresses. The broadcast address is the other host address. Network is probably handled the same way. This special net ask is not supported by all operating systems.
> 31 has two host addresses. The broadcast address is the other host address.
Sorry, this is nonsense. It can't be both.
> This special net ask is not supported by all operating systems.
Which is, um, why it's not supported. I have difficulty grasping your answer as a whole.
Cheers,
Franco
If you want to split hairs on "usabe" hosts fine, but the point remains the same, i.e. https://www.calculator.net/ip-subnet-calculator.html at the bottom.
@franco, sorry, but / 31 subnets are allowed and can be used to reduce address consumption (https://datatracker.ietf.org/doc/html/rfc3021 and https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/ipaddr_ipv4/configuration/xe-3s/asr903/ipv4-xe-3s-asr903-book/config-ipv4-addr.html#GUID-A6AA4621-6662-4CC5-BE57-15CCD38C0FA2). and as far as I see interfaces.php is take it into account
https://github.com/opnsense/core/blob/11b5fe6e9cb1babd68f1b56e44767fc018df3acd/src/www/interfaces.php#L786
Okay, I missed the "if ($pconfig['subnet'] < 31) {" ... who wants to do the PR?
Cheers,
Franco
https://github.com/opnsense/core/pull/5093
for future references
https://github.com/opnsense/core/commit/b1241aeb74ccf
@franco: https://datatracker.ietf.org/doc/html/rfc3021 (https://datatracker.ietf.org/doc/html/rfc3021)
Directed Broadcast = Send it to the other node.
It's a PPP type tunnel setup and while it has some benefits on WAN side it's irrelevant for any LAN you're going to set up.
Cheers,
Franco