Sample codes for get IP and default gateway