LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   ppp0 or eth0 internet without conflict like windows (https://www.linuxquestions.org/questions/linux-hardware-18/ppp0-or-eth0-internet-without-conflict-like-windows-283079/)

shusko9 01-27-2005 07:21 PM

ppp0 or eth0 internet without conflict like windows
 
Hi fellow linuxers! Oldie neewwbbee here!
I have searched 'forums' and 'how-to-dos' now for too many days. I've also found a few of the same problems asked else where, but no one seems to be able to give a workable answer.
Ok! I run MDK10.0 and what I am attempting to do works out of the box under any windows distro.
I have a local mshome net that connects to the internet via one of the win computers analog modem. I set up my linux box initially (using MDK control center) to use its nic (eth0) as the default route to the internet, over my local LAN to that Win computers modem. That works well right out of the box.
I do occassionally have the need to be able to connect this linux box to my ISP, itself, via its own external serial hardware modem, when the default route is not on, or available. They are 800 ft apart.
I have tried using KPPP to set up the modem. It appears to iniatially work somewhat. It can find google, but is very slow. Eventually after messing around with some of the kppp settings, it will dial and connect, but wont connect to anything, eventhough i could still ping google.
The best I can conclude is that the system cannot decide what is the actuall route to the ISP, either by the eth0 or ppp0 hardware. It seems to be still trying to get to the isp via the nic card. I've tried to ifdown eth0, change "/etc/resolv.conf" to add extra ISP nameserver addresses, added (ifdown eth0, ifup eth0 scripts) to /etc/ppp/, etc. Not good with software.
This problem seems to be more involved than just a small tweak.
Maybe Kppp would have to be reworked to disable the old eth0 route to the outside internet, while it is being used.
I'm open to any more suggestions, before I give up on this and just use a win machine to do this and always use the nic on the linux machines to connect to the internet always.
Thanks for reading K3vgl

Chris Albertson 01-27-2005 08:14 PM

Have y ou looked at the output of the "route" command? See the man page for details. But "route" will tell you where the packets are being sent. and is a good way to test your idea that the "default gateway" is set wrong.

ronferns 01-27-2005 08:51 PM

post your output of "route -n" before and after connecting using kppp.

shusko9 01-28-2005 09:43 AM

Here it is guys root@localhost root]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
65.165.94.133 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 65.165.94.133 0.0.0.0 UG 0 0 0 ppp0
[root@localhost root]#

The above is the route command when I first hooked up the modem, and the other default gateway through the LAN was not up and running(powered down before I booted the linux box). I now am able to use mozilla and surf using ppp0. Works well. Of course, when booting, the eth0 showed failed on bootup. Noone handing out addresses. The Lan is set up as DHCP. There are 5 to 6 machines sharing the LAN. Oh, I have the eth0 setup to run at boot time.

[root@localhost root]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 eth0
[root@localhost root]#

Before I connect with ppp0. The above shows the normal route to other LAN machine that is the ICS of the LAN, (when it is turned on). It works well through this LAN path.

root@localhost root]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
65.165.94.133 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 eth0
[root@localhost root]#

The above is when I connected the linux box via ppp0, and the LAN (eth0)is still connected for sharing purposes. Now the browser refuses to work.

[root@localhost root]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.64.64.64 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 eth0
[root@localhost root]#

The above shows route when I disabled ICS on other LAN box. Slightly different. Browser through ppp0 is not working.

[root@localhost root]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.64.64.64 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 eth0
[root@localhost root]#

The above shows route when I actually powered down the ICS box. The browser through ppp0 still does not work, but you can see a lot of activity on the eth0 data lite.
It appears that once the linux box knows that eth0 is its default internet path, that it learned during boot up, its going to keep trying that path, no matter what.
Appreciate the help, but remember I'm alil' software illiterate. Please be explicit with any help guys and gals. I'm an old hardware guy. Thanks Steve
Oh, I've setup a nearby machine to be ICS, to help trouble shoot, as it is normally 700 ft away.

shusko9 01-28-2005 12:46 PM

happy days guys! I found a solutionon a forum on http://faq.mepis.net that actually works correctly. I'll add the fix at the bottom of this reply. I'm not really sure how the "touch" command does its magic, but glad it does... thanks for your help, and happy linuxing 73's K3VGL


Network: Can Not Communicate With Dialup Modem When Networked
When your computer is networked, typically there will be a master identified as the gateway for the network. This could be a DSL gateway or could be a Windows or other machine that provides modem sharing services, or maybe your machine is a member of an NT domain, etc. In these situations your networked computer looks to the gateway for its internet connection, even if you dial out with an on-board modem. The symptom is that the modem dials out and connects with your ISP, but does not communicate.

In order to communicate with your modem, it must be added to the route table. This can be done in a root console while the modem is connected to your ISP by entering the following command:

route add default ppp0

Once the above has been proven to correct the communication problem it can be automated with a simple shell script placed in directory /etc/ppp/ip-up.d What happens is that when the modem connection is made with the ISP, any scripts in that directory are executed.

* To create the script, open File Manager - Super User Mode and browse to the /etc/ppp/ip-up.d directory.
* Pull down the Tools menu and select Open Terminal.
* In the terminal, enter the following command (the script name is here assumed to be DoRoute):

touch DoRoute

Close the terminal window and click on the newly created but empty DoRoute file. The file will be opened with the text editor. Enter the following lines (note the two lines are separated by a blank line):

#!/bin/sh

route add default ppp0

* Save the file and close the editor.
* Right-click on the file and select Properties. In the Permissions tab click to check the is executable check box, then click ok.

You're done. The next time you dial out with your on-board modem, it will connect and begin communicating on the internet with no manual intervention required.


All times are GMT -5. The time now is 12:33 AM.