Use trim rather than str_replace. Also no need to sleep anymore since dhcp will configure first the interface
Get interface from inet6 domain
Do not do the same tricks here that are done on get_real_interface but just call the function directly