Make sure your Linux have ifconfig binary commands first.
Define the IP and the netmask. for example
ifconfig eth0 192.168.104.158 netmask 255.255.255.0
Find your gateway of your network, and then add the gateway IP
route add default gw 192.168.103.254
And then add the dns server (make sure the resolv.conf file backed up or its safe to be written)
echo nameserver 8.8.8.8 > /etc/resolv.conf