If you are using ethernet cable for your network connection and you want to disable it without unplug the cable, you can do it from the command line.
Ubuntu has specific command dedicated for this type of situation, with this command you can disable and enable any network interfaces that you have including ethernet (usually eth0).
First you want to run 'ifconfig' command to see which network interface you want to disable, let's say the ethernet is eth0 and you want to disable it, so you run this:
You can run 'ifconfig' and see the eth0 should be gone, if you want to enable eth0 again, you can do this:
Using the command above, you can enable and disable any network interface basically, not just eth0, it could be eth1, eth2, wlan0, wlan1, etc.