Gostovanje na Windows strežnikih, ponudba webhosting, ASP.NET, PHP, MySQL


Windows technical support
Podporni forum za uporabnike storitev spletnega gostovanja
Reply to topic
How to define default outbound NIC adapter for browsing
Pico
Site Admin

Joined: 18 Jan 2004
Posts: 250
Location: HostMachine.net
Reply with quote
If your Windows box has more than one NIC network adapter, and you have more han 1 LAN physical connection to public internet, windows use many routing mechanisms to define, which path to use for traffic between your machine and internet.
This is ok if you do not care about it or if you have a kind of failover or load balancing in use, so more than 1 network adapter can be used to reach the internet.

But in some cases you might want to dedicate specific NIC network adapters with specific IP defined to be used only for dedicated services. For example, you may dedicate 1 NIC to be used for DNS services and another NIC to be used for MAIL server. For your browsing you actually CAN dedicate 3rd or additional NIC adapter to be used for browsing and other stuff.

How to assign dedicated network adapter for outgoing traffic?
Simply, redefine your ROUTING table on windows system:
FIRST, list your existing routing table:
Code:
C:\>route print

You will get output simmilar to this:
Code:
===========================================================================
Interface List
 16 ...00 30 84 28 7a 08 ...... Realtek RTL8139/810x Family Fast Ethernet NIC #2

 13 ...00 18 e7 08 7f 6f ...... Realtek RTL8139/810x Family Fast Ethernet NIC
 10 ...00 19 99 42 eb 1e ...... Intel(R) 82566DM-2 Gigabit Network Connection
  1 ........................... Software Loopback Interface 1
 14 ...00 00 00 00 00 00 00 e0  isatap.{F4868B7C-9461-4005-A21C-FE8E56ABF7F9}
 11 ...02 00 54 55 4e 01 ...... Teredo Tunneling Pseudo-Interface
 12 ...00 00 00 00 00 00 00 e0  6TO4 Adapter
 24 ...00 00 00 00 00 00 00 e0  Microsoft ISATAP Adapter #2
 17 ...00 00 00 00 00 00 00 e0  isatap.{3856EEC5-9958-47CE-9B2A-6E04CC49C3BD}
===========================================================================

IPv4 Route Table
===========================================================================
Active Routes:
Network Destination        Netmask          Gateway       Interface  Metric
          0.0.0.0          0.0.0.0     181.212.88.17       192.168.1.2     21
       192.168.1.0    255.255.255.0         On-link        192.168.1.1    276
....
....
===========================================================================

On this screen, WRITE DOWN TWO DETAILS:
1.) ID number (usually 1 or 2 digit number) of your Network Adapter, which you want to use for outgoing traffic
2.) ACTIVE ROUTES with "Destination" 0.0.0.0 which is for "all destinations"

Then DELETE active route with Destination 0.0.0.0:
Code:
C:\>route delete 0.0.0.0

Then create new routing path for all destinations and bind them to specific adapter:
Code:
C:\>route add 0.0.0.0 mask 0.0.0.0 181.212.88.17 IF 10 -P

In ADD command you specify, in the order:
route add [Destination IP] [Destination Mask] [Gateway] IF [Network adapter ID] -P
(operator -P makes route persistent to be valid across reboots)

_________________
Site admin alias Labsy
Vsi nasveti in tehnične rešitve so podani v dobri veri in za ljudi z razčiščenimi pojmi o veljavni zakonodaji.
Odgovornost prevzemam izključno in samo za tiste posege, ki jih opravim lastnoročno.
View user's profileSend private messageVisit poster's websiteMSN Messenger
Pico
Site Admin

Joined: 18 Jan 2004
Posts: 250
Location: HostMachine.net
Reply with quote
Elso, the exact same method can be used to bind windows DNS service to specific NIC network adapter.

For example, if you have Secondary DNS or Tetriary DNS on based on Microsoft Windows MS DNS, MSDNS will by default use random outbound adapter and random outgoing IP for DNS zone update requests.
This means, that Primary DNS might receive DNS zone update requests from any IP, which Secondary DNS's server is configured with. Despite of MSDNS settings, which should bind MS DNS to specific NIC adapter!

So, if your desired outgoing NIC adapter ID is, for example, 12 (you get this by issuing "route print" in command prompt), the permanent route would be:

Code:
ROUTE -p ADD 88.88.88.88 MASK 255.255.255.255 44.44.44.1 IF 12

Where:
88.88.88.88 is your primary DNS public IP (which your secondary DNS will receive updates from)
44.44.44.1 is your secondary DNS server's GATEWAY IP
and 12 is the ID of your NIC adapter on secondary DNS, which is to be used by secondary DNS

_________________
Site admin alias Labsy
Vsi nasveti in tehnične rešitve so podani v dobri veri in za ljudi z razčiščenimi pojmi o veljavni zakonodaji.
Odgovornost prevzemam izključno in samo za tiste posege, ki jih opravim lastnoročno.
View user's profileSend private messageVisit poster's websiteMSN Messenger
How to define default outbound NIC adapter for browsing
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT + 1 Hour  
Page 1 of 1  

  
  
 Reply to topic