Fixed a bug in set_ipv4, now working. Refactored a bit the interface