I'm using Raspberry PI 3 with Raspbian Jessie to make an industrial datalogger product. For obvious reasons I need to tell the Rasp to use a static IP configuration, in order to make it work in other networks. After googling I found out that the proper way to achieve that was to alter the dhcpdcd.conf file (/etc/dhcpcd.conf) adding the following lines:
interface wlan0
static ip_address=192.168.168.207
static routers=192.168.168.254
static domain_name_servers=192.168.168.254
When I know (or at least I think so) I'm giving the dhcp client the static IP, Default Gateway (routers) and DNS Address, which is good. Everything is fine and the Pi actually uses those information.
The problem is the subnet mask. So far, I couldn't figure out how to set it properly. Setting this info is crucial (I guess), since this device will work in different networks, including different subnetworks. What I would like to configure is a simple subnet mask, (such as 255.255.0.0, or even more subnetted).
I'm a missing something ? Maybe something TCP\IP related. Is subnet mask an optional parameter when configuring a device nowadays?
192.168.168.x
addresses tend to change. This should imply that your subnet mask is255.255.255.0
because you need to mask the first three octets of the IPv4 address – Shan-Desai Mar 01 '17 at 10:39