LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 10-12-2008, 09:17 PM   #16
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Linux 9 (stretch)
Posts: 3,361

Rep: Reputation: 127Reputation: 127

If that fails, leave the route from 192.168.1.1 to 212.199.170.170 in and put in a static route from 192.168.1.x to 192.168.1.1
 
Old 10-12-2008, 09:22 PM   #17
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Linux 9 (stretch)
Posts: 3,361

Rep: Reputation: 127Reputation: 127
Should have also told you to search here. Try this thread to see if this helps:

http://www.linuxquestions.org/questi...+default+route
 
Old 10-12-2008, 09:24 PM   #18
itz2000
Member
 
Registered: Jul 2005
Distribution: Fedora fc4, fc7, Mandrake 10.1, mandriva06, suse 9.1, Slackware 10.2, 11.0, 12.0,1,2 (Current)]
Posts: 732

Original Poster
Rep: Reputation: 30
it actually make sense (or perhaps i didn't understand the last part of the sentence, anyways, I tried both and out of ideas - killed dhcpcd first to this test)
Code:
root at  /home/cookie/Desktop/cable# route -vn
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
212.199.170.170 192.168.1.1     255.255.255.255 UGH   0      0        0 eth1
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth1
127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo
root at  /home/cookie/Desktop/cable# route add 212.199.170.170 gw 192.168.1.4
root at  /home/cookie/Desktop/cable# route -vn
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
212.199.170.170 192.168.1.4     255.255.255.255 UGH   0      0        0 eth1
212.199.170.170 192.168.1.1     255.255.255.255 UGH   0      0        0 eth1
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth1
127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo
root at  /home/cookie/Desktop/cable# route del 212.199.170.170 gw 192.168.1.1
root at  /home/cookie/Desktop/cable#
root at  /home/cookie/Desktop/cable#
root at  /home/cookie/Desktop/cable# route -vn
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
212.199.170.170 192.168.1.4     255.255.255.255 UGH   0      0        0 eth1
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth1
127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo
root at  /home/cookie/Desktop/cable# cable-start
Using interface ppp0
Connect: ppp0 <--> /dev/pts/3
anon warn[open_inetsock:pptp_callmgr.c:329]: connect: No route to host
anon fatal[callmgr_main:pptp_callmgr.c:127]: Could not open control connection to 212.199.170.170
anon fatal[open_callmgr:pptp.c:479]: Call manager exited with error 256
Modem hangup
Connection terminated.
root at  /home/cookie/Desktop/cable# route del 212.199.170.170 gw 192.168.1.4
SIOCDELRT: No such process
root at  /home/cookie/Desktop/cable# route del 212.199.170.170
root at  /home/cookie/Desktop/cable# route add 212.199.170.170 gw 192.168.1.1
root at  /home/cookie/Desktop/cable# route -vn
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
212.199.170.170 192.168.1.1     255.255.255.255 UGH   0      0        0 eth1
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth1
127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo
0.0.0.0         192.168.1.4     0.0.0.0         UG    0      0        0 eth1
root at  /home/cookie/Desktop/cable# route del default gw 192.168.1.4
root at  /home/cookie/Desktop/cable# route -vn
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
212.199.170.170 192.168.1.1     255.255.255.255 UGH   0      0        0 eth1
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth1
127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo
root at  /home/cookie/Desktop/cable# cable-start
Using interface ppp0
Connect: ppp0 <--> /dev/pts/3
PAP authentication succeeded
not replacing existing default route via 192.168.1.1
local  IP address 192.116.110.135
remote IP address 212.199.17.21
root at  /home/cookie/Desktop/cable# route -vn
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
212.199.17.21   0.0.0.0         255.255.255.255 UH    0      0        0 ppp0
212.199.170.170 192.168.1.1     255.255.255.255 UGH   0      0        0 eth1
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth1
127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo
0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0 eth1
root at  /home/cookie/Desktop/cable# route add default gw 192.168.1.1 ppp0
SIOCADDRT: No such process
root at  /home/cookie/Desktop/cable# route add default gw 192.168.1.1 dev ppp0
SIOCADDRT: No such process
 
Old 10-12-2008, 09:36 PM   #19
itz2000
Member
 
Registered: Jul 2005
Distribution: Fedora fc4, fc7, Mandrake 10.1, mandriva06, suse 9.1, Slackware 10.2, 11.0, 12.0,1,2 (Current)]
Posts: 732

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by Quakeboy02 View Post
If that fails, leave the route from 192.168.1.1 to 212.199.170.170 in and put in a static route from 192.168.1.x to 192.168.1.1
I do not succeed to delete that route so I can change it from 192.168.1.0/24 to 192.168.1.1
:S
 
