Hi all,

I've got a routing question. This is the setup:

                                   +--------------+
                                   |  Provider 1  |
                     +-------------| Analog Modem |---- Internet
                     |             |              |
                     |             +--------------+
              +--------------+
              |     ppp0     |
              |              |
              | Linux Router |     +--------------+
              |    (NAT)     |     |  Provider 2  |
Local Net ----| eth0    eth1 |-----| DSL-ethernet |---- Internet
              |              |     |    bridge    |
              |     tun0     |     +--------------+
              +--------------+
                     |             +-----------+
                     |             |           |
                     +-------------| VPN P-t-P |
                                   |           |
                                   +-----------+


We are transitioning from priver 1 to provider 2, and I want to have
both links up and routng correctly. I don't need load balancing, since
who would want to get load balanced from a DSL modem to a 56K modem...


The latc.org howto has helped me get things mostly working, except when
openvpn is running and hence tun0 exists.


When the tun0 interface is down, I run this script when ppp0 comes up, and everything 
works the way I want it to.


<Begin Routing Script>

#!/bin/bash

IF0=eth0
IF1=eth1
IF2=ppp0

IP0=192.168.0.1
IP1=150.101.29.94
IP2=203.152.247.215

P1=150.101.29.93
P2=`/sbin/ifconfig | grep P-t-P | awk '{print $3}' | awk -F : '{print $2}'`

P0_NET=192.168.0.0/24
P1_NET=150.101.29.92/30
P2_NET=$P2/32

ip route add $P1_NET dev $IF1 src $IP1 table T1
ip route add default via $P1 table T1
ip route add $P2_NET dev $IF2 src $IP2 table T2
ip route add default via $P2 table T2

ip route add $P1_NET dev $IF1 src $IP1
ip route add $P2_NET dev $IF2 src $IP2

ip route add default via $P1

ip rule add from $IP1 table T1
ip rule add from $IP2 table T2

ip route add $P0_NET     dev $IF0 table T1
ip route add $P2_NET     dev $IF2 table T1
ip route add 127.0.0.0/8 dev lo   table T1
ip route add $P0_NET     dev $IF0 table T2
ip route add $P1_NET     dev $IF1 table T2
ip route add 127.0.0.0/8 dev lo   table T2


< End Routing Script>


But when I start openvpn, things break and I can no longer ping the ppp0
interface from the internet. Packets get the other end of the P-t-P
connection from ppp0 and then vanish. CLosing down the openvpn
connection restores things to a working state.

So I thought I would try adding these lines to the above script to setup
routing:

IP3=10.3.0.1
IF3=tun0
P3_NET=$P3/32
ip route add $P3_NET     dev $IF3 table T1
ip route add $P3_NET     dev $IF3 table T2

But that didn't work either.


Can anybody explain to me what is going wrong or how to fix it?

Also how can you debug routing tables? Is there and easy way to watch
what happens to a packet?


cheers

dc

-- 
David Purton
[EMAIL PROTECTED]
 
For the eyes of the LORD range throughout the earth to
strengthen those whose hearts are fully committed to him.
                                 2 Chronicles 16:9a

Attachment: signature.asc
Description: Digital signature

Reply via email to