LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   configuring routing table :) (https://www.linuxquestions.org/questions/linux-networking-3/configuring-routing-table-675837/)

itz2000 10-12-2008 10:01 AM

configuring routing table :)
 
hello,
I just configured my l2tp-vpn client and I'm having a little problem which somehow it my routing tables doesn't work and it's still uses the old connection (not I'm connected through a vpn and through a router).


Code:

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 84.5.2.1
remote IP address 212.4.1.21root at  /home/cookie/Desktop/cable# route -vn
Kernel IP routing table
Destination    Gateway        Genmask        Flags Metric Ref    Use Iface
212.4.1.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

and now I want that everything will go through PPP0 to 192.168.1.1

so it will be like this : destination (default gw : 0.0.0.0), gateway 192.168.1.1 mask 0.0.0.0 USE PPP0

but I do not succeed somehow :

Code:

root at  /home/cookie/Desktop/cable# route del default
now I only need to do the last step. can you help me with that?

Code:

route add -net 0.0.0.0 192.168.1.1 netmask 0.0.0.0 dev ppp0
this didn't work for me...
and this one doesn't go out through 192.168.1.1 so it's not good for me...
Code:

route add -net 0.0.0.0 netmask 0.0.0.0 dev ppp0
please help :) thanks!

blackhole54 10-12-2008 02:51 PM

Code:

route add default gw 192.168.1.1

itz2000 10-12-2008 03:34 PM

but I want anything to go through PPP0 to 192.168.1.1!!! not via ETH1 which is the default choice


Code:

root at  /home/cookie/Desktop/cable# route add default gw 192.168.1.1 dev ppp0
SIOCADDRT: No such process


blackhole54 10-12-2008 06:23 PM

Have you tried deleting the existing default route before running cable-start?

Beyond that, you might try using the ip command instead of the route command. ip is more powerful but I am not yet anywhere close to fluent with it.

itz2000 10-12-2008 08:07 PM

yes I did try to delete existing routes, it just re add the same rule (route add default gw 192.168.1.1 - in eth1).
I got so confused with the ip command's manual...



any suggestions?

Quakeboy02 10-12-2008 08:27 PM

Never mind what I had posted. Isn't the whole point of connecting to a vpn is to disconnect you from everything except your virtual private network? My experience is that once you are vpn connected, you are only on the private network; the internet is gone. This is to protect your private network. Of course, it can be subverted with an ethernet card and a second connection to your router.

Quakeboy02 10-12-2008 08:38 PM

Have you discussed this with your work or whomever is running the vpn? Do they have a gateway address you should be using? The command is of the form:
Code:

route add default gw 192.168.1.1  ppp0

itz2000 10-12-2008 08:52 PM

Code:

root at  /home/cookie/Desktop/cable# route del default gw 192.168.1.1
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 ppp0
SIOCADDRT: No such process


the VPN is actually the ISP and I want my network to use the vpn instead of the default gw since it's faster internet (lower ping, same bandwith of-course)..

Quakeboy02 10-12-2008 08:54 PM

Quote:

Originally Posted by itz2000 (Post 3308181)
the VPN is actually the ISP and I want my network to use the vpn instead of the default gw since it's faster internet (lower ping, same bandwith of-course)..

Do they have an instruction sheet for how to configure a Windows machine? If so, what does that say to do.

Quakeboy02 10-12-2008 08:58 PM

Well, so far I've found this:
Quote:

8.4. Default route not set

If pppd refuses to set up a default route, it is because (quite correctly) it refuses to remove/replace an existing default route.

The usual reason that this error occurs is that some distributions set up a default route via your Ethernet card as opposed to setting up a specific network route.

See the Linux NAG and the Net2/3 HOWTOs for information on correctly setting up your Ethernet card and associated routes.

An alternative to this is that your LAN uses a gateway/router already and your routing table has been set up to point the default route at this.

Fixing up this last situation can require a fair bit of IP networking knowledge and is beyond the scope of this HOWTO. It is suggested you obtain some expert advice (via the news groups of from someone locally you can ask).
I'll dig around some more.

itz2000 10-12-2008 08:58 PM

in windows after you dial, the routing goes automatically via the newest route.

right or wrong way, some people will argue about that...

but here that's not happening :(

Quakeboy02 10-12-2008 09:01 PM

Ah, I think I've found it. It looks like you must delete your default route before making your ppp connection.

Added:
As a practical matter, you will probably need a direct route to the IP you're logging ppp onto, not a default route.

itz2000 10-12-2008 09:08 PM

Code:

root at  /home/cookie/Desktop/cable# cat /etc/ppp/pppoe.conf | grep -i default
# Make the PPPoE connection your default route.  Set to
# DEFAULTROUTE=no if you don't want this.
DEFAULTROUTE=yes

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.1    0.0.0.0        UG    0      0        0 eth1
root at  /home/cookie/Desktop/cable# route del default 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
root at  /home/cookie/Desktop/cable# cable-start
Using interface ppp0
Connect: ppp0 <--> /dev/pts/3
root at  /home/cookie/Desktop/cable# PAP authentication succeeded
not replacing existing default route via 192.168.1.1
local  IP address 84.95.24.55
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

So it didn't work... :S

Quakeboy02 10-12-2008 09:12 PM

I'm out of ideas. You might try more along the lines of what I was doing:

google linux ppp default route

Quakeboy02 10-12-2008 09:15 PM

Well, one more thing, I guess. Disable dhcp, as that's probably what's sticking the default back. Delete the route from 192.168.1.1 to 212.199.170.170 and replace it with a static route from 192.168.1.x to 212.199.170.170; where x is your actual ip. Then try to connect.


All times are GMT -5. The time now is 05:45 PM.