Old 10-12-2008, 09:51 PM   #20
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Linux 9 (stretch)
Posts: 3,361

Rep: Reputation: 127Reputation: 127
You're doing all these routing changes before connecting via ppp, right? I really am out of ideas this time. Sorry.
 
Old 10-12-2008, 09:52 PM   #21
itz2000
Member
 
Registered: Jul 2005
Distribution: Fedora fc4, fc7, Mandrake 10.1, mandriva06, suse 9.1, Slackware 10.2, 11.0, 12.0,1,2 (Current)]
Posts: 732

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by Quakeboy02 View Post
You're doing all these routing changes before connecting via ppp, right? I really am out of ideas this time. Sorry.
yes... that's right//


Something is really fucked up.


\
 
Old 10-13-2008, 03:19 PM   #22
itz2000
Member
 
Registered: Jul 2005
Distribution: Fedora fc4, fc7, Mandrake 10.1, mandriva06, suse 9.1, Slackware 10.2, 11.0, 12.0,1,2 (Current)]
Posts: 732

Original Poster
Rep: Reputation: 30
anyone has any idea??



perhaps it shouldn't be on nerworking forum
 
Old 10-13-2008, 03:29 PM   #23
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Linux 9 (stretch)
Posts: 3,361

Rep: Reputation: 127Reputation: 127
Quote:
Originally Posted by itz2000 View Post
anyone has any idea??



perhaps it shouldn't be on nerworking forum
I think it's a networking issue, I just don't think anyone has an idea that hasn't been tried.
 
Old 10-14-2008, 12:03 AM   #24
blackhole54
Senior Member
 
Registered: Mar 2006
Posts: 1,896

Rep: Reputation: 61
Quote:
Originally Posted by itz2000 View Post
anyone has any idea??
I was hoping to have some time to come back and look at this again, but that hasn't happened yet. Hopefully I'll have some time tomorrow. But I can't promise anything (time or results)

I have skimmed, but not studied, what has already been posted. A couple of questions ...

Am I correct that your connection is PPPoE?
Is this cable-start program/script something your ISP provided you with, something you wrote, or a part of your distribution?




Quote:
perhaps it shouldn't be on nerworking forum
I think its on the right forum.
 
Old 10-14-2008, 02:59 AM   #25
itz2000
Member
 
Registered: Jul 2005
Distribution: Fedora fc4, fc7, Mandrake 10.1, mandriva06, suse 9.1, Slackware 10.2, 11.0, 12.0,1,2 (Current)]
Posts: 732

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by blackhole54 View Post
I was hoping to have some time to come back and look at this again, but that hasn't happened yet. Hopefully I'll have some time tomorrow. But I can't promise anything (time or results)

I have skimmed, but not studied, what has already been posted. A couple of questions ...

Am I correct that your connection is PPPoE?
Is this cable-start program/script something your ISP provided you with, something you wrote, or a part of your distribution?




I think its on the right forum.
I think it's right way to call it is l2tp-vpn so it's not a PPPoE.
cable-start is a script made by the cable-company and can be downloaded here : http://213.57.1.12/ISPpages/012/012linux.tar.gz.

I already got internet from my default gw, but this connection which I'm connecting to through a vpn is much faster (lower ping, no ports blocking etc).
 
Old 10-14-2008, 12:00 PM   #26
itz2000
Member
 
