KVM 호스트의 방화벽 문제를 해결하기 위해 호스트에 적용되는 방화벽 규칙을 살펴볼 수 있습니다.

KVM 호스트의 VIF 목록 가져오기

localhost.localdomain> get firewall vifs 
***sample output***
                            Firewall VIFs                             
----------------------------------------------------------------------VIF count: 3
 1   239140cf-6c6c-464f-96eb-dfb13203171e
 2   eb277d27-0d28-4fb0-82ce-f59d86ea5bee
 3   afb2aa98-85ee-4bb4-8318-d699fa84c7f0

특정 VIF에 적용되는 방화벽 규칙 검색

UUID로 VIF를 지정합니다(이 예제: 239140cf-6c6c-464f-96eb-dfb13203171e).
localhost.localdomain> get firewall 239140cf-6c6c-464f-96eb-dfb13203171e ruleset rules 
***sample output***
                            Firewall Rules                            
----------------------------------------------------------------------
VIF UUID : 239140cf-6c6c-464f-96eb-dfb13203171e
 Ruleset UUID : 7c5838e5-ab75-427d-b4dd-9452e5607805
 Rule count : 5345
 rule 3073 inout protocol any from any to any profile fbb4b84f-f6c1-40c5-a509-f7c6f81fe7d9 accept with log tag dns;
 rule 3072 inout protocol any from any to any profile 6bc09f62-a188-4e36-9708-291af7237039 accept with log tag youtube.com;
 rule 3072 inout protocol any from any to any profile 27b9a15b-8071-4d09-a7e8-71eecfca0779 accept with log tag youtube.com;
 rule 3075 inout protocol tcp from addrset 81d95211-ab77-4f2d-beaf-3e15b045fb5e to addrset 3d41a802-a899-4464-ba2b-da9240598552 port 5000 accept with log tag portlist1;
 rule 3075 inout protocol tcp from addrset 81d95211-ab77-4f2d-beaf-3e15b045fb5e to addrset 3d41a802-a899-4464-ba2b-da9240598552 port 4992/0xfff8 accept with log tag portlist1;
 rule 3075 inout protocol tcp from addrset 81d95211-ab77-4f2d-beaf-3e15b045fb5e to addrset 3d41a802-a899-4464-ba2b-da9240598552 port 4864/0xff80 accept with log tag portlist1;

특정 VIF에서 사용되는 주소 집합의 목록 가져오기

UUID로 VIF를 지정합니다(이 예제: 239140cf-6c6c-464f-96eb-dfb13203171e).
localhost.localdomain> get firewall 239140cf-6c6c-464f-96eb-dfb13203171e addrsets 
***sample output***
                        Firewall Address Sets                         
----------------------------------------------------------------------
Address set count : 11
  UUID : 09f6da50-bcf2-4347-91a7-df00dca003a6
  Address count : 7
    mac 00:50:56:81:9b:2e
    mac 00:0c:29:03:4d:0d
    mac 00:0c:29:03:4d:03
    ip 10.172.177.231
    ip 10.172.177.111
    ip 192.168.1.11
    ip 192.168.2.11

특정 VIF에서 사용되는 APPID 및 FQDN 목록 가져오기

하이퍼바이저에서 FQDN 프로파일을 확인하려면 localhost.localdomain> get firewall <vif-id> profile 명령을 실행합니다.

정책 UI에서 구성된 URL을 찾습니다.

UUID로 VIF를 지정합니다(이 예제: 239140cf-6c6c-464f-96eb-dfb13203171e).
localhost.localdomain> get firewall 239140cf-6c6c-464f-96eb-dfb13203171e profile 
***sample output***
                          Firewall Profiles                           
----------------------------------------------------------------------
Profiles count : 9
  UUID : 87de2b6b-bdf5-49b6-bae2-824f455a21a4
  Attribute count : 2
    FQDN : www\.youtube\.com
    FQDN : .*\.microsoft\.com

  UUID : 68dc8321-5cb5-4cd4-b1d1-14961d71c05e
  Attribute count : 1
    APP_ID : APP_SSL

