473,503 Members | 9,887 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

scapy: applying an ipv6 route

Ciary
247 Recognized Expert New Member
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 7770
sicarie
4,677 Recognized Expert Moderator Specialist
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 Recognized Expert New Member
if it were a problem a normal 'ping6' wouldn't have worked either. and that works fine.
Aug 27 '12 #3
sicarie
4,677 Recognized Expert Moderator Specialist
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 Recognized Expert New Member
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
1781
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
5896
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
1305
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
3008
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
6227
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
2219
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
1357
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
8933
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
1357
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
5302
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
7361
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7015
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7470
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5602
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,...
0
4693
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3183
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3173
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
749
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
403
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.