How to change route/gateway, subnet mask and ip address used by Python scapy?


This Content is from Stack Overflow. Question asked by Maya

Let’s say I have my

default gateway , subnet mask , interface enp2s0 and ip

If I wanted to send an ICMP packet from a different network using scapy with

gateway, subnet mask, interface enp2s0 and ip

how should I go about doing it?

i understand that i need to change the route using conf.route from here but i don’t get the exact configuration for my use case.

i’ve tried many route configs but the ping just doesn’t go through.


This question is not yet answered, be the first one who answer using the comment. Later the confirmed answer will be published as the solution.

This Question and Answer are collected from stackoverflow and tested by JTuto community, is licensed under the terms of CC BY-SA 2.5. - CC BY-SA 3.0. - CC BY-SA 4.0.

people found this article helpful. What about you?