How can ICS in Windows 7 be managed via command line, scripts, config files, etc.?

Posted by Skya on Super User See other posts from Super User or by Skya
Published on 2012-03-26T01:13:45Z Indexed on 2012/03/27 5:32 UTC
Read the original article Hit count: 483

I've been using ICS successfully for years, but now I'm looking for a way to control it through something else than the GUI in Control Panel\Network and Internet\Network Connections -> Connection Properties:

I basically want to manually do what this checkbox does

I want to do everything that the encircled checkbox does, without touching the GUI.

But what does the checkbox do?
Microsoft don't provide specific information and the most helpful forum post I've found is from 2003. Assuming that some of the advice is still valid, I've come to the conclusion that ICS is broken down into 6 parts that have to be set up individually:

  1. the sharedAccess service
  2. interface settings
  3. firewall rules
  4. a static route
  5. dnsproxy
  6. autodhcp

I've already learned that the service can be started/stopped with the command net start/stop sharedAccess and that netsh is a good tool for changing the interface settings and the firewall rules. But I don't understand how ICS handles routing and DNS. All hosts in my network are configured statically, so I don't care much about autodhcp.

Thanks for your help!

EDIT: I've spent the whole day scanning through ProcMon and I've seen reads/writes to both the registry and the filesystem and it is difficult to determine what parts of it actually make ICS work. I'm trying to look for an API instead.
I'm looking into this right now, but I still want to know more about the inner workings.

© Super User or respective owner

Related posts about windows-7

Related posts about networking