473,399 Members | 3,656 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

scapy: applying an ipv6 route

Ciary
247 Expert 100+
Hi,

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
  1. import logging
  2. import sys
  3. from scapy.all import *
  4. conf.iface='eth1'
  5. conf.route6.add(dst="50::1",gw="50::2")
  6. print conf.route6
  7. i=IPv6()
  8. i.display()
  9. i.dst="50::1"
  10. i.src="50::2"
  11. i.display()
  12. q=ICMPv6EchoRequest()
  13. q.display()
  14. p=(i/q)
  15. reply=sr1(p)
  16. reply.show()
  17.  
i'll tell you what went wrong, and what i did.
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
  1. conf.route6.add(dst="50::1",gw="50::2",dev="eth1")
but without much success. it gave an error:
- 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.
Aug 22 '12 #1
4 7764
sicarie
4,677 Expert Mod 4TB
I haven't had the opportunity to work extensively with IPv6 so I probably won't e able to help much there, but one thing that always gets me is the SELinux and iptables "deny by default" policies. Are ip6tables or SELinux set to allow this?
Aug 27 '12 #2
Ciary
247 Expert 100+
if it were a problem a normal 'ping6' wouldn't have worked either. and that works fine.
Aug 27 '12 #3
sicarie
4,677 Expert Mod 4TB
Ah, right, sorry - read right over that part. I'll do some research and see if I can find anything
Aug 27 '12 #4
Ciary
247 Expert 100+
there is a workaround. you can manually add a mac source and destination. if you do this you force the packet to be send out on the right interface. that does the trick for me because i know the mac addresses and the host and destination are directly connected.

however, i'm still curious what happened and why it won't work without this. as i sid before, i think it's a problem with ipv6 routes. for some reason it recognizes my eth1 ipv6 address as a loopback address instead of one applied to an interface. i wonder why ...
Aug 29 '12 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Agent | last post by:
I would like to invite you and your associates to attend the US IPv6 (Internet Protocol version 6) Summit, December 8-11, 2003 in Crystal City, VA, near the Pentagon. This major opportunity to...
7
by: Torsten Schmidt | last post by:
Hi, I'm trying to connect to a mysql-Server using PHP's mysql-function mysql_connect. The host on which the mysql-server is running is not the same as the host apache and php are running on. The...
0
by: codecraig | last post by:
I am interested in using libdnet with Python, how can I go about "installing" it on windows? http://libdnet.sourceforge.net/ Ultimately, I would like to get Scapy...
2
by: gregory_may | last post by:
First the research links: IPv6 spec (look for 'jumbo payload'): http://www.cs-ipv6.lancs.ac.uk/ipv6/documents/rfcs/archive/rfc1883.txt IPv6 Sample C# Client/Server...
3
by: jiri.juranek | last post by:
Hello, is there any common function for validation if string contains valid ip address(both ipv4 and ipv6)? Or does sb wrote some regular expression for this? thanks J
0
by: Andrew | last post by:
Hello Everyone I'm just writing to inform the newsgroup or anyone who is interested. I have some what of a working copy of scapy, ported to Windows, based on the notes provided on the scapy...
0
by: bparkis | last post by:
I have an installation of scapy on OS X (via macports) and I am trying to determine if it was successful or not. Nothing I do on the network seems to work completely, but on the other hand the...
8
by: Giampaolo Rodola' | last post by:
I'm not sure if this is a question about python programming, system administration or sockets in general... I have the FTP server in my signature to which I'd want to add IPv6 support. My hosting...
0
by: jonbutler88 | last post by:
I have macpython 2.5 installed, but I cant seem to get scapy installed. I have downloaded scapy.py, and put it in site-packages, for both my /Library/Python/2.5/site-packages and the one located in...
2
by: thomas1984 | last post by:
Hi I have a question about a library available for Python: Scapy (www.secdev.org/projects/scapy/). This library offers a variety of things but I am interested in how it interacts with wireless...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.