Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 and more, without touching any GUI. This leads me to the following subquestion:

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 spent a day following Randolph West's advice and analyzed the output in ProcMon. I saw reads and writes to both the registry and the filesystem, and it was too difficult for me to understand what exactly it all meant - except that an API was being called.

share|improve this question
1  
Use Process Monitor from sysinternals.com to see exactly what it's doing, and then use whatever methods available to script that out. You'll probably find a lot of it is related to the registry, which ProcMon will see. –  user3463 Mar 26 '12 at 7:29
    
Thanks, I'm looking into this now. –  Skya Mar 26 '12 at 10:55

1 Answer 1

up vote 2 down vote accepted

I decided to dig into the Windows API for a solution and found this, the interface which controls the encircled button! Everything else can be controlled with netsh. I wrote a simple C++ utility that lets me start/stop ICS between two network adapters, set the scope for the "DNS server IN" firewall rule and set the IP address of the LAN interface. This is all I needed and I don't think there's any other way to do it.

I've uploaded my solution to sourceforge: https://sourceforge.net/p/icsctrl/

share|improve this answer
    
Skya, could you expand on how to use your utility I don't see how you can enable ICS since its not detecting my adapters. Right now i'm using a desktop with a wifi card that is connected to a router via ethernet. I have the desktop wifi card setup as an access point with the desktop's internet connection shared with the wifi access point so other users can go online via the Microsoft Hosted Network Virtual Adapter. Is there anyway to see the DHCP client table for that access point? I would like to see all connected users to this AP. –  user204401 Mar 5 '13 at 16:37

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.