proxmox_routing/send-icmp.py

19 lines
449 B
Python
Raw Permalink Normal View History

#!/usr/bin/python3
from scapy.all import *
etherDest= sys.argv[1]
iface= sys.argv[2]
ipDest= sys.argv[3]
ipSrc= sys.argv[4]
# send 10 IPv4 ICMP echo requests
sendp(Ether(dst=etherDest)/IP(dst=ipDest, src=ipSrc, ttl=(1,10))/ICMP(), iface=iface)
ipDest= sys.argv[5]
ipSrc= sys.argv[6]
# send 10 IPv6 ICMP echo requests
sendp(Ether(dst=etherDest)/IPv6(dst=ipDest, src=ipSrc, hlim=(1,10))/ICMPv6EchoRequest(), iface=iface)