I can easily grant access to one IP using this code:
$ mysql -u root -p
Enter password:
mysql> use mysql
mysql> GRANT ALL ON *.* to root@\'192.
Motivated by @Malvineaus answer I tried it myself and noticed that it didn't work for me.
You can specify subnet masks with '192.168.1.%' or '192.168.1.0/255.255.255.0' but the subnet must always be on complete octets. see https://mariadb.com/kb/en/create-user/#host-name-component. As result the functionality between one way of specification and the other is the same.
For example '192.168.1.0/255.255.255.128' will not work as it is not on a complete octet boundary.