How to port this NAT scenario from WindowsXP to Windows 10?

1

Scenario:

  • computer1 has 2 Ethernet NICs. One of them (external interface) is connected to the internet
  • computer2 has 1 Ethernet NIC
  • computer1 (internal interface) and computer2 are connected directly through a crossover cable

Goal is to connect computer2 to internet through computer1

Many years ago I did it in Windows XP like this:

netsh> routing ip nat
netsh routing ip nat > install
netsh routing ip nat > add int "external" full
netsh routing ip nat > add int "internal" private
netsh routing ip nat > exit

And I enabled the Routing and remote access service.

I liked this approach because it was simple and flexible - there is no dependence of IP addresses on both NICs of computer1.

Now, when trying to do the same in Windows 10, I have found that netsh doesn't have a "routing" context.

Is it possible at all to port my solution to Windows 10, preferably using only native features and tools, no additional third party software?

Please do not suggest me to use a router with Ethernet ports instead (I was already told that's an option).

PS: I have also investigated Internet Connection Sharing, but online searches got me to Microsoft forums full of complaints and uninspiring attempts of Microsoft Tech Support guys to help. I still tried to enable ICS in Windows 10, but it told me that it'll pick the IP address for the internal NIC on computer1, displayed it, but did not allow me to set a custom one, so I gave up on this approach.

Windows11

Posted 2017-11-06T21:39:47.270

Reputation: 102

Why not just add a route with ROUTE ADD to tell computer1 NIC2 to use NIC1 as default gateway for NIC2 subnet? See similar answer here: https://superuser.com/questions/1260326/routing-between-two/1260655#1260655 you might find helpful.

– Pimp Juice IT – 2017-11-06T21:58:34.300

@TheFurryITSnuggleBuddy As I understand, routing works with IP packets, not with physical network interfaces – Windows11 – 2017-11-06T21:59:53.630

Tell me the IP address of computer1 NIC1 and NIC2 and tell me which NIC you use to connect with the cross-over cable. Tell me the IP address of computer 2 once connected with the cross-over cable? – Pimp Juice IT – 2017-11-06T22:01:59.170

Once you tell me this, I will give you something to test and also the delete statement to try from admin elevated command prompt. – Pimp Juice IT – 2017-11-06T22:03:23.850

@TheFurryITSnuggleBuddy You can see that my scenario doesn't involve IP addresses at all. And it worked even if IP address on NIC1 of computer1 is not static. For NIC2 of computer1 and NIC of computer2 IPs from any private subnet will do. For example 192.168.1.1 on computer1 and 192.168.1.2 on computer2. – Windows11 – 2017-11-06T22:06:19.390

To talk via TCP/IP then each NIC will need to have an IP address assigned to it whether static or dynamic so if that's not the case and the NICs have no IP addresses assigned to them then that's the problem. Say computer 1 NIC1 is 192.168.1.1 and Computer 1 NIC2 is 192.168.2.1 and then the Computer 2 NIC1 is 192.168.2.2 and you connect comp2 NIC1 to comp1 NIC2 then you will add a route from admin elevated command prompt to tell Computer1 to internally route between its NICs...Not sure what you mean about an IP not being needed to talk IP... have to step away for a few be back shortly. – Pimp Juice IT – 2017-11-06T22:11:46.757

@TheFurryITSnuggleBuddy this is just my assumption, but I think when setting NAT via netsh in the example above, WindowsXP handled the route management transparently. I am pretty sure I did not have to do any manual changes to the routing table on computer1, just added IP of NIC2 of computer1 as default gateway on computer2. – Windows11 – 2017-11-06T22:17:14.273

Interesting, that makes sense but I never did that and I don't have anything with such environmental factors to test but take a crack at what I've suggested if you want and it may work just fine as I've done it this way before just not with Windows XP since I personally stopped supporting that for all my clients I support as a consultant many years ago. – Pimp Juice IT – 2017-11-06T22:22:49.443

No answers