Robert Eisig wrote:
> Your answer helps me a lot to get more clarity.
>
> Laptop and server1 are both windows 2000 machines. Server A is Debian
> and Dsl-Router is a router box with a web-admin interface but it is
> running linux inside.
>
> I startet reading out and manipulating the routing tables on laptop and
> server1.
>
> But, the most interesting discovery is the following:
>
> On server1 there is some interesting configuration, as soon as the
> OpenVPN adapter si starting up. Let's have a look at the routing table
> of server1:
>
> Target Netmask Gateway Interface
> 0.0.0.0 0.0.0.0 192.168.178.1 192.168.178.88
>
> 10.18.0.0 255.255.255.252 10.18.0.1 10.18.0.1
>
> 10.18.0.0 255.255.255.248 10.18.0.2 10.18.0.1
>
> 10.18.0.1 255.255.255.255 127.0.0.1 127.0.0.1
>
> 10.18.0.6 255.255.255.255 10.18.0.2 10.18.0.1
>
> 10.255.255.255 255.255.255.255 10.18.0.1 10.18.0.1
>
> 127.0.0.0 255.0.0.0 127.0.0.1 127.0.0.1
>
> 192.168.178.0 255.255.255.0 192.168.178.88 192.168.178.88
>
> 192.168.178.88 255.255.255.255 127.0.0.1 127.0.0.1
>
> 192.168.178.255 255.255.255.255 192.168.178.88 192.168.178.88
>
> 255.255.255.255 255.255.255.255 192.168.0.1 192.168.0.1
>
>
> Standardgateway: 192.168.178.1
>
I just wonder where this mess comes from ...
I clipped most, as I'm going to make a short summary of
the basic tunneling and routing.
An IP tunnel has two sets of addresses: the tunnel inside
and the tunnel outside at both ends. The outside addresses
are used in the public network to connect the tunnel ends
together. The outside addresses include the transport layer
protocol (UDP preferred) and the transport layer port (if
present in the protocol, OpenVPN: UDP/1194).
The inside addresses are for the data transported in the tunnel.
They depend on the tunnel type: For TAP they are the pseudo-MAC
addresses of the tapx interfaces, for TUN they are the IP addresses
and netmasks associated with the tunx interfaces.
When doing basic routing (no load balancing etc), the route
table can be imagined to be sorted in descending netmask order.
This makes the tightest netmasks appera first to the route
handler, and the last one is 0.0.0.0 for the default route.
A destination is masked with the netmask and compared with
the target on the route, each in turn. The first that matches
will be taken, and if no specific match is found, the default
route matches, as both the target and mask are zeroes.
To take the table above as an example:
Target Netmask Gateway Interface
1 10.18.0.1 255.255.255.255 127.0.0.1 127.0.0.1
2 10.18.0.6 255.255.255.255 10.18.0.2 10.18.0.1
3 10.255.255.255 255.255.255.255 10.18.0.1 10.18.0.1
4 192.168.178.88 255.255.255.255 127.0.0.1 127.0.0.1
5 192.168.178.255 255.255.255.255 192.168.178.88 192.168.178.88
6 255.255.255.255 255.255.255.255 192.168.0.1 192.168.0.1
7 10.18.0.0 255.255.255.252 10.18.0.1 10.18.0.1
8 10.18.0.0 255.255.255.248 10.18.0.2 10.18.0.1
9 192.168.178.0 255.255.255.0 192.168.178.88 192.168.178.88
10 127.0.0.0 255.0.0.0 127.0.0.1 127.0.0.1
11 0.0.0.0 0.0.0.0 192.168.178.1 192.168.178.88
For a Linux routing table, there is plenty of extra. This looks
like somebody has copied everything from a Windows route table.
I numbered the lines for clarity, they are not part of route
command output.
The lines 1, 3, 4, 5, 6, 7 and 10 are unnecessary (and misleading).
If line 7 is deleted, line 2 gets unnecessary, too.
The line 8 is incorrect: there should be no gateway, only the
local tun interface directly (10.18.0.1, I guess).
Below is a pretty complicated tunneling table from one of my routers,
handling internal network NAT and OpenVPN tunneling:
tauno@miranda:~$ /sbin/route -n
Kernel IP routing table
Destination Gateway Genmask Flags Iface
172.19.23.2 0.0.0.0 255.255.255.255 UH tun0
172.29.29.28 0.0.0.0 255.255.255.252 U eth0
172.17.23.0 0.0.0.0 255.255.255.0 U eth1
172.19.23.0 172.19.23.2 255.255.255.0 UG tun0
80.222.32.0 0.0.0.0 255.255.240.0 U eth0
0.0.0.0 80.222.32.1 0.0.0.0 UG eth0
I deleted the Metric, Ref and Use columns to fit the line length.
eth0 is connected to ADSL which has an address in the 80.222.32.x range.
eth1 is connected to the internal network.
The 172.29.29.28 network is only for controlling the operator
interface of the ADSL box.
The 172.19.23.x network is transported inside the tunnel.
----
Is this of any help?
--
Tauno Voipio
tauno voipio (at) iki fi
|