Link to home
Start Free TrialLog in
Avatar of MFCRich
MFCRich

asked on

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.

Thanks
Avatar of jlevie
jlevie

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.
Avatar of MFCRich

ASKER

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
Avatar of MFCRich

ASKER

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.
ASKER CERTIFIED SOLUTION
Avatar of jlevie
jlevie

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of MFCRich

ASKER

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.
Avatar of MFCRich

ASKER

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.