Using Windows 7 as an IP Router

December 29, 2013 at 1:44 pm (computers, moan) (, , )

Short answer – don’t, use a bootable Linux distribution instead – really, I’m sure it will be less trouble!

Still, my laptop is Windows 7 and I have a cross-over Ethernet cable and from time to time I’d like to connect to something via a point to point Ethernet connection through my laptop using my laptop’s Wifi connection to the Internet – can that be done?  Yes – sort of, as long as you don’t try to be too intelligent about it!

Windows 7 provides Internet Connection Sharing – in theory – when you have a lan and WiFi connection, simply right-click on the WiFi network, select properties and then the “share” tab.  Once this is done, the TCP/IP properties for IPv4 on the Lan interface get changed to a static IP address – 192.168.137.1 in my case (I didn’t choose this, Windows did) – and anything connected over the Lan can request an IP address from the laptop using DCHP.

However, what is weird is that if you do ipconfig /all on the laptop, IP routing is shown as disabled and there is no evidence of a DHCP or routing service running on the laptop.  Also, my Lan network always seems to come up as an Unidentified Network according to Windows no matter what I do.

So, my advice if you really want to use Windows 7 like this:

  • Don’t attempt to configure IP routing by hand (as you’d think you’d have to) – following Internet tech articles to enable IP routing on Windows doesn’t seem to help.
  • Don’t try to enable the “Routing and Remote Access” service – that doesn’t seem to help at all either.
  • Don’t attempt to set up IP routes by hand – route print will show a basic routing table for both interfaces, but don’t attempt to do anything like tell the Lan interface that the default route should be via the WiFi interface or anything like that.
  • Don’t attempt to set up a DHCP server by hand – using ICS, magic does seem to happen (I’ve seen the wireshark traces to prove it) even though there doesn’t seem to be any evidence of the laptop running a DHCP server.
  • Don’t attempt to set the network type of the Lan interface to anything like Home or Work – once ICS is running, it doesn’t seem to matter that Windows thinks it is Unidentified.
  • Don’t set a static IP address on the Lan interface yourself, just let Windows use what it wants to, and accept that the Lan interface will use 192.168.137.1 (or whatever else ICS chooses for you).
  • Don’t attempt to turn the firewall off, configure special routes through it or otherwise fiddle with it at all!  Like everything else in Windows, it keeps all that nasty,  messy stuff about actually knowing what your firewall lets in and out nicely hidden away!

In short – if you need to share you Windows Internet connection then just let ICS do its stuff and hope the magic just works – don’t bother try to do anything clever yourself, like trying to actually understand why it is working or not.

And if ICS doesn’t work for you, then you can try resetting TCP/IP, rebooting, disabling and re-enabling sharing, disabling and re-enabling adaptors.  But if none of that gets it going again – then my advice is to get that bootable Linux distribution, because from what I’ve seen so far no one seems to expect you to be able to debug ICS!  Certainly it doesn’t appear to be consistent or integrated with any of the TCP/IP tools Windows provides that actually let you see what is going on (although I’ve not ruled out some deep netsh magic – but my interest has waned now).

So I do have ICS working to share my WiFi across to my lan interface, but have:

  • No evidence of running a DHCP server, although DHCP is working.
  • No evidence of any firewall configuration updates, but packets are being let in and out.
  • No evidence of IP routing being enabled but packets are being forwarded between networks.
  • No questions asked about IP configuration for my “subnet” but a configuration has been set.

So it does all appear to work.  For now.  But how and why is opaque to me and I’ve given up trying to understand it with the tools I seem to have at my disposal.

Kevin.

Advertisements

Permalink Leave a Comment