cat /proc/net/dev to get the list of available interfaces (most likely you'll have eth0 and wlan0). Then ifup the interface via sudo ifconfig eth0 up. You may need to run sudo dhclient eth0 once the interface is up to get an IP address.
For wireless interface, after ifup, you'll need Network Manager to configure it to connect to a given AP.
Also if static IP is needed, then I normally used these commands to setup the interface:
sudo ifconfig eth0 192.168.0.118
sudo gedit /etc/resolv.conf # then add a line nameserver 192.168.0.1 in that file
sudo route add default gw 192.168.0.1
You need to read this: https://wiki.debian.org/NetworkConfiguration
It helps out with learning what you need to do for what.
Are you looking for sudo service networking start ?
I believe network-manager handles the networking and interface on Ubuntu 12.04 so it should be like:
sudo service network-manager start
[EDIT]
Just an update in support of my comment below, for automating SUDO when piping the password to it from external source use:
echo "password" | sudo -S service network-manager start
Which will not ask for the password interactively.
-S Switch here make sudo to read the password from standard input and not from terminal.
When using NetworkManager (its service running) there is no need for sudo to enable/disable networking.
Use nmcli:
nmcli networking {on | off | connectivity}
connectivity get network connectivity state (full/none...).
Just for WiFi:
nmcli radio wifi {on | off}