trick here is that to check condition in if, you need quite expensive operation to try to set interface and check internet address, so we do not want to do it twice