1999-12-17 17:38:04

by Andreas Scherbaum

[permalink] [raw]
Subject: Re: Do Routing-policies have effect on local-originated packets?

> It was removed closer to the end of 2.1.xx.
>
> > So what's the current status, are locally originated packets
> > policy-routed or aren't they,

Hei all,

so we have a little problem:
I have a machine with 4 network cards and a ip from the same subnet on
every card.
(Dont ask me, why we have 4 cards for it ;-)
Ok, here's my setup:

----- cut -----
IP=/usr/sbin/ip
ROUTE=/sbin/route

ROUTER="192.168.0.102"
IP0=192.168.0.200
IP1=192.168.0.201
IP2=192.168.0.202
IP3=192.168.0.203
NM="192.168.0.0/24"

# set up interfaces
$IP addr add $IP0 dev eth0
$IP addr add $IP1 dev eth1
$IP addr add $IP2 dev eth2
$IP addr add $IP3 dev eth3
$IP link set eth0 up
$IP link set eth1 up
$IP link set eth2 up
$IP link set eth3 up

# add rules
$IP rule add from $IP0/32 pref 100 table 10
$IP rule add from $IP1/32 pref 200 table 20
$IP rule add from $IP2/32 pref 300 table 30
$IP rule add from $IP3/32 pref 400 table 40
$ROUTE add -host $ROUTER dev eth0

# set routing tables
$IP route add $NM dev eth0 table 10
$IP route add default via $ROUTER table 10
$IP route add $NM dev eth1 table 20
$IP route add default via $ROUTER table 20
$IP route add $NM dev eth2 table 30
$IP route add default via $ROUTER table 30
$IP route add $NM dev eth3 table 40
$IP route add default via $ROUTER table 40
$ROUTE add default gw $ROUTER
----- cut -----

Now i have the following problem:
All UDP packages are created with the right ip, but routed trough the
first network card.

Here's a tcpdump (sending a nameserver request to the second ip ...)
$ host 192.168.0.1 192.168.0.201

# tcpdump -p -i eth1:
18:13:59.988575 192.168.0.15.1128 > 192.168.0.201.domain: 34740+ (28)
18:14:00.036535 192.168.0.15.1128 > 192.168.0.201.domain: 34741+ (28)

# tcpdump -p -i eth0:
18:14:09.514938 192.168.0.201.domain > 192.168.0.15.1128: 16413 1/3/3
(161)
18:14:09.570556 192.168.0.201.domain > 192.168.0.15.1128: 16414 0/1/0
(81)

Why is the kernel sending this packages trough the first interface and
how can i change it to using the right interface?


Regards

--

ads
Andreas Scherbaum