-1

I have 2 networks connected to my work PC, we'll call them NET1 and NET2. NET1 has internet access and NET2 doesn't.

NET1 is a work network which I have no control over.

My work computer is connected to both NET1 and NET2 via Intel(R) Ethernet Connection I217-LM, and ASIX AX88179 3.0 to Gigabit Ethernet Adapter respectively. IPV4 settings for NET1 are configured with static IPs and designated DNSs. NET2 IPV4 settings are set to be DHCP client with the metric box checked and no default gateway.

NET2 consists of a Netgear ProSafe GS516TP managed switch and a Pi-Hole plugged into the managed switch to act as my DHCP and DNS for devices I plug into the switch.

Whenever I plug my work PC into the NET2, webpages on my work computer timeout, fail to load or the page takes forever to load. The second I unplug NET2, the web pages either reloads or loads after I refresh the page.

Before plugging in the isolated network if I run nslookup, I get what I expect. When I plug in NET2, default Server and address field is now the hostname of the Pi-HOle and its ip address.

So once I plug in NET2 it automatically points to Pihole for all DNS lookups? How can I prevent this?

Thanks ahead of time.

Niko_Jako
  • 3
  • 2
  • 1
    Don't send DNS server addresses or a default gateway. – Michael Hampton Jan 21 '19 at 18:52
  • @MichaelHampton please expound on that comment. I don't know what you mean. – Niko_Jako Jan 21 '19 at 18:59
  • Your net2 has a DHCP server which sends clients DNS addresses (and presumably a default gateway) to use. If you don't actually want clients using them, reconfigure that DHCP server. – Michael Hampton Jan 21 '19 at 19:40
  • @MichaelHampton I see what you're getting at. Thanks for the explanation. I will look into what you said. Is there a way to force web browsing on NET1 to not use the DHCP/DNS servers on NET2? I thought I did that when I configured my NET1 IPV4 settings. – Niko_Jako Jan 21 '19 at 19:57
  • Static routes @Niko_Jako – Timothy Frew Jan 21 '19 at 22:54

1 Answers1

0

What you are trying to do is called multihoming. This is generally not recommended since this type of routing should be handled by a router but in your case that is not an option so this is what you can do.

Run Ipconfig /all and take note of the following:

Net1: Ip Address and subnet mask Net2: Ip Address, Default Gateway, Subnet Mask

Step 1) Make sure the 2 networks do not conflict with each other. For example, if network 1 ip address is 192.168.1.1 MASK 255.255.255.0 and net2 is 192.168.1.22 MASK 255.255.255.0 then you will need to change net 2 (the network you can control) to a non-conflicting network address.

Step 2) Statically assign an IP address and subnet mask to NET 2 but do not assign a DNS server or default gateway. Make sure that this static ip will not be assigned via dhcp to another client. You will either have to exclude the address from DHCP or use an address range that does not get assigned via dhcp.

Step 3) Let assume that the ip address you gave NET 2 is 10.239.0.22 with a mask of 255.255.255.0. If that is the case, you computer will automatically route traffic to all device that are part of that network 10.239.0.0-10.239.0.254 to NET2. If net2 extends to other networks, you will have to add static routes for each additional network by using the ROUTE Add command by following the directions here: https://www.howtogeek.com/howto/windows/adding-a-tcpip-route-to-the-windows-routing-table/

For DNS routing: Windows is not capable of doing a conditional DNS forward on Windows therefore, if you have any name resolutions for net2, you will need to edit the Host file and manually add each record. The host file is location in c:\windows\system32\drivers\etc\hosts.

Joe
  • 1,175
  • 1
  • 8
  • 11
  • this answer combined with work computer updates, and PiHole updates have made conditions waaayyyyyyy better. Thanks. – Niko_Jako Apr 04 '19 at 21:59
  • problem appeared again, and yes modifying the routing tables as mentioned actually fixes the problem. All Web traffic is forced through the NIC I want. Theses helped as well : https://social.technet.microsoft.com/Forums/windows/en-US/64451b61-b8d6-4e16-a396-ea418753f1c6/force-internet-connection-to-desired-network-adapter?forum=w7itpronetworking – Niko_Jako Aug 02 '19 at 22:40
  • https://www.itino.net/add-and-remove-persistent-static-routes-in-microsoft-windows/ – Niko_Jako Aug 02 '19 at 22:40