Nathan Skrzypczak | 9ad39c0 | 2021-08-19 11:38:06 +0200 | [diff] [blame] | 1 | .. _config_getting_started: |
| 2 | |
| 3 | ======================================= |
| 4 | Getting started with the configuration |
| 5 | ======================================= |
| 6 | |
| 7 | After a successful installation, VPP installs a startup config file named |
| 8 | *startup.conf* in the */etc/vpp/* directory. This file can be tailored to |
| 9 | make VPP run as desired, but contains default values for typical installations. |
| 10 | |
| 11 | Below are more details about this file and some of the the parameters and values |
| 12 | it contains. |
| 13 | |
| 14 | Command-line Arguments |
| 15 | ---------------------- |
| 16 | |
| 17 | Before we describe details of the startup configuration file (startup.conf) it |
| 18 | should be mentioned that VPP can be started without a startup configuration |
| 19 | file. |
| 20 | |
| 21 | Parameters are grouped by a section name. When providing more than one |
| 22 | parameter to a section, all parameters for that section must be wrapped in |
| 23 | curly braces. For example, to start VPP with configuration data via the |
| 24 | command line with the section name *'unix'*: |
| 25 | |
| 26 | .. code-block:: console |
| 27 | |
| 28 | $ sudo /usr/bin/vpp unix { interactive cli-listen 127.0.0.1:5002 } |
| 29 | |
| 30 | The command line can be presented as a single string or as several; anything |
| 31 | given on the command line is concatenated with spaces into a single string |
| 32 | before parsing. VPP applications must be able to locate their own executable |
| 33 | images. The simplest way to ensure this will work is to invoke a VPP |
| 34 | application by giving its absolute path. For example: |
| 35 | *'/usr/bin/vpp <options>'* At startup, VPP applications parse through their |
| 36 | own ELF-sections [primarily] to make lists of init, configuration, and exit |
| 37 | handlers. |
| 38 | |
| 39 | When developing with VPP, in gdb it's often sufficient to start an application |
| 40 | like this: |
| 41 | |
| 42 | .. code-block:: console |
| 43 | |
| 44 | (gdb) run unix interactive |
| 45 | |
| 46 | |
| 47 | Configuration File (startup.conf) |
| 48 | ----------------------------------------- |
| 49 | |
| 50 | The more typical way to specify the startup configuration to VPP is with the |
| 51 | startup configuration file (startup.conf). |
| 52 | |
| 53 | The path of the file is provided to the VPP application on the command line. |
| 54 | This is typically at /etc/vpp/startup.conf. If VPP is installed as a package |
| 55 | a default startup.conf file is provided at this location. |
| 56 | |
| 57 | The format of the configuration file is a simple text file with the same content |
| 58 | as the command line. |
| 59 | |
| 60 | **A very simple startup.conf file:** |
| 61 | |
| 62 | .. code-block:: console |
| 63 | |
| 64 | $ cat /etc/vpp/startup.conf |
| 65 | unix { |
| 66 | nodaemon |
| 67 | log /var/log/vpp/vpp.log |
| 68 | full-coredump |
| 69 | cli-listen localhost:5002 |
| 70 | } |
| 71 | |
| 72 | api-trace { |
| 73 | on |
| 74 | } |
| 75 | |
| 76 | dpdk { |
| 77 | dev 0000:03:00.0 |
| 78 | } |
| 79 | |
| 80 | VPP is instructed to load this file with the -c option. For example: |
| 81 | |
| 82 | .. code-block:: console |
| 83 | |
| 84 | $ sudo /usr/bin/vpp -c /etc/vpp/startup.conf |