Linux forum

General discussion

want to loopback test 2 lan ports

by devsda / June 11, 2007 11:04 AM PDT

On my rhel4 box, I want to send traffic out one ethernet port and into another ethernet port on the same machine via a loopback ethernet cable connected between the two ports. Not just pinging, but looping files or some kind of data through the cable, as a test.
Its actually more of a test of the cable I'm using to see if it emits excessive RFI when data is on it. Anyone know a some commands or program that can do it? What would the ifcfg-ethx config files need to be set up with. I tried netcat and a perl script but didn't have much success. It's easy to scp files out a port to another machine, but seems to be hard to do it on a line that loops back to the same machine.

Discussion is locked
You are posting a reply to: want to loopback test 2 lan ports
The posting of advertisements, profanity, or personal attacks is prohibited. Please refer to our CNET Forums policies for details. All submitted content is subject to our Terms of Use.
Track this discussion and email me when there are updates

If you're asking for technical help, please be sure to include all your system info, including operating system, model number, and any other specifics related to the problem. Also please exercise your best judgment when posting in the forums--revealing personal information such as your e-mail address, telephone number, and address is not recommended.

You are reporting the following post: want to loopback test 2 lan ports
This post has been flagged and will be reviewed by our staff. Thank you for helping us maintain CNET's great community.
Sorry, there was a problem flagging this post. Please try again now or at a later time.
If you believe this post is offensive or violates the CNET Forums' Usage policies, you can report it below (this will not automatically remove the post). Once reported, our moderators will be notified and the post will be reviewed.
Collapse -
Seems easy.
by R. Proffitt Forum moderator / June 11, 2007 9:50 PM PDT

The bottom line is that we'll need a VALID IP PLAN. I do not teach TCIP here since that's in the text books and the internet. Also you are likely be paid and this is all volunteer. Now the ground rules are set let's get to it.

Since we can't use 2 IP's in the same subnet we know that with the commnon NETMASK of we'll do something like...

Ether 1 =
Ether 2 =

Now if we did that proper and enabled FTP servers on each connection (again I will not describe common Linux components or how to configure them) we could FTP files back and forth with a simple script.

I don't offer the script either. You could write it and toss it up for review to see why it didn't work.


Collapse -
want to loopback test 2 lan ports
by devsda / June 19, 2007 5:44 AM PDT
In reply to: Seems easy.

Thanks for a plate with no food. I did all the obvious things you mentioned but the trick is getting the commands to send data out one port and receive it in the other. Easy when they're on two different systems but not when on the same one. Try it, you'll see. Lonts of things in life 'seem easy'.

Collapse -
Since I've done this all that's left is ...
by R. Proffitt Forum moderator / June 19, 2007 9:13 AM PDT

For you to share gritty details as to distro and more. As to the plate with no food the area of Linux support is somewhat of a mixed bag. Never know what you'll get. However it's not funny to me to find people that want to do just above entry level tasks yet you don't find any books on the subject matter or they never took any course or seminar. They explode when they are asked to read things like "How to ask questions" at sites like

You've left out far too much detail for me to give you a do this. As such I can only write a paltry guide. This is your choice.


Collapse -
It's RHEL4
by devsda / June 19, 2007 9:46 AM PDT

I appreciate any help. On the surface it seems like it should be easy. It 'is' easy going from one server to another. Staying within the confines of one server adds a difficulty that so far I haven't been able to get around. At first I thought it'd be a piece 'o cake. Till I tried to do it and then discovered it must take some 'trick'. If you told me how to do it on any distro, I could make it work on this RHEL4 system with a dual port NIC that I'm trying to loopback it's ports. It even autosenses so I don't have to use a crossover cable between it's two ports.

Collapse -
Sorry I can't help on that one. Why?
by R. Proffitt Forum moderator / June 19, 2007 10:40 AM PDT
In reply to: It's RHEL4 and the download links don't give me RHEL but some Fedora.

Could you use PCLinuxOS 2007? I have that handy on a guinea pig machine.

RHEL looks to be the commercial "pay" version so I won't give it a second look for free discussions like this.

Collapse -
You're right
by devsda / June 20, 2007 4:24 AM PDT

The RHEL is a commercial product and I didn't consider the difference of getting pay vs. free systems help. I also have PClinux2007 running on a machine at home, although with only one lan channel on it at the moment but I'll add one. I must thank you profusely if you spend some of your time setting up this scenario and getting it working. I have been thinking that the kernel sensing source and destination as being actually in the same machine, somehow routes the traffic internally instead of out through the interfaces.

Collapse -
Yes, this is tricky
by pfolk / February 27, 2008 6:09 AM PST
In reply to: You're right
Popular Forums
Computer Newbies 10,686 discussions
Computer Help 54,365 discussions
Laptops 21,181 discussions
Networking & Wireless 16,313 discussions
Phones 17,137 discussions
Security 31,287 discussions
TVs & Home Theaters 22,101 discussions
Windows 7 8,164 discussions
Windows 10 2,657 discussions

Does BMW or Volvo do it best?

Pint-size luxury and funky style

Shopping for a new car this weekend? See how the BMW X2 stacks up against the Volvo XC40 in our side-by-side comparison.