pg: add support for ip mode through cli