Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

python scapy using incorrect egress interface

I have two interfaces with default gateway. wlan0 is my wireless and tun0 is my VPN connection (using that wireless as a transport). When VPN session is established wlan0 metric is increased to 20 - that is why default via VPN should be used.


pluton ~ # ip route show
default dev tun0  scope link 
default via 10.0.0.1 dev wlan0  metric 20 

But it seems that scapy is trying to send L3 packets (send() function) using wlan0.

Could you confirm ? I could not find any bug related with that behavior.

Thanks,

like image 744
user2913139 Avatar asked Oct 23 '13 22:10

user2913139


1 Answers

If you look at the usage for Scapy's send() function you will see an option for an interface to use specified by iface.

sendp("I'm travelling on Ethernet", iface="eth1", loop=1, inter=0.2)

I am unsure what the default behavior is for sendp(), but if you specify the interface, it should solve your problem.

like image 143
RyPeck Avatar answered Nov 12 '22 18:11

RyPeck