Find the answer to your Linux question:
Results 1 to 5 of 5
I was wondering if anyone knew how to make a network interface into a loopback. I want one network interface to simply repeat everything it recieves back out. Any ideas?...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2006
    Posts
    2

    Loopback an Interface


    I was wondering if anyone knew how to make a network interface into a loopback. I want one network interface to simply repeat everything it recieves back out. Any ideas?

  2. #2
    Just Joined!
    Join Date
    Sep 2005
    Location
    New delhi
    Posts
    22
    Quote Originally Posted by tm37
    I want one network interface to simply repeat everything it recieves back out. Any ideas?
    Can you explain it with more verbosity ?
    Do you want to echo everything you are recieving at any ethernet interface ? or do you want redirect packets you are recieving at any ethernet device into some kind of loopback ?
    I am still confused about your query.

  3. #3
    Just Joined!
    Join Date
    Sep 2006
    Posts
    2
    I have a NIC in server running gentoo. I want that NIC to repeat everything that it recieves from the cable plugged into it back out that same cable. I am finding this very hard to explain. I am sending packets at high speed to this NIC and I want the exact same packets returned to me.

  4. #4
    Just Joined!
    Join Date
    Sep 2005
    Location
    New delhi
    Posts
    22
    iptables -t nat -PREROUTING -p ALL -d <thix-box-ip> -j DNAT --to <me(the box you are sending packets from)>
    iptables -t nat -POSTROUTING -p ALL -d <me> -j SNAT --to <this-box-ip>

    Initially we were getting packets as,
    Source = Me & Destination = this-box
    & now we have changed them to
    Source = this-box & Destination = Me.

    But i am still not impressed about why do you want to do that.

  5. #5
    Just Joined!
    Join Date
    Sep 2005
    Location
    New delhi
    Posts
    22
    You can get a good idea of port forwarding, packet forwarding with iptables & SNAT, DNAT at http://amitsharma.linuxbloggers.com/portforwarding.htm

    Amit..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •