Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9200709
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T22:49:42+00:00 2026-06-17T22:49:42+00:00

I need to inject some L2 packets(customized) to an specific interface as incoming packets

  • 0

I need to inject some L2 packets(customized) to an specific interface as incoming packets in Linux to test some applications running on it.

Is there any libraries(python preferred)/examples that can help? I was skimming through the Scrapy library, but then it looks like it can only inject packets to the network as outgoing packets?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T22:49:43+00:00Added an answer on June 17, 2026 at 10:49 pm

    If you have the native linux bridge module available then you can use it in this way. Create a bridge

    brctl addbr <brname>
    

    Now create a virtual eth pair (default names veth0, veth1). veths are connected L2 devices

    ip link add type veth
    ifconfig veth0 up
    ifconfig veth1 <some_ip> up
    

    Now add your specific interface, lets say eth0, and one side of the veth pair to this bridge.

    brctl addif <brname> eth0
    brctl addif <brname> veth0
    

    This adds both these interfaces to the bridge. Now when you send traffic on veth0, you should be able to get it on eth0 also(based on normal L2 switch functionality). To send traffic on veth0 you simply need to pump traffic into veth1 since both of them are connected internally. So lets say you want to use tcpreplay, just do

    tcpreply -i veth1 yourpcap.pcap
    

    Let us know how it goes

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to inject some JavaScript into an existing application. The application is normally
I need to Inject some global service (daoFactory) into EventListenet subscribed on PostUpdate event.
I need to inject some XML into a pre-existing XML file under a certain
I'm using background page and I need to inject some code into current tab
I have a situation where I need to inject some dependencies in a action
Two Delphi programs need to load foo.dll, which contains some code that injects a
Need some regular expressions help. So far I have my code working to allow
Need some help... I have jasperserver 4.1 installed on my ubuntu. It runs via
Need to set some attributes of button. For example Checked. I guess it is
I need to be notified any time a largeish asp.net mvc web application makes

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.