I can get online after rebooting. What is wrong?
First you need to check if your network card is discovered properly by the kernel. Run ifconfig -a and look for eth0 or wlan0 (in case of certain wireless network cards). You might need to load specific kernel modules for the kernel to properly detect the network card. If that is the case, make sure that these kernel modules are listed in /etc/modules.autoload.d/kernel-2.6 (or kernel-2.4 if you are still using a 2.4 kernel). If you have forgotten to include support for your network card in your kernel, you will need to reconfigure your kernel. If your network card is found by your kernel, but you have set your networking configuration to use DHCP, you might have forgotten to emerge dhcpcd. You will need to reboot with your installation CD to install dhcpcd. Information on how to rescue your system using the installation CD is available as well.