Multi Homed Network(2개 이상의 NIC)에서 올바른 TCP/IP 설정

Windows에 2개 이상의 NIC를 설치하고 각기 다른 네트워크에 연결 할 때 여러분들께서는 어떻게 TCP/IP를 설정을 하십니까? 예를 들면 1번 NIC은 내부 사설망에 연결하고 2번 NIC는 ADSL과 같은 네트워크에 연결해서 외부 네트워크를 연결할 때 말입니다.

이런 경우 대부분 각 NIC에 Gateway 정보를 각 네트워크에 맞춰 다르게 주는 경우가 있는데요 이러면 Routing Table이 문제가 생겨 라우팅에 문제가 생길 수 있습니다.

OS에서는 하나의 routing table만을 가지고 하나의 gateway를 인식해야 정상적인 라우팅이 가능합니다. 만약 각기 다른 NIC에 서로 다른 default gateway를 입력하면 네트워크 운영 중에 default gateway 정보가 날라(?)가 Routing이 되지 않는 문제가 발생할 수 있습니다.

그러므로 두 개 이상의 다중 NIC환경에서 각기 다른 Default gateway를 입력한다면 하나의 NIC에만 Default Gateway를 설정하고 나머지 다른 NIC에는 default gateway의 정보를 입력하지 않습니다, 그대신 나머지 네트워크의 라우팅을 위해 나머지 default gateway에 대해서는 ‘route’ 명령을 이용해 라우팅 테이블에 수동으로 추가 합니다.

[단순하게 정리하자면]

1. 둘 중에 Routing이 복잡한 NIC에 default gateway를 설정합니다.

2. 아래와 같이 Route add 명령을 이용하여 다른 NIC의 default gateway를 입력해 라우팅 테이블을 추가 합니다.

Route Add -p <Network ID> MASK <subnet mask> <default gateway>

예) Route Add -p 199.199.41.0 mask 255.255.255.0 199.199.40.1

즉 라우팅이 복잡한 네트워크는 NIC TCP/IP 설정에서 입력하고 라우팅이 간단한 쪽은 route add를 이용해 추가합니다.

[참고]

참고로 DNS는 DNS 정보는 양쪽 DNS client 설정에서 각 DNS를 설정하면 아래와 같은 Machanism에 의해 정상적으로 양쪽 네트워크의 DNS로 모두 query가 가능합니다.

The DNS Client service queries the DNS servers in the following order:

1.  The DNS Client service sends the name query to the first DNS server on the preferred adapter’s list of DNS servers and waits one second for a response.

2. If the DNS Client service does not receive a response from the first DNS server within one second, it sends the name query to the first DNS servers on all adapters that are still under consideration and waits two seconds for a response.

3. If the DNS Client service does not receive a response from any DNS server within two seconds, the DNS Client service sends the query to all DNS servers on all adapters that are still under consideration and waits another two seconds for a response.

4. If the DNS Client service still does not receive a response from any DNS server, it sends the name query to all DNS servers on all adapters that are still under consideration and waits four seconds for a response.

5. If it the DNS Client service does not receive a response from any DNS server, the DNS client sends the query to all DNS servers on all adapters that are still under consideration and waits eight seconds for a response.

즉 모든 NIC에 설정된 모든 DNS에 query를 날리므로 도메인 query에는 문제가 없습니다.

[ 참고문서]

기본 게이트웨이를 여러 개 사용하면 연결 문제가 발생할 수 있다

https://support.microsoft.com/kb/159168

다중 홈 컴퓨터의 기본 게이트웨이 구성

https://support.microsoft.com/kb/157025

Default Gateway Behavior for Windows TCP/IP

https://www.microsoft.com/technet/community/columns/cableguy/cg0903.mspx

LAN과 인터넷 액세스를 가진 다중홈 컴퓨터의 기본 게이트웨이를 구성하는 방법

https://support.microsoft.com/kb/262397