If there is more than one "live" network connection, OS X will attempt the top one. If that fails, then you won't get to your destination. If you are connected to a local network, make sure it is lower priority than your modem. This is done by changing the order of the interfaces in System Preferences.