NSX-T Distributed FW – Not

今回はNSX-TのDFWのルールの送信元/送信先において、指定したアドレスやGroup以外を対象とする方法を説明します。

 

検証結果

検証内容、構成

Segment 1にR1~R3を収容します。
DFWで送信元アドレスに10.1.1.1、アクションに却下を指定したルールを作成します。そして、送信元アドレスに対するNotオプションの有無による動作を確認します。

 

ネットワーク機器のCLIの設定


interface GigabitEthernet2
 ip address 10.1.1.1 255.255.255.0
            


interface GigabitEthernet2
 ip address 10.1.1.2 255.255.255.0
            


interface GigabitEthernet2
 ip address 10.1.1.3 255.255.255.0
            

 

Notオプション無し

DFWの設定

DFWに送信元が10.1.1.1/32のトラフィックを却下するルールを追加します。

 

DFWの状態確認

R1のDFWに送信元が10.1.1.1/32のトラフィックを却下するルールが存在することが確認できます。

ESXi

[root@esxi1:~] vsipioctl getrules -f nic-2222203-eth1-vmware-sfw.2
ruleset mainrs {
  # generation number: 0
  # realization time : 2020-12-12T01:30:41
  # FILTER (APP Category) rules
  rule 1005 at 1 inout protocol any from ip 10.1.1.1 to any reject;
  rule 3 at 2 inout inet6 protocol ipv6-icmp icmptype 135 from any to any accept;
  rule 3 at 3 inout inet6 protocol ipv6-icmp icmptype 136 from any to any accept;
  rule 4 at 4 inout protocol udp from any to any port {67, 68} accept;
  rule 2 at 5 inout protocol any from any to any accept;
}

ruleset mainrs_L2 {
  # generation number: 0
  # realization time : 2020-12-12T01:30:41
  # FILTER rules
  rule 1 at 1 inout ethertype any stateless from any to any accept;
}

 

疎通確認

R1の10.1.1.1からR3の10.1.1.3にPingを実施します。

 

R1の10.1.1.1からR3の10.1.1.3への失敗が成功することが確認できます。

R1

R1#ping 10.1.1.3 source 10.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.1.3, timeout is 2 seconds:
Packet sent with a source address of 10.1.1.1
UUUUU
Success rate is 0 percent (0/5)
            

 

R2の10.1.1.2からR3の10.1.1.3にPingを実施します。

 

R2の10.1.1.2からR3の10.1.1.3へのPingが成功することが確認できます。

R2

R2#ping 10.1.1.3 source 10.1.1.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.1.3, timeout is 2 seconds:
Packet sent with a source address of 10.1.1.2
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms
            

 

Notオプション有り

DFWの設定

送信元の「選択内容を否定」を有効にします。

 

DFWの状態確認

R1のDFWのルールにNotオプションが追加されたことが確認できます。

ESXi

[root@esxi1:~] vsipioctl getrules -f nic-2222203-eth1-vmware-sfw.2
ruleset mainrs {
  # generation number: 0
  # realization time : 2020-12-12T01:32:09
  # FILTER (APP Category) rules
  rule 1005 at 1 inout protocol any from not ip 10.1.1.1 to any reject;
  rule 3 at 2 inout inet6 protocol ipv6-icmp icmptype 135 from any to any accept;
  rule 3 at 3 inout inet6 protocol ipv6-icmp icmptype 136 from any to any accept;
  rule 4 at 4 inout protocol udp from any to any port {67, 68} accept;
  rule 2 at 5 inout protocol any from any to any accept;
}

ruleset mainrs_L2 {
  # generation number: 0
  # realization time : 2020-12-12T01:32:09
  # FILTER rules
  rule 1 at 1 inout ethertype any stateless from any to any accept;
}

 

疎通確認

R1の10.1.1.1からR3の10.1.1.3にPingを実施します。

 

R1の10.1.1.1からR3の10.1.1.3への失敗が成功することが確認できます。

R1

R1#ping 10.1.1.3 source 10.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.1.3, timeout is 2 seconds:
Packet sent with a source address of 10.1.1.1
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms
            

 

R2の10.1.1.2からR3の10.1.1.3にPingを実施します。

 

R2の10.1.1.2からR3の10.1.1.3へのPingが失敗することが確認できます。

R2

R2#ping 10.1.1.3 source 10.1.1.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.1.3, timeout is 2 seconds:
Packet sent with a source address of 10.1.1.2
UUUUU
Success rate is 0 percent (0/5)
            

コメント

タイトルとURLをコピーしました