Routing for local interfaces

I am trying to test some devices attached to serial ports on my Linux box. I can establish PPP connections to a remote machine (which I don't control). Each PPP connection has the same remote IP address but each local IP address is unique.

My question is: How can I route packets to one of my PPP addresses through my ethernet interface and vise versa?

It seems as though the kernel sees that the outgoing packet is destined for a local interface and immediately chooses the 'lo' interface. I have tried bringing down the 'lo' interface and the result is that I cannot ping any of my own interfaces.

I am using RH7.1 with a 2.4.7 kernel built with RH's i686 configuration except that Policy Based Routing has been added.

Who is Participating?
Okay, I've got it now. And I can't think of any way you can make that work. Regardless of what you do with the routing tables both the ppp device and the NIC will be 'directly connected' as far as the OS is concerned. Therefore any connections that originate from the Linux box and are destined for the IP of the local ppp endpoint will never be routed out the NIC. I think that you need a third box for the test that has no knowledge of the ppp endpoint, but can be told via a static route that the endpoint is accessible via the 'gateway IP' of the other PPP server.
I'm a little confused by the way you've stated the question as to what you are trying to accomplish. I'm going to guess that what you want to know is "how can I route packets from the local network to the remote PPP device and vice versa".  With the PPP connection up the Linux box should know how to route data to the remote device because one end of that network is local. And it should also know that packets from the remote PPP node destined for the local network should be sent out eth0 as that is a locally attached network. Obviously for this to work the remote PPP device must have an IP on some network other than that of the local lan.

Now that's fine for a data packet from the PPP device passing through the Linux box onto the local network (assuming the remote PPP device see's the Linux box as a default route). However, other nodes on the local network don't know where to send the reply back to as the source IP isn't on the local net. Either each node on the local net that the remote PPP device needs to talk to needs a static route configured that points to eth0 of your Linux box, or the default router for the local net needs that route.
MFCRichAuthor Commented:
I'll restate the problem:

I have several devices attached to serial ports on my Linux box through which I establish PPP connections to another machine. I have no control over the other machine and I don't even know its OS or arch but every PPP connection has the same IP on the remote end. The local ends get unique IP's of course.

Now I also have an ethernet connection on my machine through which I can talk to an ethernet interface on the PPP server. My default gateway is on my "ethernetwork".

In order to test these devices ( up to 64 of them ) I need to force packets that are destined for the IP of interface ppp0, say, to go out eth0 so they will arrive at ppp0 from the PPP server. Responses should follow the reverse path. The packets must not go through the lo interface.

In summary:

- All packets are locally generated and destined for a local interface. No forwarding is involved on my part.

- Currently it appears that the Linux routing code sees that the destination IP is on a local interface and therefore routes them through lo. This is the behavior I wish to stop.

Thanks again
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

MFCRichAuthor Commented:
Additional info:

The IP addresses I am assigned by the PPP server are on the PPP servers subnet so routing over the ethernet to my PPP interfaces works fine. I have tested this with another machine on the same subnet as my Linux box using ping, ftp, and telnet.
MFCRichAuthor Commented:
I am beginning to fear that you are right. My one hope of salvation at this time is iptables with its pre and post routing features but I am unfamiliar with iptables. I do use ipchains but it certainly isn't up to the job.

Do you see any hope in this? Can you point me to any info sources for iptables?
Let me think about iptables... I had considered it earlier, but couldn't visualize a way to make the Linux box think that ppp0 wasn't local and yet still be able to pass packets over it.
MFCRichAuthor Commented:
OOOPs. I had forgotten that I had this question sitting out here. All my efforts seem to confirm that this is a no go so you get the points.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.