Registered: Jul 2005
Distribution: Fedora fc4, fc7, Mandrake 10.1, mandriva06, suse 9.1, Slackware 10.2, 11.0, 12.0,1,2 (Current)]
Posts: 732

Original Poster
Rep: Reputation: 30
I've fixed the script not to add a route to default gw (!!!) so that's what happens :
Code:
root at  /home/cookie# route -vn
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
212.199.17.22   0.0.0.0         255.255.255.255 UH    0      0        0 ppp0
212.199.170.170 192.168.1.1     255.255.255.255 UGH   0      0        0 eth1
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth1
127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo
0.0.0.0         0.0.0.0         0.0.0.0         U     0      0        0 ppp0
so now all I need to do is actually change the last line from
Code:
0.0.0.0         0.0.0.0         0.0.0.0         U     0      0        0 ppp0
to
Code:
0.0.0.0         192.168.1.1         0.0.0.0         U     0      0        0 ppp0
without deleting the first line before adding the second one :

Code:
so now I have this :
root at  /home/cookie# route -vn
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
212.199.17.22   0.0.0.0         255.255.255.255 UH    0      0        0 ppp0
212.199.170.170 192.168.1.1     255.255.255.255 UGH   0      0        0 eth1
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth1
127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo
0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0 ppp0
0.0.0.0         0.0.0.0         0.0.0.0         U     0      0        0 ppp0 <== ALL I NEED TO DO IS TO DELETE THIS LINE
but I do not succeed to delete this line somehow it always delete the line above it.
any tips?
 
Old 10-14-2008, 06:05 PM   #27
blackhole54
Senior Member
 
Registered: Mar 2006
Posts: 1,896

Rep: Reputation: 61
I'm hoping I can get you on your way here. I am making some guesses/assumptions, so let me go through my thoughts step by step.

I could not get the website you listed for 012linux.tar.gz to respond, either with wget or through the browser. A search along with a dig command led me to discover that 213.57.1.12 is the IP address for welcome.hot.net.il, but an attempt using that name failed also. I discovered a tarball by the same name and apparently similar function at http://www.cables.org.il/ik/012linux.tar.gz and I looked at it. It contains two bash scripts and one elf binary of the name pptp-linux. You can download and look at it if you are interested. I imagine it is safe to do so. I do not recommend you try to run it, as I don't really know what it does and I cannot assume it safe.

Looking at those files reinforces the idea I was already forming. A bash script called cstart (analogous to your cable-start?) appears to do what I am about to suggest. And using the strings command on the binary makes me believe that that binary calls (or execs) pppd, which is what I already thought happened with the command you run. Among other reasons, I suspected this because some of the messages are the same that pppd produces.

I have never done what you are trying to do, but I do connect via dialup, and so I am familiar with pppd. For quite some time pppd has refused to replace a default route, even though if told to do so it will create a default route if none exists. I am surmising from what I've seen that initially the default route must point to your router in order for pppd to be able to set up the tunnel. But then the default route needs to change, which pppd refuses to do.

But I think you are in error about what to use for the default gateway address. pppd has now set up a device {pseudo device?) called ppp0 and I believe you want to use the remote address of that device as your default gateway. If you use 192.168.1.1 as your gateway, the only place that can lead is to your router; it can't get you to the other end of the tunnel. This is why you can't make the routing table have a gateway of 192.168.1.1 with the device ppp0. It is a logical contradiction. The routing table I have when I am connected via dialup illustrates the point:

Code:
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
209.xx.xx.xx    0.0.0.0         255.255.255.255 UH    0      0        0 ppp0
255.255.255.255 0.0.0.0         255.255.255.255 UH    0      0        0 eth0
192.168.2.0     192.168.1.xx    255.255.255.0   UG    0      0        0 eth0
192.168.1.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         209.xx.xx.xx    0.0.0.0         UG    0      0        0 ppp0
While my "tunnel" (of sorts ) is going through /dev/ttyS0 and yours is going through /dev/eth0, I believe it is the same principle. So to go back to the output you posted on post #1, after running cable-start you want to delete and then replace the default route:

