reg add HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters /T REG_DWORD /v IPEnableRouter /d 1
The computer can now be used as a "default gateway" and will forward packets to it's own gateway. Additionally you can set the gateway of your new router by specifying a default route using the windows route command:
route delete 0.0.0.0
route add 0.0.0.0 mask 0.0.0.0 [Internet gateway IP]
Before you change your routes though it's a good idea to make note of your existing routes:
This is scratching the very surface of Windows routing. Windows supports a full set of advanced routing options and routing protocols using the <code>netsh routing</code> command.
Given access to multiple computers on a LAN one could enable routing on a windows XP/7/8 computer as above, and then use it as a kind of anonymising "proxy" by using it as your default gateway on your own device. I say device, because you could use this with anything -- mobile phone, tablet, laptop, network scanner, IP camera, etc... Everything the device does will appear to come from your "Windows router", and that computer will be the only one that knows that the traffic is actually coming from your device. Additionally, Windows doesn't keep logs of forwarded packets as proxies usually do, so once you've accessed some data on the Internet, there's no logs or information of any kind on the router-computer to implicate you. Pretty neat hey? But I should note that this can be changed -- for example if this scenario is suspected, someone could install logging software or a packet sniffer on the router-computer and then see your device communicating with it.
This could be used to share an internet connection that one computer has access to, for example a USB-tethered phone. You could enabled routing on the tethered computer and set up other computers on the local network to use that computer as the default gateway.