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

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
  • 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.
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Multicast - Linux 4 34
esxi 6 vlan networking not working on virtualized vmware workstation 12 hosted on ubuntu lts 16.04.1 2 147
Cron jobs 12 135
VPS for routing recomendations 3 65
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

860 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