Copy and pasted from gentoo handbook (don't kill me):
Manual Static Configuration
We need to setup just enough networking so that we can download sources for the system build, as well as the required localhost interface. The needed information is explained in the next table.
Information Description Example value
IP address The IP address you want to assign to your network card 192.168.1.2
Broadcast address The IP address which will broadcast the packets to all the hosts in the network 192.168.1.255
Network mask The mask which is used together with the IP address to see what part of the address is for network-identification and host-identification 255.255.255.0
Gateway The IP address of the computer which will forward the packets that are not meant for the local network (most of the time the computer which shares the internet connection) 192.168.1.1
Type in the following commands, replacing $IFACE with your network interface (typically eth0), $IPNUM with your IP address, $BCAST with your broadcast address and $NMASK with your network mask. For the route command, replace $GTWAY with your default gateway.
Code listing 4.6: Static IP Network Configuration
# ifconfig $IFACE $IPNUM broadcast $BCAST netmask $NMASK
# route add -net default gw $GTWAY netmask 0.0.0.0 metric 1 $IFACE
Now it is time to create the /etc/resolv.conf file so that name resolution (finding Web/FTP sites by name, rather than just by IP address) will work. You can use nano -w /etc/resolv.conf to create /etc/resolv.conf. nano is a small and easy-to-use editor.
Here is a template to follow for creating your /etc/resolv.conf file:
Code listing 4.7: /etc/resolv.conf template
Replace 10.0.0.1 and 10.0.0.2 with the IP addresses of your primary and secondary DNS servers respectively.
If you are behind a proxy, it could be necessary to configure your proxy before you continue. We will export some variables to set up the proxy accordingly.
Code listing 4.8: Setting a Proxy
(If the proxy restricts HTTP traffic:)
# export http_proxy="http://machine.company.com:1234"
(If the proxy restricts FTP traffic:)
# export ftp_proxy="ftp://machine.company.com"
(If the proxy restricts RSYNC traffic:)
# export RSYNC_PROXY="rsync://machine.company.com"
Note: If your proxy requires authentification, use a construct like http://username:firstname.lastname@example.org (note the added "username:password@").
Networking is go!
Networking should now be configured and usable. You should be able to use the included ssh, scp, links, irssi and wget commands to connect to other machines on your LAN or the Internet.
This should get you going in the right direction.