]> git.proxmox.com Git - mirror_frr.git/blame - doc/user/nhrpd.rst
Merge pull request #3157 from pguibert6WIND/doc_expanded
[mirror_frr.git] / doc / user / nhrpd.rst
CommitLineData
0efdf0fe 1.. _nhrp:
caba6093 2
42fc5d26
QY
3****
4NHRP
5****
6
c1a54c05
QY
7*nhrpd* is an implementation of the :abbr:NHRP `(Next Hop Routing Protocol)`.
8NHRP is described in :rfc`2332`.
caba6093 9
c1a54c05
QY
10NHRP is used to improve the efficiency of routing computer network traffic over
11:abbr:`NBMA (Non-Broadcast, Multiple Access)` networks. NHRP provides an
12ARP-like solution that allows a system to dynamically learn the NBMA address of
13the other systems that are part of that network, allowing these systems to
14directly communicate without requiring traffic to use an intermediate hop.
caba6093 15
c1a54c05
QY
16Cisco Dynamic Multipoint VPN (DMVPN) is based on NHRP, and |PACKAGE_NAME| nhrpd
17implements this scenario.
caba6093 18
0efdf0fe 19.. _routing-design:
caba6093 20
42fc5d26
QY
21Routing Design
22==============
caba6093
TT
23
24nhrpd never handles routing of prefixes itself. You need to run some
25real routing protocol (e.g. BGP) to advertise routes over the tunnels.
26What nhrpd does it establishes 'shortcut routes' that optimizes the
27routing protocol to avoid going through extra nodes in NBMA GRE mesh.
28
29nhrpd does route NHRP domain addresses individually using per-host prefixes.
30This is similar to Cisco FlexVPN; but in contrast to opennhrp which uses
31a generic subnet route.
32
c1a54c05
QY
33To create NBMA GRE tunnel you might use the following (Linux terminal
34commands):::
42fc5d26 35
42fc5d26
QY
36 ip tunnel add gre1 mode gre key 42 ttl 64
37 ip addr add 10.255.255.2/32 dev gre1
38 ip link set gre1 up
a8c90e15 39
caba6093
TT
40
41Note that the IP-address is assigned as host prefix to gre1. nhrpd will
42automatically create additional host routes pointing to gre1 when
43a connection with these hosts is established.
44
45The gre1 subnet prefix should be announced by routing protocol from the
46hub nodes (e.g. BGP 'network' announce). This allows the routing protocol
47to decide which is the closest hub and determine the relay hub on prefix
48basis when direct tunnel is not established.
49
50nhrpd will redistribute directly connected neighbors to zebra. Within
51hub nodes, these routes should be internally redistributed using some
52routing protocol (e.g. iBGP) to allow hubs to be able to relay all traffic.
53
54This can be achieved in hubs with the following bgp configuration (network
9eb95b3b
QY
55command defines the GRE subnet):
56
57.. code-block:: frr
42fc5d26 58
42fc5d26
QY
59 router bgp 65555
60 address-family ipv4 unicast
61 network 172.16.0.0/16
62 redistribute nhrp
63 exit-address-family
a8c90e15 64
caba6093 65
0efdf0fe 66.. _configuring-nhrp:
caba6093 67
42fc5d26
QY
68Configuring NHRP
69================
caba6093
TT
70
71FIXME
72
0efdf0fe 73.. _hub-functionality:
42fc5d26
QY
74
75Hub Functionality
76=================
caba6093
TT
77
78In addition to routing nhrp redistributed host prefixes, the hub nodes
79are also responsible to send NHRP Traffic Indication messages that
80trigger creation of the shortcut tunnels.
81
82nhrpd sends Traffic Indication messages based on network traffic captured
83using NFLOG. Typically you want to send Traffic Indications for network
84traffic that is routed from gre1 back to gre1 in rate limited manner.
85This can be achieved with the following iptables rule.
86
9eb95b3b 87.. code-block:: shell
42fc5d26 88
9eb95b3b
QY
89 iptables -A FORWARD -i gre1 -o gre1 \\
90 -m hashlimit --hashlimit-upto 4/minute --hashlimit-burst 1 \\
91 --hashlimit-mode srcip,dstip --hashlimit-srcmask 24 --hashlimit-dstmask 24 \\
92 --hashlimit-name loglimit-0 -j NFLOG --nflog-group 1 --nflog-range 128
a8c90e15 93
caba6093
TT
94
95You can fine tune the src/dstmask according to the prefix lengths you
96announce internal, add additional IP range matches, or rate limitation
97if needed. However, the above should be good in most cases.
98
99This kernel NFLOG target's nflog-group is configured in global nhrp config
9eb95b3b
QY
100with:
101
102.. code-block:: frr
42fc5d26 103
9eb95b3b 104 nhrp nflog-group 1
a8c90e15 105
caba6093 106To start sending these traffic notices out from hubs, use the nhrp
9eb95b3b
QY
107per-interface directive:
108
109.. code-block:: frr
110
111 interface gre1
112 ip nhrp redirect
42fc5d26 113
a8c90e15 114
0efdf0fe 115.. _integration-with-ike:
caba6093 116
42fc5d26
QY
117Integration with IKE
118====================
caba6093
TT
119
120nhrpd needs tight integration with IKE daemon for various reasons.
121Currently only strongSwan is supported as IKE daemon.
122
123nhrpd connects to strongSwan using VICI protocol based on UNIX socket
124(hardcoded now as /var/run/charon.vici).
125
126strongSwan currently needs few patches applied. Please check out the
42fc5d26 127`http://git.alpinelinux.org/cgit/user/tteras/strongswan/log/?h=tteras-release,release <http://git.alpinelinux.org/cgit/user/tteras/strongswan/log/?h=tteras-release,release>`_
caba6093 128and
42fc5d26 129`http://git.alpinelinux.org/cgit/user/tteras/strongswan/log/?h=tteras,working tree <http://git.alpinelinux.org/cgit/user/tteras/strongswan/log/?h=tteras,working tree>`_
caba6093
TT
130git repositories for the patches.
131
0efdf0fe 132.. _nhrp-events:
42fc5d26
QY
133
134NHRP Events
135===========
caba6093
TT
136
137FIXME
138
42fc5d26
QY
139Configuration Example
140=====================
caba6093
TT
141
142FIXME
42fc5d26 143