NSX-T Distributed FW – Direction

今回はNSX-TのDFWのDirectionパラメータについてまとめました。

 

概要

DFWのDirectionパラメータについて

DFWのルールのDirectionパラメータは、どの方向のトラフィックに対してDFWのルールを適用するかを示しています。
Inの場合はvDSから仮想マシンに転送されるトラフィック、Outの場合は仮想マシンからvDSに転送されるトラフィックに対してDFWのルールが適用されます。
デフォルトで、DFWのルールのDirectionパラメータはIn/Outなため、各ルールはvDSから仮想マシンに転送されるトラフィック、仮想マシンからvDSに転送されるトラフィックの双方に対して適用されます。

 

検証結果

検証内容、構成

Tier-1 GWでSegment 1を収容します。
Tier-1 GWとTier-0 GWを接続します。
NSX EdgeにTier-0 GWのSRを配置し、物理ネットワークとNSX-Tの仮想ネットワークを接続します。

DFWにICMPトラフィックを却下するルールを設定し、Directionパラメータを変更した際の挙動を確認します。

 

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


interface GigabitEthernet2
 ip address 10.1.1.1 255.255.255.0
!
ip route 0.0.0.0 0.0.0.0 10.1.1.254
            


interface GigabitEthernet2
 ip address 20.1.1.100 255.255.255.0
!
ip route 0.0.0.0 0.0.0.0 20.1.1.1
            

 

DirectionがIn/Outの場合

DFWの設定

DFWにICMPを却下するルールを追加します。また、方向に受信/送信を指定します。

 

DFWの状態確認

R1のDFWにICMPトラフィックを却下するルールが存在することが確認できます。また、DirectionがIn/Outであることが確認できます。

ESXi

[root@esxi1:~] vsipioctl getrules -f nic-2222203-eth1-vmware-sfw.2
ruleset mainrs {
  # generation number: 0
  # realization time : 2020-12-12T01:42:18
  # FILTER (APP Category) rules
  rule 1005 at 1 inout protocol icmp from any 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:42:18
  # FILTER rules
  rule 1 at 1 inout ethertype any stateless from any to any accept;
}

 

疎通確認

R1の10.1.1.1からR2の20.1.1.100にPingを実施します。

 

R1の10.1.1.1からR2の20.1.1.100へのPingが失敗することが確認できます。

R1

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

 

R2の20.1.1.100からR1の10.1.1.1にPingを実施します。

 

R2の20.1.1.100からR1の10.1.1.1へのPingが失敗することが確認できます。

R2

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

 

DirectionがInの場合

DFWの設定

DFWにICMPを却下するルールを追加します。また、方向に受信を指定します。

 

DFWの状態確認

R1のDFWにICMPトラフィックを却下するルールが存在することが確認できます。また、DirectionがInであることが確認できます。

ESXi

[root@esxi1:~] vsipioctl getrules -f nic-2222203-eth1-vmware-sfw.2
ruleset mainrs {
  # generation number: 0
  # realization time : 2020-12-12T01:42:18
  # FILTER (APP Category) rules
  rule 1005 at 1 in protocol icmp from any 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:42:18
  # FILTER rules
  rule 1 at 1 inout ethertype any stateless from any to any accept;
}

 

疎通確認

R1の10.1.1.1からR2の20.1.1.100にPingを実施します。

 

R1の10.1.1.1からR2の20.1.1.100へのPingが成功することが確認できます。

R1

R1#ping 20.1.1.100 source 10.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 20.1.1.100, 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の20.1.1.100からR1の10.1.1.1にPingを実施します。

 

R2の20.1.1.100からR1の10.1.1.1へのPingが失敗することが確認できます。

R2

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

 

DirectionがOutの場合

DFWの設定

DFWにICMPを却下するルールを追加します。また、方向に送信を指定します。

 

DFWの状態確認

R1のDFWにICMPトラフィックを却下するルールが存在することが確認できます。また、DirectionがOutであることが確認できます。

ESXi

[root@esxi1:~] vsipioctl getrules -f nic-2222203-eth1-vmware-sfw.2
ruleset mainrs {
  # generation number: 0
  # realization time : 2020-12-12T01:42:18
  # FILTER (APP Category) rules
  rule 1005 at 1 out protocol icmp from any 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:42:18
  # FILTER rules
  rule 1 at 1 inout ethertype any stateless from any to any accept;
}

 

疎通確認

R1の10.1.1.1からR2の20.1.1.100にPingを実施します。

 

R1の10.1.1.1からR2の20.1.1.100へのPingが成功することが確認できます。

R1

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

 

R2の20.1.1.100からR1の10.1.1.1にPingを実施します。

 

R2の20.1.1.100からR1の10.1.1.1へのPingが失敗することが確認できます。

R2

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

コメント

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