I have a problem with scapy (obviously)
for those who do not know, scapy is a network tool that allows you to manually craft a packet and send it, or even replay and modify a packet capture file.
i want to do the first. i simply want to send an ipv6 icmp echo request and print the reply.
here is the code to do that:
Expand|Select|Wrap|Line Numbers
- import logging
- import sys
- from scapy.all import *
- conf.iface='eth1'
- conf.route6.add(dst="50::1",gw="50::2")
- print conf.route6
- i=IPv6()
- i.display()
- i.dst="50::1"
- i.src="50::2"
- i.display()
- q=ICMPv6EchoRequest()
- q.display()
- p=(i/q)
- reply=sr1(p)
- reply.show()
so first i got a warning:
- WARNING: No route found for IPv6 destination 50::1 (no default route?)
this was before I added the route in scapy. but it told me the packet was send anyway and it was waiting for an answer. then I did a packet-sniff to see why i got no answer. I checked all my available interfaces and found out that the packet was not send.
so after a while i found out that the routing table that scapy uses thinks that 50::2 is a loopback address instead of being applied on an interface. however, the routing table of linux clearly says it's configured on eth1. also, a "ping6 50::1" works fine. i tried adding a static route to 50::1 but this didn't seem to work. i also tried
Expand|Select|Wrap|Line Numbers
- conf.route6.add(dst="50::1",gw="50::2",dev="eth1")
- TypeError: construct_source_candidate_set() takes exactly 4 arguments (3 given)
does anyone know what i'm doing wrong? or does anyone know how i can get this working? it would be a huge help.