Work with only IPv4 or IPv6 where necessary

Disables the other if the commands are not available or do now work.