Two network adapters on the same computer. Is the gateway used?

2

1

I have two networks adapters in the same computer connected to two separate networks:

First adapter, Network 1:
IP 192.168.1.2/24
gateway: 192.168.1.1

Second adapter, Network 2:
IP 192.168.2.2/24
no gateway

When my computer wants to access a host on Network 2 will it try to do it through the 192.168.1.1 gateway? Because that is not what I want.

I am using Windows 10.

user2304458

Posted 2018-10-17T05:31:13.633

Reputation: 119

2It is possible when Interface 2 is down/unreacheable (cable disconnected, NIC disabed, etc.) or if exists a route to the destination host or a subnet within 192.168.2.0 containing the destination host via 192.168.1.1. In normal state it is impossible. – Akina – 2018-10-17T06:33:31.827

Thanks, it means that Windows is intelligent enough to choose the right network adapter – user2304458 – 2018-10-17T06:43:00.637

Answers

1

When my computer wants to access a host on Network 2 will it try to do it through the 192.168.1.1 gateway?

No. Because one of the adapters in your computer has an address that puts it directly on the destination subnet, Windows will send the traffic directly to that interface.

You can confirm this by running net route -4 from a command prompt. Look for the route to your 192.168.2.2/24 network. It will have a Network Destination of 192.168.2.0 and Netmask of 255.255.255.255. In the gateway column it will say On-link indicating you have an adapter with a direct connection to that network.

I say Reinstate Monica

Posted 2018-10-17T05:31:13.633

Reputation: 21 477