A nanodevice for rectification and pumping ions