특정 VIF에서 사용되는 APPID 및 FQDN 목록 가져오기

UUID로 VIF를 지정합니다(이 예제: 239140cf-6c6c-464f-96eb-dfb13203171e).
localhost.localdomain> get firewall 239140cf-6c6c-464f-96eb-dfb13203171e profile 
***sample output***
                          Firewall Profiles                           
----------------------------------------------------------------------
Profiles count : 9
  UUID : 87de2b6b-bdf5-49b6-bae2-824f455a21a4
  Attribute count : 2
    FQDN : www\.youtube\.com
    FQDN : .*\.microsoft\.com

  UUID : 68dc8321-5cb5-4cd4-b1d1-14961d71c05e
  Attribute count : 1
    APP_ID : APP_SSL

특정 VIF의 FQDN 검색

localhost.localdomain> get firewall 239140cf-6c6c-464f-96eb-dfb13203171e fqdn 
                        Firewall Profile FQDN                         
----------------------------------------------------------------------
Profiles count  : 3
  Profile UUID  : 87de2b6b-bdf5-49b6-bae2-824f455a21a4
  FQDN count    : 2
    FQDN UUID   : 37efd4dd-961c-4756-afdd-ec04f44b6c10
    Value       : www\.youtube\.com
    IP set      : 172.217.6.46

Linux Conntrack 모듈을 통해 연결을 확인합니다.

이 예에서는 2개의 특정 IP 주소 간의 흐름을 확인합니다.

ovs-appctl dpctl/dump-conntrack -m | grep 192.168.1.15 | grep 192.168.1.16
icmp,orig=(src=192.168.1.15,dst=192.168.1.16,id=7972,type=8,code=0),
reply=(src=192.168.1.16,dst=192.168.1.15,id=7972,type=0,code=0),
id=2901517888,zone=61437,status=SEEN_REPLY|CONFIRMED,mark=2083,labels=0x1f

KVM 호스트의 FQDN 역할 및 프로파일 검사

FQDN/URL을 사용하여 특정 도메인을 필터링하기 위한 방화벽 규칙을 생성할 수 있습니다. 하이퍼바이저에서 FQDN 프로파일을 확인하려면 localhost.localdomain> get firewall <vif-id> profile 명령을 실행합니다. 정책 UI에서 구성된 URL을 찾습니다.

APP_ID 및 FQDN 항목을 포함하는 게시된 컨텍스트 프로파일에 대한 샘플 nsxcli 출력:
localhost.localdomain> get firewall 989bdcf6-c6fc-47cd-86a3-367e552dba32 profile 
 Firewall Profiles 
----------------------------------------------------------------------
Profiles count : 3
 UUID : b34b868e-f113-4463-84a6-14736e50168e
 Attribute count : 1
 APP_ID : APP_HTTP
UUID : c4689750-d5e1-41f5-ba2c-0bfc846ed494
 Attribute count : 1
 FQDN : www\.youtube\.com
UUID : 77a599db-b2d3-4510-bbff-fa2bb31aceae
 Attribute count : 1
 APP_ID : APP_DNS
localhost.localdomain> get firewall 989bdcf6-c6fc-47cd-86a3-367e552dba32 fqdn
Firewall Profile FQDN 
----------------------------------------------------------------------
Profiles count : 1
Profile UUID : c4689750-d5e1-41f5-ba2c-0bfc846ed494
FQDN count : 1
FQDN UUID : 1c9d612c-c398-409e-b6f0-f1ec49b778fe
Value : www\.youtube\.com
IP set : 172.217.6.46, 172.217.164.110, 172.217.5.110, 216.58.194.206, 172.217.6.78, 172.217.0.46, 216.58.195.78, 216.58.194.174