def configure_network(ip, netmask, gateway):
 current = network()
 if ((ip in current['Network Settings']['IP_ADDRESS']['VALUE']) and (netmask in current['Network Settings']['SUBNET_MASK']['VALUE']) and (gateway in current['Network Settings']['GATEWAY_IP_ADDRESS']['VALUE'])):
  return True
 _xml = '<RIBCL VERSION="2.0">\n                <LOGIN USER_LOGIN="adminname" PASSWORD="password">\n                  <RIB_INFO MODE="write">\n                    <MOD_NETWORK_SETTINGS>\n                      <IP_ADDRESS value="{0}"/>\n                      <SUBNET_MASK value="{1}"/>\n                      <GATEWAY_IP_ADDRESS value="{2}"/>\n                    </MOD_NETWORK_SETTINGS>\n                  </RIB_INFO>\n                </LOGIN>\n              </RIBCL> '.format(ip, netmask, gateway)
 return __execute_cmd('Configure_Network', _xml)

def configure_network ( ip , netmask , gateway ) : current = network ( ) if ( ( ip in current [ 'Network Settings' ] [ 'IP_ADDRESS' ] [ 'VALUE' ] ) and ( netmask in current [ 'Network Settings' ] [ 'SUBNET_MASK' ] [ 'VALUE' ] ) and ( gateway in current [ 'Network Settings' ] [ 'GATEWAY_IP_ADDRESS' ] [ 'VALUE' ] ) ) : return True _xml = '<RIBCL VERSION="2.0">\n                <LOGIN USER_LOGIN="adminname" PASSWORD="password">\n                  <RIB_INFO MODE="write">\n                    <MOD_NETWORK_SETTINGS>\n                      <IP_ADDRESS value="{0}"/>\n                      <SUBNET_MASK value="{1}"/>\n                      <GATEWAY_IP_ADDRESS value="{2}"/>\n                    </MOD_NETWORK_SETTINGS>\n                  </RIB_INFO>\n                </LOGIN>\n              </RIBCL> ' . format ( ip , netmask , gateway ) return __execute_cmd ( 'Configure_Network' , _xml )
configure network interface cli example: .