Look likes iproute2 does not work properly.

Look likes iproute2 does not work properly.

Post by Meledin Evgen » Sat, 08 Sep 2001 16:29:26



Hello!

I've got 2 NIC and 2 gateways (associated with 2 channels).

eth0 (10.1.0.2)  ==>  gateway1 (10.1.0.1)  ===> channel1 (bad)
eth1 (10.2.0.2)  ==>  gateway2 (10.2.0.1)  ===> channel2 (good but
expensive)

My default gateway is "gateway1", but I want that some local user uses
"gateway2" by default.
Ok. Solution is simple:

Mark all users packets:
# iptables -t mangle -A OUTPUT -m owner --uid-owner 1000 -j MARK --set-mark
1

Add rule for marked packets:
# ip rule
0:      from all lookup local
32764:  from all lookup main
32765:  from all fwmark        1 lookup 210
32767:  from all lookup default

Here is my table "210":
# ip route show table 210
default via 10.2.0.1 dev eth2  src 10.2.0.2

And here table "default":
# ip route show table default
default via 10.1.0.1 dev eth0

Of course, in table "main" there is no default route.

But it does not work.  User with UID 1000 can not connect at all.
When I tried to dump traffic on gateway2 I find out that my host
send packets to gateway2 with source address 10.1.0.2 (!!!)
It should be 10.2.0.2 (eth1's IP address).

How can I fix it?

Thanks for any help.

Yours sincerely,
Meledin Evgeny.

 
 
 

Look likes iproute2 does not work properly.

Post by Cedric Blanche » Sat, 08 Sep 2001 16:54:49



Quote:> I've got 2 NIC and 2 gateways (associated with 2 channels).
> eth0 (10.1.0.2)  ==>  gateway1 (10.1.0.1)  ===> channel1 (bad)
> eth1 (10.2.0.2)  ==>  gateway2 (10.2.0.1)  ===> channel2 (good but
> expensive)
> My default gateway is "gateway1", but I want that some local user uses
> "gateway2" by default.
> Ok. Solution is simple:
> Mark all users packets:
> # iptables -t mangle -A OUTPUT -m owner --uid-owner 1000 -j MARK --set-mark
> 1
> Add rule for marked packets:
> # ip rule
> 0:      from all lookup local
> 32764:  from all lookup main
> 32765:  from all fwmark        1 lookup 210
> 32767:  from all lookup default
> Here is my table "210":
> # ip route show table 210
> default via 10.2.0.1 dev eth2  src 10.2.0.2

Why dev eth2, should be dev eth1, shouldn't be ?
It is a bit strange as iproute should issue a RTNETLINK answers: No such device
when trying to attach a route to a non existing device.

--
 ED : (Intel) ne fait que des circuits electroniques.
 ALG: et quasiment d'un seul type : des 4004 et leurs divers drivs.
 Accessoirement, c'est aussi un fabricant de chauffage d'appoint.
 -+- ALG in Guide du Macounet Pervers : Bien choisir son chauffage -+-

 
 
 

1. eth0 not found/Intel Gigabyte not working properly on RH7.3

Hi,

I'm having difficulties with my Network card, and didn't know if I had to
post this to the networking or harware group. I didn't want to cross-post
so I decided to use this group.

I just installed RH 7.3, and my Intel PRO 10/100/1000 card isn't started
at bootup. All my previous RH installations automagically detected the
card at bootup and used DHCP to start my network connection succesfully.
But not with this box :(

I did #ifconfig eth0 and I got some info about the card, so the card is
recognised. But when I do #ifup eth0 I get "Device not found". Weird! So I
searched a bit for eth0, and find / eth0 didn't return any results...

Any ideas?

Regards, Filip de Waard

2. Someone nmap me please?

3. setenvif doesn't seem to work properly - what am I doing wrong ?

4. Rolling my own keylogin for Solaris 2.4

5. RAM Not properly detected - Linux/DOS

6. Compaq Deskpro 4000 support

7. Help-PC likes linux so much won't run DOS

8. MVS/390 to AIX conversion

9. Mouse Likes DOS but hates Linux

10. Solaris "showrev" command look-a-likes?

11. file command not working properly under new 2.0.x kernels

12. NISTnet not working properly

13. pthread not working properly