I think there is command with netsh .... But not sure about the exact command.
You can do something like this in Windows 2003 or newer OS's to add a policy, a filter list, and an entry to that filter list:
You can use "dstmask" and "srcmask" to specify ranges of IP addresses. Bear in mind that you'll have to actually assign that policy if you want it to do anything.
Some background on using NETSH and IPSEC is available at Microsoft at: http://technet.microsoft.com/en-us/library/cc739550(WS.10).aspx
On XP machines you'll use the IPSECCMD.EXE utility, available from the Windows 2000 resource kit.