1- ===========
2- addrwatch
3- ===========
1+ addrwatch
2+ =========
43
54This is a tool similar to arpwatch. It main purpose is to monitor network and
65log discovered ethernet/ip pairings.
@@ -34,14 +33,16 @@ IPv6 it uses ICMPv6 Neighbor Discovery and (DAD) Duplicate Address Detection
3433packets (Neighbor Solicitations, Neighbor Advertisements).
3534
3635The output file produced by addrwatch is similar to arpwatch. Example of
37- addrwatch output file::
36+ addrwatch output file:
3837
39- 1329486484 eth0 0 00:aa:bb:cc:dd:ee fe80::2aa:bbff:fecc:ddee ND_NS
40- 1329486485 eth0 0 00:aa:bb:cc:dd:ee 192.168.1.1 ARP_REQ
41- 1329486485 eth0 0 00:aa:bb:ff:00:11 192.168.1.3 ARP_ACD
42- 1329486486 eth0 7 00:11:11:11:11:11 fe80::211:11ff:fe11:1111 ND_NS
43- 1329486487 eth0 7 00:22:22:22:22:22 fe80::222:22ff:fe22:2222 ND_DAD
44- 1329486488 eth0 7 00:33:33:33:33:33 192.168.2.2 ARP_REQ
38+ ```
39+ 1329486484 eth0 0 00:aa:bb:cc:dd:ee fe80::2aa:bbff:fecc:ddee ND_NS
40+ 1329486485 eth0 0 00:aa:bb:cc:dd:ee 192.168.1.1 ARP_REQ
41+ 1329486485 eth0 0 00:aa:bb:ff:00:11 192.168.1.3 ARP_ACD
42+ 1329486486 eth0 7 00:11:11:11:11:11 fe80::211:11ff:fe11:1111 ND_NS
43+ 1329486487 eth0 7 00:22:22:22:22:22 fe80::222:22ff:fe22:2222 ND_DAD
44+ 1329486488 eth0 7 00:33:33:33:33:33 192.168.2.2 ARP_REQ
45+ ```
4546
4647For each pairing discovery event addrwatch produce timestamp, interface,
4748vlan_tag (untagged packets are marked with 0 vlan_tag), ethernet address, IP
@@ -51,56 +52,66 @@ To prevent addrwatch from producing too many duplicate output data in active
5152networks rate-imiting should be used. Read more in 'Ratelimit' section.
5253
5354Installation
54- ============
55+ ------------
5556
5657To compile addrwatch you mus have following shared libraries:
5758
5859* libpcap
5960* libevent
6061* OPTIONAL libsqlite3
6162
62- To compile addrwatch with sqlite3 support::
63+ To compile addrwatch with sqlite3 support:
6364
64- $ ./configure --enable-sqlite3
65- $ make
66- $ make install
65+ ```
66+ $ ./configure --enable-sqlite3
67+ $ make
68+ $ make install
69+ ```
6770
68- To compile addrwatch without sqlite3 support::
71+ To compile addrwatch without sqlite3 support:
6972
70- $ ./configure
71- $ make
72- $ make install
73+ ```
74+ $ ./configure
75+ $ make
76+ $ make install
77+ ```
7378
7479If you do not want to install addrwatch to the system, skip the 'make install'
7580step. You can find compiled addrwatch binary in 'src' directory. This is the
7681only file needed to run the program and the only file that would otherwise be
7782installed to the system.
7883
7984Uninstallation
80- ==============
85+ --------------
8186
8287If you have used 'make install' to install addrwatch to a system you can remove
83- with command::
88+ with command:
8489
85- $ make uninstall
90+ ```
91+ $ make uninstall
92+ ```
8693
8794In the sources directory.
8895
8996If you have already deleted the addrwatch sources, you can manually remove
90- addrwatch from the system with command::
97+ addrwatch from the system with command:
9198
92- $ rm /usr/local/bin/addrwatch
93- $ rm /usr/local/share/man/man8/addrwatch.8
99+ ```
100+ $ rm /usr/local/bin/addrwatch
101+ $ rm /usr/local/share/man/man8/addrwatch.8
102+ ```
94103
95104If you have specified --prefix argument to configure script substitute
96105/usr/local with the prefix path used.
97106
98107Usage
99- =====
108+ -----
100109
101- To simply try out addrwatch start ir without any arguments::
110+ To simply try out addrwatch start ir without any arguments:
102111
103- $ addrwatch
112+ ```
113+ $ addrwatch
114+ ```
104115
105116When started like this addrwatch opens first non loopback interface and start
106117logging event to the console without writing anything to disk. All events
@@ -112,21 +123,27 @@ addrwatch: ERR: No suitable interfaces found!
112123
113124It usually means you started addrwatch as normal user and do not have sufficient
114125privileges to start sniffing on network interface. You should start addrwatch as
115- root::
126+ root:
116127
117- $ sudo addrwatch
128+ ```
129+ $ sudo addrwatch
130+ ```
118131
119132You can specify which network interface or interfaces should be monitored by
120- passing interface names as arguments. For example::
133+ passing interface names as arguments. For example:
121134
122- $ addrwatch eth0 tap0
135+ ```
136+ $ addrwatch eth0 tap0
137+ ```
123138
124- To find out about more usage options::
139+ To find out about more usage options:
125140
126- $ addrwatch --help
141+ ```
142+ $ addrwatch --help
143+ ```
127144
128145Ratelimiting
129- ============
146+ ------------
130147
131148If used without ratelimiting addrwatch reports etherment/ip pairing everytime it
132149gets usable ARP or IPv6 ND packet. In actively used networks it generates many
@@ -144,34 +161,32 @@ ratelimiting will not loose any information about pairing changes.
144161
145162For example if we have a stream of events:
146163
147- ==== ================= ===========
148- time ethernet ip
149- ==== ================= ===========
150- 0001 11:22:33:44:55:66 192.168.0.1
151- 0015 11:22:33:44:55:66 192.168.0.1
152- 0020 aa:bb:cc:dd:ee:ff 192.168.0.1
153- 0025 aa:bb:cc:dd:ee:ff 192.168.0.1
154- 0030 11:22:33:44:55:66 192.168.0.1
155- 0035 11:22:33:44:55:66 192.168.0.1
156- 0040 aa:bb:cc:dd:ee:ff 192.168.0.1
157- 0065 aa:bb:cc:dd:ee:ff 192.168.0.1
158- ==== ================= ===========
164+ | time | MAC address | IP address
165+ |------|-------------------|------------
166+ | 0001 | 11:22:33:44:55:66 | 192.168.0.1
167+ | 0015 | 11:22:33:44:55:66 | 192.168.0.1
168+ | 0020 | aa:bb:cc:dd:ee: ff | 192.168.0.1
169+ | 0025 | aa:bb:cc:dd:ee: ff | 192.168.0.1
170+ | 0030 | 11:22:33:44:55:66 | 192.168.0.1
171+ | 0035 | 11:22:33:44:55:66 | 192.168.0.1
172+ | 0040 | aa:bb:cc:dd:ee: ff | 192.168.0.1
173+ | 0065 | aa:bb:cc:dd:ee: ff | 192.168.0.1
159174
160175With --ratelimit=100 we would get:
161176
162- ==== ================= ===========
163- 0001 11:22:33:44:55:66 192.168.0.1
164- 0020 aa:bb:cc:dd:ee:ff 192.168.0.1
165- 0030 11:22:33:44:55:66 192.168.0.1
166- 0040 aa:bb:cc:dd:ee:ff 192.168.0.1
167- ==== ================= ===========
177+ | time | MAC address | IP address
178+ |------|-------------------|------------
179+ | 0001 | 11:22:33:44:55:66 | 192.168.0.1
180+ | 0020 | aa:bb:cc:dd:ee : ff | 192.168.0.1
181+ | 0030 | 11:22:33:44:55:66 | 192.168.0.1
182+ | 0040 | aa:bb:cc:dd:ee : ff | 192.168.0.1
168183
169184Without such exception output would be:
170185
171- ==== ================= ===========
172- 0001 11:22:33:44:55:66 192.168.0.1
173- 0020 aa:bb:cc:dd:ee:ff 192.168.0.1
174- ==== ================= ===========
186+ | time | MAC address | IP address
187+ |------|-------------------|------------
188+ | 0001 | 11:22:33:44:55:66 | 192.168.0.1
189+ | 0020 | aa:bb:cc:dd:ee : ff | 192.168.0.1
175190
176191And we would loose information that address 192.168.0.1 was used by ethernet
177192address 11:22:33:44:55:66 between 30-40th seconds.
@@ -201,7 +216,7 @@ specific IP address was used. There will be no difference between temporary IPv6
201216addressed which was used once and statically configured permanent addresses.
202217
203218Event types
204- ===========
219+ -----------
205220
206221Ethernet/ip pairing discovery can be triggered by these types of events:
207222
0 commit comments