NSX CLI를 사용하여 방화벽 패킷 삭제 문제를 해결할 수 있습니다.
방화벽 패킷 삭제 통계 표시
NSX Data Center for vSphere 6.2.3부터 show packet drops 명령을 사용하여 방화벽에 대한 패킷 삭제 통계를 표시할 수 있습니다.
이 명령을 실행하려면 NSX Edge CLI에 로그인하고 기본 모드로 전환합니다. 자세한 내용은 "
NSX 명령줄 인터페이스 참조" 를 참조하십시오. 예:
show packet drops vShield Edge Packet Drop Stats: Firewall Drop Counters ====================== Ipv4 Rules ========== Chain - INPUT rid pkts bytes target prot opt in out source destination 0 119 30517 DROP all -- * * 0.0.0.0/0 0.0.0.0/0 state INVALID 0 0 0 DROP all -- * * 0.0.0.0/0 0.0.0.0/0 Chain - POSTROUTING rid pkts bytes target prot opt in out source destination 0 101 4040 DROP all -- * * 0.0.0.0/0 0.0.0.0/0 state INVALID 0 0 0 DROP all -- * * 0.0.0.0/0 0.0.0.0/0 Ipv6 Rules ========== Chain - INPUT rid pkts bytes target prot opt in out source destination 0 0 0 DROP all * * ::/0 ::/0 state INVALID 0 0 0 DROP all * * ::/0 ::/0 Chain - POSTROUTING rid pkts bytes target prot opt in out source destination 0 0 0 DROP all * * ::/0 ::/0 state INVALID 0 0 0 DROP all * * ::/0 ::/0
Edge 패킷 방화벽 문제
명령을 실행하려면 NSX Edge CLI에 로그인하고 기본 모드로 전환합니다. 자세한 내용은 "NSX 명령줄 인터페이스 참조" 를 참조하십시오.
- show firewall 명령을 사용하여 방화벽 규칙 테이블을 확인합니다. usr_rules 테이블에 구성된 규칙이 표시됩니다.
nsxedge> show firewall Chain PREROUTING (policy ACCEPT 3146M packets, 4098G bytes) rid pkts bytes target prot opt in out source destination Chain INPUT (policy ACCEPT 0 packets, 0 bytes) rid pkts bytes target prot opt in out source destination 0 78903 16M ACCEPT all -- lo * 0.0.0.0/0 0.0.0.0/0 0 0 0 DROP all -- * * 0.0.0.0/0 0.0.0.0/0 state INVALID 0 140K 9558K block_in all -- * * 0.0.0.0/0 0.0.0.0/0 0 23789 1184K ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED 0 116K 8374K usr_rules all -- * * 0.0.0.0/0 0.0.0.0/0 0 0 0 DROP all -- * * 0.0.0.0/0 0.0.0.0/0 Chain FORWARD (policy ACCEPT 3146M packets, 4098G bytes) rid pkts bytes target prot opt in out source destination Chain OUTPUT (policy ACCEPT 173K packets, 22M bytes) rid pkts bytes target prot opt in out source destination Chain POSTROUTING (policy ACCEPT 0 packets, 0 bytes) rid pkts bytes target prot opt in out source destination 0 78903 16M ACCEPT all -- * lo 0.0.0.0/0 0.0.0.0/0 0 679K 41M DROP all -- * * 0.0.0.0/0 0.0.0.0/0 state INVALID 0 3146M 4098G block_out all -- * * 0.0.0.0/0 0.0.0.0/0 0 0 0 ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 PHYSDEV match --physdev-in tap0 --physdev-out vNic_+ 0 0 0 ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 PHYSDEV match --physdev-in vNic_+ --physdev-out tap0 0 0 0 ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 PHYSDEV match --physdev-in na+ --physdev-out vNic_+ 0 0 0 ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 PHYSDEV match --physdev-in vNic_+ --physdev-out na+ 0 3145M 4098G ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED 0 221K 13M usr_rules all -- * * 0.0.0.0/0 0.0.0.0/0 0 0 0 DROP all -- * * 0.0.0.0/0 0.0.0.0/0 Chain block_in (1 references) rid pkts bytes target prot opt in out source destination Chain block_out (1 references) rid pkts bytes target prot opt in out source destination Chain usr_rules (2 references) rid pkts bytes target prot opt in out source destination 131074 70104 5086K ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 match-set 0_131074-os-v4-1 src 131075 116K 8370K ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 match-set 1_131075-ov-v4-1 dst 131073 151K 7844K ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0
show firewall 명령의 POST_ROUTING 섹션에서 DROP invalid 규칙의 증분 값을 확인합니다. 일반적인 원인은 다음과 같습니다.- 비대칭 라우팅 문제
- 1시간 넘게 비활성 상태였던 TCP 기반 애플리케이션. 비활성 시간 초과 문제가 있으며 애플리케이션이 장시간 유휴 상태인 경우 REST API를 사용하여 비활성 시간 초과 설정을 늘리십시오. https://kb.vmware.com/kb/2101275 항목을 참조하십시오.
- show ipset 명령 출력을 수집합니다.
nsxedge> show ipset Name: 0_131074-os-v4-1 Type: bitmap:if (Interface Match) Revision: 3 Header: range 0-64000 Size in memory: 8116 References: 1 Number of entries: 1 Members: vse (vShield Edge Device) Name: 0_131074-os-v6-1 Type: bitmap:if (Interface Match) Revision: 3 Header: range 0-64000 Size in memory: 8116 References: 1 Number of entries: 1 Members: vse (vShield Edge Device) Name: 1_131075-ov-v4-1 Type: hash:oservice (Match un-translated Ports) Revision: 2 Header: family inet hashsize 64 maxelem 65536 Size in memory: 704 References: 1 Number of entries: 2 Members: Proto=6, DestPort=179, SrcPort=Any (encoded: 0.6.0.179,0.6.0.0/16) Proto=89, DestPort=Any, SrcPort=Any (encoded: 0.89.0.0/16,0.89.0.0/16) Name: 1_131075-ov-v6-1 Type: hash:oservice (Match un-translated Ports) Revision: 2 Header: family inet hashsize 64 maxelem 65536 Size in memory: 704 References: 1 Number of entries: 2 Members: Proto=89, DestPort=Any, SrcPort=Any (encoded: 0.89.0.0/16,0.89.0.0/16) Proto=6, DestPort=179, SrcPort=Any (encoded: 0.6.0.179,0.6.0.0/16)
- REST API 또는 Edge 사용자 인터페이스를 사용하여 특정 방화벽 규칙에 대해 로깅을 사용하도록 설정하고 show log follow 명령을 사용하여 로그를 모니터링합니다.
로그가 보이지 않으면 다음 REST API를 사용하여 DROP Invalid 규칙에 대해 로깅을 사용하도록 설정합니다.
URL : https://NSX_Manager_IP/api/4.0/edges/{edgeId}/firewall/config/global PUT Method Input representation <globalConfig> <!-- Optional --> <tcpPickOngoingConnections>false</tcpPickOngoingConnections> <!-- Optional. Defaults to false --> <tcpAllowOutOfWindowPackets>false</tcpAllowOutOfWindowPackets> <!-- Optional. Defaults to false --> <tcpSendResetForClosedVsePorts>true</tcpSendResetForClosedVsePorts> <!-- Optional. Defaults to true --> <dropInvalidTraffic>true</dropInvalidTraffic> <!-- Optional. Defaults to true --> <logInvalidTraffic>true</logInvalidTraffic> <!-- Optional. Defaults to false --> <tcpTimeoutOpen>30</tcpTimeoutOpen> <!-- Optional. Defaults to 30 --> <tcpTimeoutEstablished>3600</tcpTimeoutEstablished> <!-- Optional. Defaults to 3600 --> <tcpTimeoutClose>30</tcpTimeoutClose> <!-- Optional. Defaults to 30 --> <udpTimeout>60</udpTimeout> <!-- Optional. Defaults to 60 --> <icmpTimeout>10</icmpTimeout> <!-- Optional. Defaults to 10 --> <icmp6Timeout>10</icmp6Timeout> <!-- Optional. Defaults to 10 --> <ipGenericTimeout>120</ipGenericTimeout> <!-- Optional. Defaults to 120 --> </globalConfig> Output representation No payload
show log follow 명령을 사용하여 다음과 비슷한 로그를 찾습니다.2016-04-18T20:53:31+00:00 edge-0 kernel: nf_ct_tcp: invalid TCP flag combination IN= OUT= SRC=172.16.1.4 DST=192.168.1.4 LEN=40 TOS=0x00 PREC=0x00 TTL=64 ID=43343 PROTO=TCP SPT=5050 DPT=80 SEQ=0 ACK=1572141176 WINDOW=512 RES=0x00 URG PSH FIN URGP=0 2016-04-18T20:53:31+00:00 edge-0 kernel: INVALID IN= OUT=vNic_1 SRC=172.16.1.4 DST=192.168.1.4 LEN=40 TOS=0x00 PREC=0x00 TTL=63 ID=43343 PROTO=TCP SPT=5050 DPT=80 WINDOW=512 RES=0x00 URG PSH FIN URGP=0
- show flowtable rule_id 명령을 사용하여 Edge 방화벽 상태 테이블에서 일치하는 연결을 확인합니다.
nsxedge> show flowtable 1: tcp 6 21554 ESTABLISHED src=192.168.110.10 dst=192.168.5.3 sport=25981 d port=22 pkts=52 bytes=5432 src=192.168.5.3 dst=192.168.110.10 sport=22 dport=259 81 pkts=44 bytes=7201 [ASSURED] mark=0 rid=131073 use=1 2: tcp 6 21595 ESTABLISHED src=127.0.0.1 dst=127.0.0.1 sport=53194 dport=10 001 pkts=33334 bytes=11284650 src=127.0.0.1 dst=127.0.0.1 sport=10001 dport=5319 4 pkts=33324 bytes=1394146 [ASSURED] mark=0 rid=0 use=1
show flowstats 명령을 사용하여 활성 연결 개수 및 허용되는 최대 연결 개수를 비교합니다.nsxedge> show flowstats Total Flow Capacity: 65536 Current Statistics : cpu=0 searched=3280373 found=3034890571 new=52678 invalid=659946 ignore=77605 delete=52667 delete_list=49778 insert=49789 insert_failed=0 drop=0 early_drop=0 error=0 search_restart=0
-
show log follow 명령을 사용하여 Edge 로그를 확인하고 ALG 삭제를 찾습니다. tftp_alg, msrpc_alg 또는 oracle_tns와 비슷한 문자열을 검색합니다. 자세한 내용은 다음을 참조하십시오.