Azure 네트워크 인터페이스 IP 전달 설정 점검

트래픽 중계가 필요한 인터페이스에서만 IP 전달을 사용하세요.

설명

Azure NIC의 IP 전달은 다른 주소로 향하는 패킷을 받거나 NIC에 할당되지 않은 주소를 출발지로 사용해 보낼 수 있게 합니다. 실제로 중계하려면 VM의 소프트웨어와 경로도 구성해야 합니다.

잠재적 영향

다른 시스템의 트래픽이 이 VM을 지나도록 경로가 설정되어 있으면 불필요한 중계 경로가 생길 수 있습니다.

해결 방법

일반 VM은 ip_forwarding_enabled = false로 설정하세요. 방화벽 같은 네트워크 장비는 전달이 필요한 NIC에서만 허용하고, 유효 경로와 접근 규칙이 의도한 트래픽만 중계하는지 확인하세요.

예시

두 구성은 같은 서브넷과 동적 사설 IP를 유지합니다. 달라지는 값은 NIC의 IP 전달 설정입니다.

변경 전

hcl
resource "azurerm_network_interface" "example" {
  name                = "example-nic"
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name

  ip_configuration {
    name                          = "internal"
    subnet_id                     = azurerm_subnet.example.id
    private_ip_address_allocation = "Dynamic"
  }

  ip_forwarding_enabled = true
}

변경 후

hcl
resource "azurerm_network_interface" "example" {
  name                = "example-nic"
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name

  ip_configuration {
    name                          = "internal"
    subnet_id                     = azurerm_subnet.example.id
    private_ip_address_allocation = "Dynamic"
  }

  ip_forwarding_enabled = false
}

참조