Windows 7 with two network cards doesn't route traffic

2

I have simple task to do: I have wni7 with two nics.I want to connect another comp(osx) to win7 through second nic to connect it to internet.

  • I already changed the registry.
  • Win7 interface with 192.168.2.1 has no gateway set (no point to do that)
  • OSX interface with 192.168.2.2 has gateway set to 192.168.2.1
  • I do not add any routes on win7, every thing seems to be already there
  • network on second nic is detected as "undefined network" (probably effect of no gateway)
  • i can achieve any connectivity to internet from OSX only by enabling network connection sharing on nic with 192.168.2.1, but it enables NAT and I'm interested only in pure routing without nat(it's a setup for some research).
  • firewall is off.

It seems to me that win7 refuses to forward packets for some reason. Perhaps "undefined network" and NLA service is to blame, although i couldn't find any info about that.

Below ascii schematics of my setup:

internet<-->router(192.168.1.1)<-->(192.168.1.2) WIN7 (192.168.2.1)<-->(192.168.2.2)OSX

Thanks

Tomek

Posted 2012-09-07T04:56:56.690

Reputation: 31

Connect two PC PC with crossover Ethernet cable. See this:: How to Connect Two Computers Together with an Ethernet Cable

– Biswapriyo – 2017-06-24T08:21:26.573

Your router and your Win7 nic have the same IP – JoshP – 2012-09-07T17:49:04.437

:D Yeah i made error in the the post. it's .2 in realty. – Tomek – 2012-09-07T17:59:25.997

Answers

1

Check that your router has a route to the 192.168.2.x network. Unless you can add one or it is able to discover it your out of luck. It needs a route to tell it to send traffic for 192.168.2.x through the Windows 7 machine acting as a router/gateway at 192.168.1.2.

Make sure routing is enabled on the WIndows 7 machine (do a ipconfig /all at the command prompt and check for a line that says IP Routing Enabled . . . . . . . : Yes.

If it is not enable you can change this by setting the value of the following registry key to 1: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\ Services\Tcpip\Parameters\IPEnableRouter

Brian

Posted 2012-09-07T04:56:56.690

Reputation: 8 439

This should have been the accepted answer. – guest-vm – 2018-03-27T07:05:47.073

0

You need to enable IP routing. Do this by setting the value of the following registry key to 1: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\ Services\Tcpip\Parameters\IPEnableRouter Please verify that this is enabled.

Also, you definitely need to specify a default route on your router! How else should the router decide through which interface traffic to the outside should be sent? It needs this information in the routing table. So, please specify a default gateway on the outside interface. All packets whose destination address does not belong to any of the networks, your router currently is part of will then be sent to the default gateway (i.e. out into the Internet). Does that make sense?

TomS

Posted 2012-09-07T04:56:56.690

Reputation: 274

Can you perhaps explain the reason, in detail with supporting documentation, that enabling IP forwarding to connected networks solves the author's problem? – Ramhound – 2015-12-02T14:19:11.370

I don't think that this is the right place for describing details of IP routing. If you need documentation on the registry key, I just found this page on Microsoft's site which describes this to some extent. Please understand that I am not fully sure that my answer can definitely solve the issue. Maybe it doesn't, but it's also not marked as the correct answer, yet. I think it's the purpose of this great site to propose solutions and the correct solution is then marked. I just want to help. And I think down-voting does not help here...

– TomS – 2015-12-03T09:13:24.383

Well I don't find an incomplete answer to be helpful. Perhaps I am actually interested in the reason this key is the solution, understand the mechanics, that requires an explanation. This answer is for everyone in the community also. – Ramhound – 2015-12-03T11:12:14.777

1What’s there not to understand? It’s the equivalent to net.ipv4.ip_forward and net.ipv6.conf.all.forwarding. Routing is simply disabled by default on Windows. – Daniel B – 2016-07-09T09:53:45.827

1@DanielB the point is he's not answering the question. OP had said "I already changed the registry" so reiterating IPEnableRouter is unhelpful. OP can connect to internet from OS X through ICS of Windows 7, so default route of router must be correct. All in all this shows a lack of understanding of the question. – guest-vm – 2018-03-27T07:02:38.680

0

The easiest way to do that is simply to go to your "network connections" page, select both networks cards, make a right clic on it, and choose "Bridge Connection".

Normally that's enough for setup the forwarding and everything needed to share your connection.

Kane

Posted 2012-09-07T04:56:56.690

Reputation: 101