On Sun, Apr 30, 2023 at 05:53:04PM -0500, o1bigtenor via talk wrote:
> On Sun, Apr 30, 2023 at 5:21 PM James Knott via talk <[email protected]> wrote:
> >
> > On 2023-04-30 17:55, o1bigtenor via talk wrote:
> > > I just spent over 1/2 hour looking at a number of SoCs (3) and 
> > > microcontrollers
> > > (also 3) and I can't find one where I can give it this 'classless'
> > > address you're
> > > talking about.
> >
> > Is there nowhere to set the subnet mask?  Either with / notation or
> > a.b.c.d.  If you can set the address, you should be able to do that, one
> > way or the other.
> >
> > For example, a typical network would be a /24.  It could be expressed as
> > 10.0.0.0 /24 or 10.0.0.0 255.255.255.0, depending on the equipment.
> >
> 
> Nope - - - - all I'm allowed is a quad - - - - or ipv6.
> 
> You likely quite disbelieve me - - - you are welcome to check for yourself.
> I would be quite happy to be proven wrong!
> 
> (RaspberryPi 4B
> PasberryPi Pico w lan 8720 module (I lprefer wired communications - - 
> security)
> beagleBoneBlack
> ESP32 microcontroller
> can't find the other 2  - - - - sorry)

For example ESP32 has a netmask setting:

https://techtutorialsx.com/2020/04/21/esp32-arduino-set-static-ip-address/

It mentions 
IPAddress staticIP(192, 168, 1, 150);
IPAddress gateway(192, 168, 1, 254);
IPAddress subnet(255, 255, 255, 0);
IPAddress dns(192, 168, 1, 254);

So perfectly simply to change the subnet to (255, 255, 254, 0).  DHCP
works too of course based on whatever the dhcp server is configured to
hand out.

For the raspberry pi 4B, they are usually running Raspeberry Pi OS which
is Debian based, and for static ip it simply has /etc/network/interfaces:

auto eno1
iface eno1 inet static
        address 192.168.0.2/23
        gateway 192.168.0.1

or if using old syntax:

auto eno1
iface eno1 inet static
        address 192.168.0.2
        netmask 255.255.254.0
        gateway 192.168.0.1

Again you simply set the netmask to 255.255.254.0 or whatever else
you need.

beaglebone black often also runs a Debian based OS so same thing applies
there.

Given classless IPv4 was introduced in 1993, there is no way any micro
controller doesn't have a netmask setting.  They all do.  It has been
around for 30 years after all.

Of course CIDR syntax is much nicer than netmask which is horrible as
an interface.

/24 = 255.255.255.0
/23 = 255.255.254.0
/22 = 255.255.252.0
/21 = 255.255.248.0
/20 = 255.255.240.0
etc.  Pretty ugly to read and a bit annoying to calculate.

-- 
Len Sorensen
---
Post to this mailing list [email protected]
Unsubscribe from this mailing list https://gtalug.org/mailman/listinfo/talk

Reply via email to