Browse Source

send udp from scapy

master
Nico Schottelius 3 years ago
parent
commit
04d0fbc85a
  1. 21
      bin/send_udp_packet_v4.py
  2. 10
      doc/plan.org

21
bin/send_udp_packet_v4.py

@ -0,0 +1,21 @@
#!/usr/bin/python3
import sys
from scapy.all import *
if __name__ == '__main__':
iface = sys.argv[1]
e = Ether(src="00:00:0a:00:00:03", dst='00:00:0a:00:00:01')
i = IP(src = "10.0.0.1", dst = "10.1.1.1")
u = UDP(dport=80, sport=80)
d = "V4-OK"
pkg = e / i / u / d
packet_rebuild = packet.__class__(str(pkg))
print("pkg = {}".format(pkg.__repr__()))
print("checksum = {}".format(packet_rebuild.chksum))
sendp(pkg, iface=iface, verbose=True)

10
doc/plan.org

@ -4976,6 +4976,16 @@ else:
- delta on bmv2
- general compile on netpfga [no license server]
Using
#+BEGIN_CENTER
def test_v4_udp_to_v6(self):
print('mx h3 "echo V4-OK | socat - UDP:10.1.1.1:2342"')
print('mx h1 "echo V6-OK | socat - UDP-LISTEN:2342"')
return
#+END_CENTER
** References / Follow up
*** RFC 791 IPv4 https://tools.ietf.org/html/rfc791
*** RFC 792 ICMP https://tools.ietf.org/html/rfc792

Loading…
Cancel
Save