Here's a quick test to see if the interface works:
Code:
# ifconfig eth0 192.168.0.2 netmask 255.255.255.0 gw 192.168.0.1 up
You might have to use a different ip address and gateway address.
Then you have to setup routes (if it is not done automagically):
Code:
route add default gw 192.168.0.1 eth0
Now you should be able to ping most computers, although you might have to configure your dns servers first:
Edit /etc/resolv.conf:
Code:
nameserver <ip-addr-of-your-isps-dns-server>
nameserver <ip-addr-of-your-isps-secondary-dns-server>
Now you should be able to ping
www.google.com
If all this works, then the only problem you have is that your interface is not configured at boot.
I have no idea where you do this in your distro, but in Gentoo it is in /etc/conf.d/net.
The syntax in that file also depends on your distro. It might be like vyankey wrote, or like this (again, this is Gentoo syntax):
Code:
iface_eth0="192.168.0.2 broadcast 192.168.0.255 netmask 255.255.255.0"
# or alternativly:
# config_eth0=( "192.168.0.2 netmask 255.255.255.0 brd 192.168.0.255" )
# Another possibility is that you might have to define the default route:
# routes_eth0=( "default gw 192.168.0.1" )
In gentoo you also have to create a symlink:
Code:
cd /etc/init.d/ && ln -s net.lo net.eth0
As you might understand, I use Gentoo
so to enable eth0 at boot I have to do this too: # rc-update add net.eth0 default
The above command adds the interface eth0 to the default rc level. Which enables it when the computer is booted.
You might have to study how those procedures are done in your distro though