using odd veths for packet injection and sniffing in examples
This commit is contained in:
@@ -24,9 +24,9 @@ We provide a small demo to let you test the program. It consists of the
|
||||
following scripts:
|
||||
- [run_switch.sh] (run_switch.sh): compile the P4 program and starts the switch,
|
||||
also configures the data plane by running the CLI [commands] (commands.txt)
|
||||
- [receive.py] (receive.py): sniff packets on port 3 (veth6) and print a hexdump
|
||||
- [receive.py] (receive.py): sniff packets on port 3 (veth7) and print a hexdump
|
||||
of them
|
||||
- [send_one.py] (send_one.py): send one simple IPv4 packet on port 0 (veth0)
|
||||
- [send_one.py] (send_one.py): send one simple IPv4 packet on port 0 (veth1)
|
||||
|
||||
If you take a look at [commands.txt] (commands.txt), you'll notice the following
|
||||
command: `mirroring_add 250 3`. This means that all the cloned packets with
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
from scapy.all import *
|
||||
|
||||
sniff(iface = "veth6", prn = lambda x: hexdump(x))
|
||||
sniff(iface = "veth7", prn = lambda x: hexdump(x))
|
||||
|
||||
@@ -3,4 +3,4 @@ from scapy.all import *
|
||||
p = Ether(dst="aa:bb:cc:dd:ee:ff") / IP(dst="10.0.1.10") / TCP() / "aaaaaaaaaaaaaaaaaaa"
|
||||
# p.show()
|
||||
hexdump(p)
|
||||
sendp(p, iface = "veth0")
|
||||
sendp(p, iface = "veth1")
|
||||
|
||||
Reference in New Issue
Block a user