vRouter CLIを使用したトラブルシューティング
このトピックでは、 vif
、 purel2cli
、 dpdkinfo
、 flow
、 rt
、 nh
コマンドなど、vRouter CLI で使用できるさまざまなトラブルシューティング コマンドについて説明します。
このトピックでは、次のコマンドについて説明します。
vRouter CLI へのアクセス
vRouter CLIへのアクセス方法については、『 vRouter CLIへのアクセス 』をご参照ください。
vRouter CLI によるトラブルシューティング
CLI でコマンドを実行して、vRouter の状態について学習できます。
vif
コマンドによる vRouter インターフェイスの確認
以下に示すコマンドを使用すると、vRouter に存在するインターフェイスを確認できます。
vif --list Vrouter Operation Mode: PureL2 Vrouter Interface Table Flags: P=Policy, X=Cross Connect, S=Service Chain, Mr=Receive Mirror Mt=Transmit Mirror, Tc=Transmit Checksum Offload, L3=Layer 3, L2=Layer 2 D=DHCP, Vp=Vhost Physical, Pr=Promiscuous, Vnt=Native Vlan Tagged Mnp=No MAC Proxy, Dpdk=DPDK PMD Interface, Rfl=Receive Filtering Offload, Mon=Interface is Monitored Uuf=Unknown Unicast Flood, Vof=VLAN insert/strip offload, Df=Drop New Flows, L=MAC Learning Enabled Proxy=MAC Requests Proxied Always, Er=Etree Root, Mn=Mirror without Vlan Tag, HbsL=HBS Left Intf HbsR=HBS Right Intf, Ig=Igmp Trap Enabled, Ml=MAC-IP Learning Enabled, Me=Multicast Enabled vif0/0 Socket: unix Type:Agent HWaddr:00:00:5e:00:01:00 Vrf:65535 Flags:L2 QOS:-1 Ref:3 RX queue errors to lcore 0 0 0 0 0 0 0 0 0 0 0 0 RX packets:0 bytes:0 errors:0 TX packets:11 bytes:4169 errors:0 Drops:0 vif0/1 PCI: 0000:00:00.0 (Speed 25000, Duplex 1) Type:Physical HWaddr:46:37:1f:de:df:bc Vrf:65535 Flags:L2Vof QOS:-1 Ref:8 RX queue errors to lcore 0 0 0 0 0 0 0 0 0 0 0 0 Fabric Interface: eth_bond_bond0 Status: UP Driver: net_bonding Slave Interface(0): 0000:3b:02.0 Status: UP Driver: net_iavf Slave Interface(1): 0000:3b:02.1 Status: UP Driver: net_iavf Vlan Mode: Trunk Vlan: 100 200 300 700-705 RX packets:0 bytes:0 errors:0 TX packets:378 bytes:81438 errors:0 Drops:0 vif0/2 PCI: 0000:3b:0a.0 (Speed 25000, Duplex 1) Type:Workload HWaddr:ba:69:c0:b7:1f:ba Vrf:0 Flags:L2Vof QOS:-1 Ref:7 RX queue errors to lcore 0 0 0 0 0 0 0 0 0 0 0 0 Fabric Interface: 0000:3b:0a.0 Status: UP Driver: net_iavf Vlan Mode: Access Vlan Id: 700 OVlan Id: 700 RX packets:378 bytes:81438 errors:2 TX packets:0 bytes:0 errors:0 Drops:391
vRouterの実行コンフィギュレーションの表示
vRouter のステータスを確認するには、vRouter CLI で次のコマンドを入力します。[root@jcnr-01 /]# ps -eaf | grep vrouter-dpdk root 116 90 99 Mar30 ? 118-08:05:37 /contrail-vrouter-dpdk --no-daemon --socket-mem=1024 1024 --allow=0000:5a:02.0 --vdev=eth_bond_bond0,mode=1,socket_id=0,mac=3a:1a:b7:86:1c:4f,primary=0000:5a:02.0, slave=0000:5a:02.0 --l2_table_size=10240 --yield_option 0 --ddp --l2_mode root 1134749 1134365 0 16:41 pts/0 00:00:00 grep --color=auto vrouter-dpdk
出力にはいくつかの要素が含まれています。
フラグ | の意味 |
---|---|
--l2_mode |
vRouter は L2 モードで動作しています。 |
--l2_table_size |
MAC テーブル内の現在のエントリー数。デフォルトのサイズは 10240 エントリです。 |
--allow=<PCI Id> |
ファブリックおよびファブリック ワークロード インターフェイスの PCI ID。出力には複数の ID を表示できます。これらの ID は許可リストとして機能します。 |
--ddp |
Intel DDP サポートを有効にします。 vRouterの values.yaml ファイルでDDPをデフォルトで有効にします。
手記:
Intel XL710 NIC は DDP をサポートしていません。 |
purel2cli
コマンドによる L2 の設定と統計の表示
purel2cli
コマンドは、Cloud-Native Router L2の設定と統計情報を表示する便利なユーティリティです。まず、
purel2cli --help
命令。
[root@jcnr-01 /]# purel2cli --help Usage: purel2cli [--mac show] [--vlan show] [--vlan get <VLAN_ID>] [--acl show <VLAN_ID>] [--acl reset-counters <VLAN_ID>] [--l2stats get <VIF_ID> <VLAN_ID>] [--clear VLAN_ID] [--qos classifier/re-write/scheduler <NAME>] [--qos cla/rw/sch <NAME>] [--nolocal show] [--nolocal get <VLAN_ID>] [--sock-dir <sock dir>] [--help]
コマンドは、vRouterが動的に学習したMACアドレスを表示します。purel2cli --mac show
purel2cli --mac show ================================================== || MAC vlan port hit_count|| ================================================== 00:01:01:01:01:03 1221 2 1101892 00:01:01:01:01:02 1221 2 1101819 00:01:01:01:01:04 1221 2 1101863 00:01:01:01:01:01 1221 2 1101879 5a:4c:4c:75:90:fe 1250 5 12 Total Mac entries 5
purel2cli --vlan show コマンドは、VLAN および関連するポートを表示します。
purel2cli --vlan show VLAN PORT =============== 1201 1,2,3,4, 1202 1,2,3,4, 1203 1,2,3,4, 1204 1,2,3,4, 1205 1,2,3,4,
purel2cli --vlan get
コマンドを発行して、VLAN の詳細を取得することもできます。
purel2cli --vlan get <vlan-id>
purel2cli --l2stats
コマンドを発行して、L2 の統計情報を表示します。例えば:
purel2cli --l2stats get <virtual_interface_ID> <VLAN_ID>
purel2cli --l2stats get 2 1221 Vlan id count: 1 -------------------------------------------------------------------------------- Statistics for vif 2 vlan 1221 -------------------------------------------------------------------------------- Rx Pkts Rx Bytes Tx Pkts Tx Bytes Unicast 245344824 48152682842 835552 1667761792 Broadcast 0 0 0 0 Multicast 0 0 0 0 Flood 0 0 0 0 --------------------------------------------------------------------------------
purel2cli --clear '*'
purel2cli --clear 100
サンプル・コマンド | 関数 |
---|---|
purel2cli --l2stats get '*' '*' |
すべての仮想インターフェイス(vif)とすべてのVLAN IDの統計を取得します。 |
purel2cli --l2stats get '*' 100 |
VLAN 100 の一部であるすべての vif の統計情報を取得します |
purel2cli --l2stats get 1 '*' |
インターフェイス 1 がメンバーであるすべての VLAN の統計情報を取得します。 |
purel2cli --l2stats get 1 100 |
インターフェイス 1 と VLAN 100 の統計情報の取得 |
コマンドは、vRouterのVLANからポートへのマッピングを示しています。このコマンドを使用すると、特定のVLANのブリッジ ドメイン テーブル エントリーを確認できます。 vRouter の L2 統計情報を表示およびフィルタリングできるコマンドには、いくつかのバリエーションがあります。コマンドの基本形式は、です。次の表に、使用可能なコマンド オプションとその機能を示します。また、次のいずれかのオプションを使用したサンプル出力も提供します。次のコマンドは、インターフェイス 2 と VLAN 1221 の L2 統計情報の例です。purel2cli コマンドの形式で vRouter から統計情報をクリアできます。vRouter 内のすべての VLAN からすべての統計情報をクリアします。VLAN ID 100 のすべての統計情報をクリアします。
dropstats
コマンドによるパケット トレース
vRouter は、ドロップしたパケットを追跡し、ドロップの理由を含めます。以下の表は、vRouterがパケットをドロップする一般的な理由を示しています。 dropstats コマンドを実行すると、カウンターのカウントが 0 の場合、vRouter にカウンターが表示されません。
カウンター名 | の意味 |
---|---|
L2 bd table drop |
ブリッジ ドメインにインターフェイスがない |
L2 untag pkt drop |
タグなしパケットがトランクまたはサブインターフェイスに到着 |
L2 Invalid Vlan |
パケットVLANがインターフェイスVLANと一致しません |
L2 Mac Table Full |
MAC テーブルに使用可能なエントリがこれ以上ありません |
L2 ACL drop |
パケット一致ファイアウォール フィルター(ACL)ドロップ ルール |
L2 Src Mac lookup fail |
送信元MACアドレスを照合できない(または学習できない) |
dropstats コマンドの出力例は、次のようになります。
dropstats L2 bd table Drop 43 L2 untag pkt drop 716 L2 Invalid Vlan 7288253 Rate limit exceeded 673179706 L2 Mac Table Full 41398787 L2 ACL drop 8937037 L2 Src Mac lookup fail 247046
dpdkinfo
コマンドを使用して DPDK の状態と統計を表示する
dpdkinfo コマンドは、DPDK の状態と統計に関する洞察を提供します。dpdkinfo コマンドには多くのオプションがあります。次のセクションでは、使用可能なオプションと dpdkinfo コマンドの出力例について説明します。dpdkinfo コマンドは、vRouter-agent CLI 内からのみ実行できます。
dpdkinfo --help Usage: dpdkinfo [--help] --version|-v Show DPDK Version --bond|-b Show Master/Slave bond information --lacp|-l <all/conf> Show LACP information from DPDK --mempool|-m <all/<mempool-name>> Show Mempool information --stats|-n <vif index value> Show Stats information --xstats|-x <vif index value> Show Extended Stats information --lcore|-c Show Lcore information --app|-a Show App information --ddp|-d <list> <list-flow> Show DDP information for X710 NIC --rx_vlan|-z <value> Show VLan information Optional: --buffsz <value> Send output buffer size (less than 1000Mb)
コマンド dpdkinfo -c
は、DPDK VF ファブリック インターフェイスに割り当てられた Lcore と各インターフェイスのキュー ID を表示します。
dpdkinfo -c No. of forwarding lcores: 4 Lcore 10: Interface: 0000:18:01.1 Queue ID: 0 Interface: 0000:18:0d.1 Queue ID: 0 Interface: 0000:86:00.0 Queue ID: 0 Lcore 11: Interface: 0000:18:01.1 Queue ID: 1 Interface: 0000:18:0d.1 Queue ID: 1 Interface: 0000:86:00.0 Queue ID: 1 Lcore 12: Interface: 0000:18:01.1 Queue ID: 2 Interface: 0000:18:0d.1 Queue ID: 2 Interface: 0000:86:00.0 Queue ID: 2 Lcore 13: Interface: 0000:18:01.1 Queue ID: 3 Interface: 0000:18:0d.1 Queue ID: 3 Interface: 0000:86:00.0 Queue ID: 3
コマンド dpdkinfo -m all
は、すべてのメモリー・プール情報を表示します。
dpdkinfo -m all --------------------------------------------------- Name Size Used Available --------------------------------------------------- rss_mempool 16384 1549 14835 frag_direct_mempool 4096 0 4096 frag_indirect_mempool 4096 0 4096 packet_mbuf_pool 8192 2 8190
コマンド dpdkinfo -n 3
は、特定のインターフェイスの統計情報を表示します。
dpdkinfo -n 3 Interface Info(0000:18:0d.1): RX Device Packets:6710, Bytes:1367533, Errors:0, Nombufs:0 Dropped RX Packets:0 TX Device Packets:0, Bytes:0, Errors:0 Queue Rx: Tx: Rx Bytes: Tx Bytes: Errors:
コマンド dpdkinfo -x 3
は、特定のインターフェイスの拡張統計情報を表示します。
dpdkinfo -x 3 Driver Name:net_iavf Interface Info:0000:18:0d.1 Rx Packets: rx_good_packets: 6701 rx_unicast_packets: 0 rx_multicast_packets: 2987 rx_broadcast_packets: 3714 rx_dropped_packets: 0 Tx Packets: tx_good_packets: 0 tx_unicast_packets: 0 tx_multicast_packets: 0 tx_broadcast_packets: 0 tx_dropped_packets: 0 Rx Bytes: rx_good_bytes: 1365696 Tx Bytes: tx_good_bytes: 0 Errors: rx_missed_errors: 0 rx_errors: 0 tx_errors: 0 rx_mbuf_allocation_errors: 0 inline_ipsec_crypto_ierrors: 0 inline_ipsec_crypto_ierrors_sad_lookup: 0 inline_ipsec_crypto_ierrors_not_processed: 0 inline_ipsec_crypto_ierrors_icv_fail: 0 inline_ipsec_crypto_ierrors_length: 0 Others: inline_ipsec_crypto_ipackets: 0 ---------------------------------------------------------------------
rt
とnh
コマンドを使用したルートとネクストホップの表示
rt
コマンドを使用して、VRF 内のすべてのルートを表示します。ザ
nh
コマンドを使用すると、vRouterが認識しているネクストホップを検査できます。ネクストホップは、vRouter に最終宛先へのパスでパケットを送信する次の場所を指示します。
たとえば、IPv4 トラフィックの場合は、次のようになります。
rt --get 172.68.20.2/32 --vrf 4 Match 172.68.20.2/32 in vRouter inet4 table 0/4/unicast Flags: L=Label Valid, P=Proxy ARP, T=Trap ARP, F=Flood ARP, Ml=MAC-IP learnt route vRouter inet4 routing table 0/4/unicast Destination PPL Flags Label Nexthop Stitched MAC(Index) 172.68.20.2/32 0 LPT 16 193 -
nh --get 193 Id:193 Type:Tunnel Fmly: AF_INET Rid:0 Ref_cnt:264 Vrf:0 Flags:Valid, Policy, MPLSoUDP, Etree Root, Oif:4 Len:14 Data:88 e6 4b 09 7d 46 40 a6 b7 2c a4 48 08 00 Sip:1.1.1.35 Dip:1.1.24.24
たとえば、IPv6 トラフィックの場合、次のようになります。
rt --get 2001:172:68:20::/64 --vrf 4 --family inet6 Match 2001:172:68:20::/64 in vRouter inet6 table 0/4/unicast Flags: L=Label Valid, P=Proxy ARP, T=Trap ARP, F=Flood ARP, Ml=MAC-IP learnt route vRouter inet6 routing table 0/4/unicast Destination PPL Flags Label Nexthop Stitched MAC(Index) 2001:172:68:20::/64 0 LPT 16 193 -
nh --get 193 Id:193 Type:Tunnel Fmly: AF_INET Rid:0 Ref_cnt:264 Vrf:0 Flags:Valid, Policy, MPLSoUDP, Etree Root, Oif:4 Len:14 Data:88 e6 4b 09 7d 46 40 a6 b7 2c a4 48 08 00 Sip:1.1.1.35 Dip:1.1.24.24
flow
コマンドを使用してすべてのアクティブなフローを表示する
flow
コマンドを使用して、システム内のすべてのアクティブなフローを表示します。例えば:
flow -l --match 169.83.47.170:9398 Flow table(size 161218560, entries 629760) Entries: Created 162630 Added 162614 Deleted 35136 Changed 35202Processed 162630 Used Overflow entries 0 (Created Flows/CPU: 0 0 0 0 0 0 0 0 0 0 241 546 15 161828)(oflows 0) Action:F=Forward, D=Drop N=NAT(S=SNAT, D=DNAT, Ps=SPAT, Pd=DPAT, L=Link Local Port) Other:K(nh)=Key_Nexthop, S(nh)=RPF_Nexthop Flags:E=Evicted, Ec=Evict Candidate, N=New Flow, M=Modified Dm=Delete Marked TCP(r=reverse):S=SYN, F=FIN, R=RST, C=HalfClose, E=Established, D=Dead Stats:Packets/Bytes Listing flows matching ([169.83.47.170]:9398) Index Source:Port/Destination:Port Proto(V) ----------------------------------------------------------------------------------- 328196<=>524233 169.83.47.170:9398 6 (2) 172.68.20.20:2159 (Gen: 3, K(nh):206, Action:F, Flags:, TCP:, E:1, QOS:-1, S(nh):206, Stats:6/360, SPort 63929, TTL 0, Sinfo 38.0.0.0) 524233<=>328196 172.68.20.20:2159 6 (2) 169.83.47.170:9398 (Gen: 3, K(nh):206, Action:F, Flags:, TCP:, QOS:-1, S(nh):250, Stats:0/0, SPort 60311, TTL 0, Sinfo 0.0.0.0)