blob: 7788bb531ed904fc3ee9b56fd3d13b8e912647fe [file] [log] [blame]
Alexander Afanasyev284257b2014-04-11 14:16:51 -07001.. _NFD Configuration Tips:
2
3NFD - Named Data Networking Forwarding Daemon
4=============================================
5
6Default Paths
7-------------
8
9This document uses ``SYSCONFDIR`` when referring to the default locations
10of various NFD configuration files. By default, ``SYSCONFDIR`` is set to
11``/usr/local/etc``. If you override ``PREFIX``, then ``SYSCONFDIR`` will
12default to ``PREFIX/etc``.
13
14You may override ``SYSCONFDIR`` and ``PREFIX`` by specifying their
15corresponding options during installation:
16
17::
18
19 ./waf configure --prefix <path/for/prefix> --sysconfdir <some/other/path>
20
21Refer to :ref:`NFD Installation Instructions` for more detailed instructions on how to compile
22and install NFD.
23
24Running and Configuring NFD
25---------------------------
26
27NFD's runtime settings may be modified via configuration file. After
28installation, a working sample configuration is provided at
29``SYSCONFDIR/ndn/nfd.conf.sample``. At startup, NFD will attempt to read
30the default configuration file location: ``SYSCONFDIR/ndn/nfd.conf``.
31
32You may also specify an alternative configuration file location by
33running NFD with:
34
35::
36
37 nfd --config </path/to/nfd.conf>
38
39Once again, note that you may simply copy or rename the provided sample
40configuration and have an **almost** fully configured NFD. However, this
41NFD will be unable to add FIB entries or perform other typical operation
42tasks until you authorize an NDN certificate with the appropriate
43privileges.
44
45Installing an NDN Certificate for Command Authentication
46--------------------------------------------------------
47
48Many NFD management protocols require signed commands to be processed
49(e.g. FIB modification, Face creation/destructions, etc.). You will need
50an NDN certificate to use any application that issues signed commands.
51
52If you do not already have NDN certificate, you can generate one with
53the following commands:
54
55**Generate and install a self-signed identity certificate**:
56
57::
58
59 ndnsec-keygen /`whoami` | ndnsec-install-cert -
60
61Note that the argument to ndnsec-key will be the identity name of the
62new key (in this case, ``/your-username``). Identity names are
63hierarchical NDN names and may have multiple components (e.g.
64``/ndn/ucla/edu/alice``). You may create additional keys and identities
65as you see fit.
66
67**Dump the NDN certificate to a file**:
68
69The following commands assume that you have not modified ``PREFIX`` or
70``SYSCONFDIR`` If you have, please substitute ``/usr/local/etc`` for the
71appropriate value (the overriden ``SYSCONFDIR`` or ``PREFIX/etc`` if you
72changed ``PREFIX``).
73
74::
75
76 sudo mkdir -p /usr/local/etc/ndn/keys
77 ndnsec-cert-dump -i /`whoami` > default.ndncert
78 sudo mv default.ndncert /usr/local/etc/ndn/keys/default.ndncert
79
80Running NFD with Ethernet Face Support
81--------------------------------------
82
83The ether configuration file section contains settings for Ethernet
84faces and channels. These settings will **NOT** work without root or
85setting the appropriate permissions:
86
87::
88
89 sudo setcap cap_net_raw,cap_net_admin=eip /full/path/nfd
90
91You may need to install a package to use setcap:
92
93**Ubuntu:**
94
95::
96
97 sudo apt-get install libcap2-bin
98
99**Mac OS X:**
100
101::
102
103 curl https://bugs.wireshark.org/bugzilla/attachment.cgi?id=3373 -o ChmodBPF.tar.gz
104 tar zxvf ChmodBPF.tar.gz
105 open ChmodBPF/Install\ ChmodBPF.app
106
107or manually:
108
109::
110
111 sudo chgrp admin /dev/bpf*
112 sudo chmod g+rw /dev/bpf*
113
114UDP multicast support in multi-homed Linux machines
115---------------------------------------------------
116
117The UDP configuration file section contains settings for unicast and multicast UDP
118faces. If the Linux box is equipped with multiple network interfaces with multicast
119capabilities, the settings for multicast faces will **NOT** work without root
120or setting the appropriate permissions:
121
122::
123
124 sudo setcap cap_net_raw=eip /full/path/nfd