Linux:
ifdown & ifup
The ifdown and ifup commands are the same thing as running ifconfig up or ifconfig down.
Given an interface’s name, they take the interface down or bring it up.
This requires root permissions, so you have to use sudo on Ubuntu.
sudo ifdown eth0
sudo ifup eth0