You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/scapy/usage.rst
+25Lines changed: 25 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -252,6 +252,31 @@ Now that we know how to manipulate packets. Let's see how to send them. The send
252
252
Sent 1 packets.
253
253
<PacketList: TCP:0 UDP:0 ICMP:0 Other:1>
254
254
255
+
.. _multicast:
256
+
257
+
Multicast on layer 3: Scope Indentifiers
258
+
----------------------------------------
259
+
260
+
.. index::
261
+
single: Multicast
262
+
263
+
.. note:: This feature is only available since Scapy 2.6.0.
264
+
265
+
If you try to use multicast addresses (IPv4) or link-local addresses (IPv6), you'll notice that Scapy follows the routing table and takes the first entry. In order to specify which interface to use when looking through the routing table, Scapy supports scope identifiers (similar to RFC6874 but for both IPv6 and IPv4).
266
+
267
+
.. code:: python
268
+
269
+
>>> conf.checkIPaddr =False# answer IP will be != from the one we requested
You can use both ``%eth0`` format or ``%15`` (the interface id) format. You can query those using ``conf.ifaces``.
275
+
276
+
.. note::
277
+
278
+
Behind the scene, calling ``IP(dst="224.0.0.1%eth0")`` creates a ``ScopedIP`` object that contains ``224.0.0.1`` on the scope of the interface ``eth0``. If you are using an interface object (for instance ``conf.iface``), you can also craft that object. For instance::
0 commit comments