LoginSignup
4
7

More than 5 years have passed since last update.

超高速仮想ルーター/仮想スイッチ FD.io vppの使い方

Posted at

FD.io vppとは

Linux FoundationのプロジェクトであるFD.ioの肝となるサブプロジェクト。
NFVにおけるパケットフォワーディングを高速化するもの。
仮想ルーターや仮想スイッチとし動作する。

FD.io vppのインストール方法

超高速仮想ルーター FD.io vppをVirtualBoxで動かすに書いたように、apt-getで簡単インストールできます。
気をつける点としては、メモリが少なすぎると起動できないところくらいでしょうか。

FD.io vppのコマンド実行方法

2つの方法があります。
1つ目は、shellからはvppctlコマンドをつけて実行する方法です。

# vppctl show int
              Name               Idx       State          Counter          Count
GigabitEthernet0/8/0              1         up       rx packets                   582
                                                     rx bytes                   77859
                                                     tx packets                    16
                                                     tx bytes                     960
                                                     drops                        566
                                                     ip4                          566
GigabitEthernet0/9/0              2         up       rx packets                   582
                                                     rx bytes                   77859
                                                     tx packets                    16
                                                     tx bytes                     960
                                                     drops                        566
                                                     ip4                          566
local0                            0        down

#

2つ目は、vppctlコマンドでvppのCLIインターフェースを使う方法です。この方法だと、コマンド先頭のvppctlコマンドが省略できます。

# vppctl
    _______    _        _   _____  ___
 __/ __/ _ \  (_)__    | | / / _ \/ _ \
 _/ _// // / / / _ \   | |/ / ___/ ___/
 /_/ /____(_)_/\___/   |___/_/  /_/

vpp# show int
              Name               Idx       State          Counter          Count
GigabitEthernet0/8/0              1         up       rx packets                   582
                                                     rx bytes                   77859
                                                     tx packets                    16
                                                     tx bytes                     960
                                                     drops                        566
                                                     ip4                          566
GigabitEthernet0/9/0              2         up       rx packets                   582
                                                     rx bytes                   77859
                                                     tx packets                    16
                                                     tx bytes                     960
                                                     drops                        566
                                                     ip4                          566
local0                            0        down

vpp#

コマンド

コマンドは、Command-line Interface (CLI) Guideで確認できます。
以下のように、クエスチョンマークを入力する事でコマンドの一覧が表示されます。また、show cliコマンドでも同様の結果が得られます。

vpp# ?
  adjacency                      adjacency commands
  api                            api commands
  bfd                            bfd commands
  binary-api                     binary-api [help] <name> [<args>]
  builtin                        builtin commands
  cj                             cj <enable | disable | dump>
  classify                       classify commands
  clear                          Clear commands
  configure                      configure commands
  cop                            cop commands
  create                         create commands
  debug                          debug commands
  delete                         delete commands
  disable                        disable commands
  enable                         enable commands
  event-logger                   event-logger commands
  exec                           Execute commands from file
  flowprobe                      flowprobe commands
  gpe                            gpe [enable|disable]
  history                        Show current session command history
  ikev2                          ikev2 commands
  ila                            ila commands
  interface                      Interface commands
  ip6                            Internet protocol version 6 (IPv6) commands
  ipfix                          ipfix commands
  ipsec                          ipsec commands
  ip                             Internet protocol (IP) commands
  l2fib                          l2fib commands
  l2                             l2 commands
  lb                             lb commands
  lisp                           lisp [enable|disable]
  loopback                       loopback commands
  map                            map commands
  memory-trace                   Enable/disable memory allocation trace
  mpls                           mpls commands
  nat64                          nat64 commands
  oam                            oam [add|del] target <ip4-address> fib <fib-id>
  one                            one [enable|disable]
  p2p_ethernet                   p2p_ethernet <intfc> <mac-address> [del]
  packet-generator               Packet generator commands
  pcap                           pcap commands
  ping                           ping {<ip-addr> | ipv4 <ip4-addr> | ipv6 <ip6-addr>} [ipv4 <ip4-addr> | ipv6 <ip6-addr>] [source <interface>] [size <pktsize>] [interval <sec>] [repeat <cnt>] [table-id <id>] [verbose]
  quit                           Exit CLI
  renumber                       renumber commands
  restart                        restart process
  session                        session [enable|disable]
  set                            Set commands
  show                           Show commands
  sixrd                          sixrd commands
  snat                           snat commands
  sr                             sr commands
  tap                            tap commands
  test                           Test commands
  trace                          Packet tracer commands

vpp#

TABによる補完は無いようですが、コマンドの一部を省略しても解釈してくれます。以下の例ではshow int とshow interfaceが同じ結果を示しています。

vpp# show int
              Name               Idx       State          Counter          Count
GigabitEthernet0/8/0              1         up       rx packets                   582
                                                     rx bytes                   77859
                                                     tx packets                    16
                                                     tx bytes                     960
                                                     drops                        566
                                                     ip4                          566
GigabitEthernet0/9/0              2         up       rx packets                   582
                                                     rx bytes                   77859
                                                     tx packets                    16
                                                     tx bytes                     960
                                                     drops                        566
                                                     ip4                          566
local0                            0        down

vpp# show interface
              Name               Idx       State          Counter          Count
GigabitEthernet0/8/0              1         up       rx packets                   582
                                                     rx bytes                   77859
                                                     tx packets                    16
                                                     tx bytes                     960
                                                     drops                        566
                                                     ip4                          566
GigabitEthernet0/9/0              2         up       rx packets                   582
                                                     rx bytes                   77859
                                                     tx packets                    16
                                                     tx bytes                     960
                                                     drops                        566
                                                     ip4                          566
local0                            0        down

vpp#

設定のコミットや保存

コマンドを実行するとすぐに反映されるようです。runningのコンフィグをファイルに書き出す機能も無さそう。
ソフトウェアで自動設定して使うには、問題ないと思いますし、むしろ都合が良いですね。

enableやconfigure

無いようです。vppctlのCLIインターフェースが使えれば、すぐに設定変更できます。こちらも自動化では都合が良いです。

4
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
7