I use 2 NICs card on my windows, one of the local and another one is connected to the internet, now my question is how can I set the specific browser to open just the Local website instead of the internet? I set the route command to route the IP address that I want to open locally but when I check the logs I find the IP open with internet NIC instead of Local NIC
1 Answers
There two methods of getting this done as per your request the first method would work for you:-
The first method:-
we can use static route route but we have to obtain the IDs for our NICs by running the command below:-
netsh interface ipv4 show interfaces
The above command will get you the NIC ID
Add a persistent route by using the command below in CMD this will lock the specified traffic from a specific network to the specified network interface using the NIC IDx see syntax command below via CMD.
route -p add local_subnet mask local_subnet_mask 172.132.45.201 IF interface_ID
For example command below, please change the values as per your environment or network:-
route -p add 192.168.0.6 mask 255.255.255.255 172.132.45.201 IF 13
The Second Method:
You will need to edit your hosts file that will enable you to override the DNS for a domain on a specific machine.
Modifying your hosts file causes your machine to look directly at the IP address that you specify
Modifying the hosts file involves adding entries to it to the file . Each entry contains the IP address to which you want the site to resolve.
192.168.190.4 www.local_domain.com 192.168.190.4 local_domain.com 13.14.15.16 www.external_domain.com 13.14.15.16 external_domain.com
Below are the steps to edit the hosts file in Windows 10/11 and Windows Server 2012 and newer versions (you didn't specify which version of Windows).
- Press the Windows key.
- Type Notepad in the search field.
- In the search results, right-click Notepad and select Run as administrator.
- From Notepad, open the following file: c:\Windows\System32\Drivers\etc\hosts
- Make the necessary changes to the file.
- Select File > Save to save your changes.
For Windows, you may have to reboot your computer and this will work independently of the NIC setup.

- 71
- 6
-
the website uses one IP Address in 2 NICs, how can I tell the OS to open the specific IP or domain in a specific NIC, your answer works when we have different IP addresses locally and internet, right? – Rebwar Dec 29 '22 at 07:49
-
@Rebwar this solution will work irrespective of the IP and NIC configuration – George Muddu Dec 29 '22 at 10:02
-
so as I said this website is working with the same IP on the internet and intranet (in two networks it's 172.132.45.201) and I want when I open this website it's open with the Intranet NIC but by default, it's open via the internet one. – Rebwar Dec 30 '22 at 09:34
-
1– @Rebwar in that case we can use static route route first run {netsh interface ipv4 show interfaces} to get the NIC ID and add a persistent route by using {route -p add local_subnet mask local_subnet_mask 172.132.45.201 IF interface_ID} for example route -p add 192.168.0.6 mask 255.255.255.255 172.132.45.201 IF 13 I let me add the details of implementation int he answer section – George Muddu Dec 30 '22 at 09:58