Code:
route del default
route add default gw 212.4.1.21
which I believe will leave you with a table analagous to the one above, with your default route going through ppp0. Which I think is what you really want. To script this, you can pull the remote address from the output of ifconfig (after ppp0 has been established). The following commands, which I pulled from that cstart script, seems to work:

Code:
NEWGW=$(ifconfig ppp0 | grep inet | cut -d":" -f3 | tail -1 | cut -d" " -f1)
/sbin/route add default gw $NEWGW
(If things still don't work but your routing table looks similar to mine -- at least wrt to ppp0 -- you might want to check and make sure /etc/resolv.conf has been set up correctly. That's a whole other issue which I won't go into now.)

I hope my reasoning has been clear and that this is helpful. Sorry for my first response, which clearly was a result of not reading your initial post carefully enough.

Last edited by blackhole54; 10-14-2008 at 06:19 PM. Reason: Wrong URL
 
Old 10-15-2008, 06:28 AM   #28
itz2000
Member
 
Registered: Jul 2005
Distribution: Fedora fc4, fc7, Mandrake 10.1, mandriva06, suse 9.1, Slackware 10.2, 11.0, 12.0,1,2 (Current)]
Posts: 732

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by blackhole54 View Post
...
Hello Blackhole54,
Please look at my previous message (I've passed everystep, there's only a specific route delete which I couldn't succeed to do).
It's much better state then the 1st one.



Thanks.
 
Old 10-15-2008, 02:54 PM   #29
blackhole54
Senior Member
 
Registered: Mar 2006
Posts: 1,896

Rep: Reputation: 61
Quote:
Originally Posted by itz2000 View Post
Code:
so now I have this :
root at  /home/cookie# route -vn
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
212.199.17.22   0.0.0.0         255.255.255.255 UH    0      0        0 ppp0
212.199.170.170 192.168.1.1     255.255.255.255 UGH   0      0        0 eth1
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth1
127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo
0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0 ppp0
0.0.0.0         0.0.0.0         0.0.0.0         U     0      0        0 ppp0 <== ALL I NEED TO DO IS TO DELETE THIS LINE
but I do not succeed to delete this line somehow it always delete the line above it.
any tips?
I think it is trying to tell you something. Once you delete the last line it has no way to get to 192.168.1.1. via ppp0, so it must get rid of the next to last line also. (I am actually a bit surprised it allowed the next to last line anyway, since 192.168.1.0/24 -- which is via eth0 -- is more specific than 0.0.0.0/0. Maybe in checking the validity in creating routes it doesn't check that kind of priority.)

Using the logic of my last reply I think that even if you somehow create the table entry you want it won't do what you want. I.e. I don't think sending a packet via ppp0 can ever get it back to 192.168.1.1 which is what that rule says to do. And even if it could, that packet would then proceed to go out to the Internet directly from your router, which is not what you want. I've been wrong before; please feel free to point out the flaw in my logic.

Last edited by blackhole54; 10-15-2008 at 03:00 PM. Reason: typos
 
Old 10-15-2008, 03:21 PM   #30
itz2000
Member
 
Registered: Jul 2005
Distribution: Fedora fc4, fc7, Mandrake 10.1, mandriva06, suse 9.1, Slackware 10.2, 11.0, 12.0,1,2 (Current)]
Posts: 732

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by blackhole54 View Post
that packet would then proceed to go out to the Internet directly from your router, which is not what you want. ...
in-fact, that's what I want...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Configuring routing table with 2 network cards chanakya Linux - Newbie 3 06-03-2008 07:04 AM
routing table selie Linux - Networking 2 05-04-2007 09:12 AM
routing table arvind kumar Linux - Networking 2 06-08-2005 11:59 PM
Help with a Routing Table maginotjr Linux - Networking 4 06-06-2005 09:49 AM
routing table upr8830 Linux - Networking 6 06-18-2003 03:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration