function getBaseIp(opts) {
    if (!('ip' in opts)) {
        const ipAddress = ip.address();
        if (ipAddress) {
            const aIp = ipAddress.split('.');
            if (aIp.length === 4) {
                opts.ip = aIp.slice(0, -1).join('.');
                return opts;
            }
        }
    } else {
        const aIp = opts.ip.split('.');
        if (aIp.length === 3) {
            return opts;
        } else {
            throw new Error('IP should be xxx.xxx.xxx');
            return;
        }
    }
    throw new Error('No IP address');
}