Routing for local interfaces

Posted on 2001-09-04
Last Modified: 2010-03-17
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.

Question by:MFCRich
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
LVL 40

Expert Comment

ID: 6455283
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.

Author Comment

ID: 6457167
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

Author Comment

ID: 6457193
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.
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

LVL 40

Accepted Solution

jlevie earned 200 total points
ID: 6457842
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.

Author Comment

ID: 6458127
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?
LVL 40

Expert Comment

ID: 6462449
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.

Author Comment

ID: 6519872
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.

Featured Post

Simple, centralized multimedia control

Watch and learn to see how ATEN provided an easy and effective way for three jointly-owned pubs to control the 60 televisions located across their three venues utilizing the ATEN Control System, Modular Matrix Switch and HDBaseT extenders.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question