Policy routing missing default table?
Hi all, this might have been covered, although going over the archives at mailman.ds9a.nl, I haven't been able to find it:
I seem to be missing the default table, even though I've got a local and main table:
[root@wolverine net]# ip rule
0: from all lookup local 32766: from all lookup main 32767: from all lookup 253
Instead, I've got a '253' table...
'wolverine' is a multihomed machine with addresses on the following networks:
64.26.132.192/26
192.168.8.0/24
192.62.100.0/24
It has a default route on the 64.26.132.192 network, and also routes to 192.168.8.2 which has a cable modem attached.
What I want to do is have all traffic from 192.62.100.0/24 routed through a default gateway of 192.168.8.2 instead of wolverine's default gateway. I've accomplished this easily by creating a new table '1' and rule, the table being created before the 'main' table.
The problem is, with this setup, all traffic for the 64.26.132.192/26 network from 192.62.100.0/24 is also routed through 192.168.8.2.
I got around this by adding an explicit rule to route via 64.26.132.193 for anything on 64.26.132.192/26 into table 1.
I was under the impression that my 3 main tables should have been 'local', 'main', and 'default'. 'main' would contain routes to adjacent networks, and 'default' would contain default routes. So I could have solved my problem by just creating a table with precidence in between main and default, and changed the default gateway for 192.62.100.0/24 without changing network routes too.
Does this make sense? And if so, does anyone know why I have a table '253' with nothing in it, and no 'default'?
I'm running iproute2-2.2.4-now-ss001007.tar.gz from ftp://ftp.inr.ac.ru, with kernel 2.4.5.
My userland utilities, like ifconfig, ifup, etc are from RH6.2ish. Would they make a difference?
Thanks!
--
Adrian Chung (adrian at enfusion-group dot com)
http://www.enfusion-group.com/~adrian
GPG Fingerprint: C620 C8EA 86BA 79CC 384C E7BE A10C 353B 919D 1A17 [toad.enfusion-group.com] up 2 days, 12 min, 8 users
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://ds9a.nl/2.4Routing/
Quoted 7 lines · Adrian Chung
Hi all, this might have been covered, although going over the archives at mailman.ds9a.nl, I haven't been able to find it:
I seem to be missing the default table, even though I've got a local and main table:
Quoted 6 lines
[root@wolverine net]# ip rule
0: from all lookup local 32766: from all lookup main 32767: from all lookup 253Instead, I've got a '253' table...
[--snip--]
Quoted 6 lines
I was under the impression that my 3 main tables should have been 'local', 'main', and 'default'. 'main' would contain routes to adjacent networks, and 'default' would contain default routes. So I could have solved my problem by just creating a table with precidence in between main and default, and changed the default gateway for 192.62.100.0/24 without changing network routes too.
Well, according to the "Linux 2.4 Advanced Routing HOWTO" the default table (or 253) should be empty and the default route should be in 'main'.
Quoted 2 lines
Does this make sense? And if so, does anyone know why I have a table '253' with nothing in it, and no 'default'?
Actually, I don't know why there isn't a default table but one named '253'. I have the same here on a RedHat 7.1 system running kernel 2.4.5 with iproute2-ss000305.
Quoted 5 lines
I'm running iproute2-2.2.4-now-ss001007.tar.gz from ftp://ftp.inr.ac.ru, with kernel 2.4.5.
My userland utilities, like ifconfig, ifup, etc are from RH6.2ish. Would they make a difference?
Greetings,
Juri
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://ds9a.nl/2.4Routing/
Quoted 10 lines · Juri Haberland
Quoted 6 lines
I was under the impression that my 3 main tables should have been 'local', 'main', and 'default'. 'main' would contain routes to adjacent networks, and 'default' would contain default routes. So I could have solved my problem by just creating a table with precidence in between main and default, and changed the default gateway for 192.62.100.0/24 without changing network routes too.
Well, according to the "Linux 2.4 Advanced Routing HOWTO" the default table (or 253) should be empty and the default route should be in 'main'.
Hmm, that's strange. So in the situation I have, where the router is connected to 3 adjacent networks physically, and I only want to alter the default gateway for one subnet, without affecting the other local network routes, how would I do it?
I'm assuming that if I insert a table before 'main', as I currently do, I have to duplicate all the routes to other local networks.
If I add the table after 'main', the default route that's in main overrides whatever default route I would put in the new table.
Is this logic sensible?
Quoted 6 lines
Quoted 2 lines
Does this make sense? And if so, does anyone know why I have a table '253' with nothing in it, and no 'default'?
Actually, I don't know why there isn't a default table but one named '253'. I have the same here on a RedHat 7.1 system running kernel 2.4.5 with iproute2-ss000305.
Okay, at least I'm not alone. :)
--
Adrian Chung (adrian at enfusion-group dot com)
http://www.enfusion-group.com/~adrian
GPG Fingerprint: C620 C8EA 86BA 79CC 384C E7BE A10C 353B 919D 1A17 [toad.enfusion-group.com] up 2 days, 17:17, 9 users
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://ds9a.nl/2.4Routing/
Quoted 18 lines · Adrian Chung
Quoted 10 lines · Juri Haberland
Quoted 6 lines
I was under the impression that my 3 main tables should have been 'local', 'main', and 'default'. 'main' would contain routes to adjacent networks, and 'default' would contain default routes. So I could have solved my problem by just creating a table with precidence in between main and default, and changed the default gateway for 192.62.100.0/24 without changing network routes too.
Well, according to the "Linux 2.4 Advanced Routing HOWTO" the default table (or 253) should be empty and the default route should be in 'main'.
Hmm, that's strange. So in the situation I have, where the router is connected to 3 adjacent networks physically, and I only want to alter the default gateway for one subnet, without affecting the other local network routes, how would I do it?
Quoted 7 lines
I'm assuming that if I insert a table before 'main', as I currently do, I have to duplicate all the routes to other local networks.
If I add the table after 'main', the default route that's in main overrides whatever default route I would put in the new table.
Is this logic sensible?
I assume so. Actually I'm in a similar situation as you and I'm just about using 'ip' to set up a default route for our backup internet link, which has (for historical reasons) also a subnet with DMZ associated with it.
Juri
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://ds9a.nl/2.4Routing/