Connects to a network