Originally posted by: IonBlade
Well, one thing I neglected to mention - even if you put the IP of the router in the gateway field, if the DNS servers are not set, you'll only be able to get to web sites via their IP, not their name. Obtaining an IP automatically handles setting that for you too. Let me explain:
You already probably know that every computer out there on the Internet has an IP address. We'll use your router at 192.168.1.1 and the PC at 192.168.1.3 as an example. Simplifying things (this isn't always the case, but in yours it is), the first 3 numbers of an IP address (192.168.1) specify a whole network of devices (kinda like a country, city, and neighborhood in real life). The last number (such as 1 for your router or 3 for your PC) is a specific network device (or a house).
Now, a computer can *only* talk to computers on its own network (that is, whose first 3 numbers are the same) without external help. If 192.168.1.3 wants to talk to 192.168.1.4, for example, it'll work, because that's in the same network. If, however, it wanted to talk to 123.123.123.123, it wouldn't be able to by itself, since that's on a different network (as it's not the same first 3 numbers). That's where a gateway comes in.
When a computer needs to talk to a device in a *different* network, it forwards its request to a gateway device, which a router is. A gateway just lets two different networks talk to each other. That's why a computer can't get to the web without a gateway specified - it can't talk to the servers you're trying to connect to without the gateway, since they're not on your home network itself, and it gives up on finding it. With the gateway address specified in your settings, you could access the Internet.... almost.
Now, when you had set the gateway, which would let you talk to other networks and hence the Internet, you said that you couldn't get to the web. The thing is that there's one final piece to the puzzle: DNS. When you connect to
www.google.com, you're really just connecting to a pretty name on top of the IP address 66.102.7.147. In fact, if you try to put that address in your browser's address bar, you'll get to Google, as google.com is just a pointer to that address. There's a server called a domain name server (DNS) that takes in domains and spits out these proper IP addresses. Without it setup, you can connect to sites via their IP directly, as that contains all the information needed on where a server is due to its structure, but you *can't* connect to a site via its domain name, since that doesn't mean anything to a computer without resolution to an address first. Think of it as what would happen if you wrote just your name on an envelope and dumped it in the mail (the domain) via putting no name, but the full address (IP address) - the mail wouldn't get delivered with just the name unless someone had a giant book they could look up your address in first, which is the job of DNS.
If you also setup your DNS server addresses, then you'd be able to access the web as you're used to.
So, in summary, looking at the Windows TCP/IP settings:
IP Address: Address of your computer, here 192.168.1.3. You'll want it to be in the same network as your router's address so it can talk to the router (remember, different networks can't talk to each other, and if your router / gateway is on a different network than your PC, it won't be able to find it to *ask* it how to get outside in the first place. That would be bad.)
Subnet Mask: 255.255.255.0 Remember how I said I was simplifying things and that the above explanation about how the first 3 digits specifies the network isn't always the case? That's what the subnet mask is for - changing how many bits of the IP address specify which network an IP belongs to and how many bits specify which *device* on an individual network it is. Just keep it at 255.255.255.0, which means to use the first 3 numbers for the network, and the last for the device number.
Default Gateway: Set this to the address of your router (192.168.1.1). By setting this, you're telling your computer who to pass requests on to to get outside your home network.
Preferred DNS Server and Alternate DNS Server: These are going to generally be servers on your ISP, though if you don't know them, 4.2.2.1 and 4.2.2.2 are good generic ones that are part of the Internet's backbone and have always worked for me. By setting them up, your computer will be able to turn domain names you type in into addresses so the computer can know what address it wants to connect to.
When you type in forums.anandtech.com, the process (simplified) is that the computer goes out to the DNS server and turns that into an address. It then looks and sees that that address isn't on its own network, so it forwards the request to the gateway (router). Then your data's on its way to the server.
Having explained all that? Obtaining an IP address automatically lets the router fill all that in for you

Hope that makes a lot more sense than the first explanation. If not, and you want to know some more,
http://computer.howstuffworks.com/internet-infrastructure1.htm and all its "next" links make for good reading!