You need to set a static IP.
Ubuntu
Run the following, and note down the netmask and gateway:
sudo ifconfig
Edit /etc/network/interfaces, and, assuming your NIC is eth0, add the IP, netmask and gateway addresses noted earlier:
auto lo eth0
iface lo inet loopback
iface eth0 inet static
address xxx.xxx.xxx.xxx # enter your IP address
netmask xxx.xxx.xxx.xxx
gateway xxx.xxx.xxx.xxx
Windows
Run ipconfig command in Command Prompt to get the default gateway and netmask.
Open Network Connections
Right-click the network connection you want to configure, and then click Properties.
On the General tab (for a local area connection) or the Networking tab (all other connections), click the Internet Protocol (TCP/IP) component, and then click Properties.
Click Use the following IP address for a local area connection, in IP address, Subnet mask, and Default gateway, type the IP address, subnet mask, and default gateway addresses.
Click Use the following DNS server addresses.
In Preferred DNS server and Alternate DNS server, type the primary and secondary DNS server addresses. This is usually the same as your default gateway
If you need to do something more advanced here's the official howto for Windows and a howto for Linux.
http://Example-PC:8080/– grawity Nov 26 '11 at 14:13