EnableDHCP() will do most everything you are looking for. Search the UDFs and you find there are other IP related functions as well.