I'm sorry if this is a really stupid question; my networking knowledge is pretty sparse.
So, a user makes a HTTP request to some address. That request comes from an address on a local subnet, but the router knows to send the request to its default gateway because the destination IP doesn't match anything else in its routing table. The request hops through the internet and is eventually received by the destination machine (a web server). That all makes sense.
But now, how does the web server manage to send the request back to the local machine? Didn't the request come from an IP address on a local subnet? Where did it pick up the IP address of the local machine's router? And even if it has that router's IP, how does the packet get routed to the local machine once it gets to the router?
But the source IP of my local machine is some local IP address, like 192.168.0.11/24. The router can't just send a packet to that address, can it?- Not generally. The source ip address is most often actually the NAT ip address assigned to that particular packet/traffic stream by the clients firewall or router. NAT is applicable in 99.999% of scenarios. The only time NAT would not be in use is if the clients are using routable ip addresses assigned directly to the clients and NAT is not used at the firewall or router. – joeqwerty Oct 29 '14 at 15:38