All of lore.kernel.org
 help / color / mirror / Atom feed
* [LARTC] policy routing problem
@ 2003-03-12 16:55 Tomas Bonnedahl
  2003-03-12 17:24 ` Tomas Bonnedahl
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Tomas Bonnedahl @ 2003-03-12 16:55 UTC (permalink / raw)
  To: lartc

hello list subscribers, i may have been too cocky in my previous posts regarding this
policy routing problem of mine. (my old posts in further down).

the problem that i cannot reach any defined network from the router still exists. 
i though that would be solved when adding "from interface-address, use routing table
'all'". well, it didnt. 

what i can conclude, with some help from tcpdump, from this is that the router can 
see the routing table when trying to reach a defined network.

the routing table looks pretty much like this: "network a could be reached via router x".
my router does send away a arp request to router x in order to send the packet through it, and 
router x does indeed reply, so everything tcpdump shows is these two packets, nothing more.

'ping a' on the router returns:

root@ibus-router:~# ping 172.16.1.2
PING 172.16.1.2 (172.16.1.2): 56 octets data
sendto: Network is unreachable
ping: sent 64 octets to 172.16.1.2, ret=-1

i have googled on this but without any meaningful results.

i was also concerned with the fact that only adding the interface address in the rules 
would be a problem, and it is. the arp reply from router x will be routed according to table
'main' and thus not reach the origin address. so i simpy added router x's address to the rules and
told it to use table 'all'. i still cannot reach network a from the router.

the thing i seem to think is the most difficult to understand here is that route lookup is
correct, otherwise the arp request wouldnt be sent, but the packet never leaves the router.

this is how i see it:
1. router is requested by me to ping network a
2. router looks in the RPDB to see which routing table to use
3. RPDB says "use table 'all'"
4. router looks after a route to network a in routing table 'all'
5. router finds a route to network a and understands that it has to send it via router x
6. router checks arp cache, doesnt see anything for router x
7. router sends out a arp request to router x
8. router x answers with a arp reply 
(this is where nothing happends)
9. router _should_ compose a packet and send it to router x

ip route flush cache is not a problem.

any insight on this would be helpful. thank you for your time and for reading this far.


best regards,
tomas bonnedahl


On Tue, Mar 11, 2003 at 06:07:03PM +0100, Tomas Bonnedahl wrote:
> hello again list. i have another solution to this that has some 
> advantages over my last post. 
> 
> when dealing with packets and their 'coming-back' i choosed to add routes
> to these networks in table 'main', instead i can create two more rules (a
> total of four rules altogether) that looks like the first two but uses
> the to parameter unstead of the from. (they'll just say "packets that is going
> to x, use table 'all'").
> 
> 
> -tomas bonnedahl
> 
> On Tue, Mar 11, 2003 at 05:32:51PM +0100, Tomas Bonnedahl wrote:
> > i have some additional information regarding this issue with policy routing.
> > 
> > on the router that has policy routing implemented, read further down for 
> > more information on my gols, three ethernet interfaces exists.
> > 
> > since the routing table 'main' just consists of a route to 192.168.1/24
> > with a prohihbit 0/0, you cannot from the router reach a network 
> > that is located on some of the other interfaces than 192.168.1/24 exists
> > on. this is because the src address in the packet will be the address of
> > that interface which the packet will exit. according to the rules that exists
> > in the RPDB, that address will use the routing table 'main' which, in turn,
> > does not have a route to that network. 
> > 
> > the solution to this would be to:
> > 1. make (two) rules which says "if the src address of a packet is the adress
> > of an interface, use table 'all'". (also note that im using the /32 address)
> > 2. add, in routing table 'main', routes to these /32 addresses.
> > 
> > the first part here is used so that a packet could be _sent_ away correct, the
> > second part is used so that a packets can come _back_ correct.
> > 
> > im sure martin have some insight in this, perhaps a simpler solution?
> > 
> > indeed, i did not think of this when implementing policy routing since i was 
> > only concerned with networks and not the router itself.
> > 
> > i hope this will help someone struggeling with policy routing.
> > 
> > 
> > best regards,
> > tomas bonnedahl
> > 
> > On Thu, Mar 06, 2003 at 04:31:42PM +0100, Tomas Bonnedahl wrote:
> > > hello list (and martin) ;x
> > > 
> > > i have now composed my final(?) policy routing design.
> > > 
> > > the goals i had when beginning with this, for you that have not follow
> > > mine and martins thread, was to 1) only let 192.168.1/24 to see all routes,
> > > 2) not route between defined networks, except to and from 192.168.1/24 and 3) not 
> > > defined networks should only be able to reach 192.168.1/24.
> > > 
> > > this might sound simple. it wasnt for me.
> > > 
> > > the solution i came up with, after days and days of thinking (and patience) was
> > > this:
> > > 
> > > two routing tables, one called "ALL" that, suprisingly, held routes to all networks defined
> > > and a default route to internet. the other called "main", just for ease, that held one route to 
> > > 192.168.1/24 and had a default prohibit.
> > > 
> > > the one rule that exists just says "if src = 192.168.1/24 use table ALL". of course there is
> > > an additional rule, the standard one that says "from all lookup main" with a number of 32766.
> > > 
> > > so, for you that doesnt understand my poor english, literally every network that passes, except
> > > from 192.168.1/24, will use the main table that just holds the route to 192.168.1/24 and the 
> > > prohibit one.
> > > 
> > > 
> > > this so simple, something just has to be wrong. feel free to englighten me.
> > > 
> > > 
> > > please flame.
> > > 
> > > best regards,
> > > tomas bonnedahl
> > > _______________________________________________
> > > LARTC mailing list / LARTC@mailman.ds9a.nl
> > > http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
> > > 
> > _______________________________________________
> > LARTC mailing list / LARTC@mailman.ds9a.nl
> > http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
> > 
> _______________________________________________
> LARTC mailing list / LARTC@mailman.ds9a.nl
> http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
> 
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [LARTC] policy routing problem
  2003-03-12 16:55 [LARTC] policy routing problem Tomas Bonnedahl
@ 2003-03-12 17:24 ` Tomas Bonnedahl
  2003-03-12 18:19 ` Tomas Bonnedahl
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Tomas Bonnedahl @ 2003-03-12 17:24 UTC (permalink / raw)
  To: lartc

i think i may know what the problem can be here. 

the order of what happends here is crucial, if the router wants to know what interface the 
packet is supposed to exit on and hence use that address as source, it needs to do
a lookup in the routing table. while this is processing, the router cannot contribute
a src address to the RPDB, thus the rule "from router, lookup 'main'" will not match.

what will match is the rule "from all use 'main'". but 'main' doesnt hold this route.

though this does not explain the arp packets being sent between the router and router x.


argh, can someone please explain this to me?

regards,
tomas bonnedahl

On Wed, Mar 12, 2003 at 05:55:27PM +0100, Tomas Bonnedahl wrote:
> hello list subscribers, i may have been too cocky in my previous posts regarding this
> policy routing problem of mine. (my old posts in further down).
> 
> the problem that i cannot reach any defined network from the router still exists. 
> i though that would be solved when adding "from interface-address, use routing table
> 'all'". well, it didnt. 
> 
> what i can conclude, with some help from tcpdump, from this is that the router can 
> see the routing table when trying to reach a defined network.
> 
> the routing table looks pretty much like this: "network a could be reached via router x".
> my router does send away a arp request to router x in order to send the packet through it, and 
> router x does indeed reply, so everything tcpdump shows is these two packets, nothing more.
> 
> 'ping a' on the router returns:
> 
> root@ibus-router:~# ping 172.16.1.2
> PING 172.16.1.2 (172.16.1.2): 56 octets data
> sendto: Network is unreachable
> ping: sent 64 octets to 172.16.1.2, ret=-1
> 
> i have googled on this but without any meaningful results.
> 
> i was also concerned with the fact that only adding the interface address in the rules 
> would be a problem, and it is. the arp reply from router x will be routed according to table
> 'main' and thus not reach the origin address. so i simpy added router x's address to the rules and
> told it to use table 'all'. i still cannot reach network a from the router.
> 
> the thing i seem to think is the most difficult to understand here is that route lookup is
> correct, otherwise the arp request wouldnt be sent, but the packet never leaves the router.
> 
> this is how i see it:
> 1. router is requested by me to ping network a
> 2. router looks in the RPDB to see which routing table to use
> 3. RPDB says "use table 'all'"
> 4. router looks after a route to network a in routing table 'all'
> 5. router finds a route to network a and understands that it has to send it via router x
> 6. router checks arp cache, doesnt see anything for router x
> 7. router sends out a arp request to router x
> 8. router x answers with a arp reply 
> (this is where nothing happends)
> 9. router _should_ compose a packet and send it to router x
> 
> ip route flush cache is not a problem.
> 
> any insight on this would be helpful. thank you for your time and for reading this far.
> 
> 
> best regards,
> tomas bonnedahl
> 
> 
> On Tue, Mar 11, 2003 at 06:07:03PM +0100, Tomas Bonnedahl wrote:
> > hello again list. i have another solution to this that has some 
> > advantages over my last post. 
> > 
> > when dealing with packets and their 'coming-back' i choosed to add routes
> > to these networks in table 'main', instead i can create two more rules (a
> > total of four rules altogether) that looks like the first two but uses
> > the to parameter unstead of the from. (they'll just say "packets that is going
> > to x, use table 'all'").
> > 
> > 
> > -tomas bonnedahl
> > 
> > On Tue, Mar 11, 2003 at 05:32:51PM +0100, Tomas Bonnedahl wrote:
> > > i have some additional information regarding this issue with policy routing.
> > > 
> > > on the router that has policy routing implemented, read further down for 
> > > more information on my gols, three ethernet interfaces exists.
> > > 
> > > since the routing table 'main' just consists of a route to 192.168.1/24
> > > with a prohihbit 0/0, you cannot from the router reach a network 
> > > that is located on some of the other interfaces than 192.168.1/24 exists
> > > on. this is because the src address in the packet will be the address of
> > > that interface which the packet will exit. according to the rules that exists
> > > in the RPDB, that address will use the routing table 'main' which, in turn,
> > > does not have a route to that network. 
> > > 
> > > the solution to this would be to:
> > > 1. make (two) rules which says "if the src address of a packet is the adress
> > > of an interface, use table 'all'". (also note that im using the /32 address)
> > > 2. add, in routing table 'main', routes to these /32 addresses.
> > > 
> > > the first part here is used so that a packet could be _sent_ away correct, the
> > > second part is used so that a packets can come _back_ correct.
> > > 
> > > im sure martin have some insight in this, perhaps a simpler solution?
> > > 
> > > indeed, i did not think of this when implementing policy routing since i was 
> > > only concerned with networks and not the router itself.
> > > 
> > > i hope this will help someone struggeling with policy routing.
> > > 
> > > 
> > > best regards,
> > > tomas bonnedahl
> > > 
> > > On Thu, Mar 06, 2003 at 04:31:42PM +0100, Tomas Bonnedahl wrote:
> > > > hello list (and martin) ;x
> > > > 
> > > > i have now composed my final(?) policy routing design.
> > > > 
> > > > the goals i had when beginning with this, for you that have not follow
> > > > mine and martins thread, was to 1) only let 192.168.1/24 to see all routes,
> > > > 2) not route between defined networks, except to and from 192.168.1/24 and 3) not 
> > > > defined networks should only be able to reach 192.168.1/24.
> > > > 
> > > > this might sound simple. it wasnt for me.
> > > > 
> > > > the solution i came up with, after days and days of thinking (and patience) was
> > > > this:
> > > > 
> > > > two routing tables, one called "ALL" that, suprisingly, held routes to all networks defined
> > > > and a default route to internet. the other called "main", just for ease, that held one route to 
> > > > 192.168.1/24 and had a default prohibit.
> > > > 
> > > > the one rule that exists just says "if src = 192.168.1/24 use table ALL". of course there is
> > > > an additional rule, the standard one that says "from all lookup main" with a number of 32766.
> > > > 
> > > > so, for you that doesnt understand my poor english, literally every network that passes, except
> > > > from 192.168.1/24, will use the main table that just holds the route to 192.168.1/24 and the 
> > > > prohibit one.
> > > > 
> > > > 
> > > > this so simple, something just has to be wrong. feel free to englighten me.
> > > > 
> > > > 
> > > > please flame.
> > > > 
> > > > best regards,
> > > > tomas bonnedahl
> > > > _______________________________________________
> > > > LARTC mailing list / LARTC@mailman.ds9a.nl
> > > > http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
> > > > 
> > > _______________________________________________
> > > LARTC mailing list / LARTC@mailman.ds9a.nl
> > > http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
> > > 
> > _______________________________________________
> > LARTC mailing list / LARTC@mailman.ds9a.nl
> > http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
> > 
> _______________________________________________
> LARTC mailing list / LARTC@mailman.ds9a.nl
> http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
> 
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [LARTC] policy routing problem
  2003-03-12 16:55 [LARTC] policy routing problem Tomas Bonnedahl
  2003-03-12 17:24 ` Tomas Bonnedahl
@ 2003-03-12 18:19 ` Tomas Bonnedahl
  2003-03-13  4:15 ` Martin A. Brown
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Tomas Bonnedahl @ 2003-03-12 18:19 UTC (permalink / raw)
  To: lartc

hello martin, i was sitting here and waiting for your answer, thank you ;x

(for ease in the migration i use table 'main' with all routes and table 'test'
with only routes to 192.168.1/24 and prohibit 0/0.)

root@ibus-router:~# ip rule show
0:      from all lookup local
31000:  from 172.16.1.2 to 195.43.36.55 lookup main
31100:  from 195.43.36.55 to 172.16.1.2 lookup main
32000:  from 192.168.1.0/24 lookup main
32100:  from 192.168.4.0/24 lookup main
32200:  from 192.168.2.0/24 lookup main
32300:  from all to 192.168.4.1 lookup main
32400:  from all to 192.168.2.2 lookup main
32500:  from all lookup test
32766:  from all lookup main
32767:  from all lookup default

root@ibus-router:~# ip route show table main
192.168.4.0/24 dev eth2  scope link
192.168.2.0/24 dev eth0  scope link
192.168.1.0/24 dev eth1  scope link
10.47.17.0/24 via 192.168.2.1 dev eth0
172.16.1.0/24 via 192.168.4.2 dev eth2
10.46.23.0/24 via 192.168.2.1 dev eth0
192.168.75.0/24 via 192.168.2.1 dev eth0
10.100.0.0/16 via 192.168.2.1 dev eth0
127.0.0.0/8 dev lo  scope link
default via 192.168.2.1 dev eth0

root@ibus-router:~# ip route show table test
192.168.1.0/24 dev eth1  scope link
127.0.0.0/8 dev lo  scope link
prohibit default

things i like to clarify:
1. rules 31000 and 31100 is just so that one address on a defined network can reach an
	address on the internet, and that works perfect.
2. rules 32100-32400 is supposed to be so that the router can reach defined networks, this
	does not work.
3. the reason of having so many routes in table main is just plain stupid when the default
	is the same as there "via..". i will change this in a near future but i added the networks
	so that it would be more clear what i was doing.


some ascii art over the network:

             internet --------------------------|      fw     | -- some defined networks over ipsec
	                                        192.168.2.1/24
            	                		      |
				                      | 
	 	                                192.168.2.2/24
      voip 192.168.4.2/24 ------ 192.168.4.1/24|     router    |192.168.1.1 -- LAN (192.168.1/24)

i hope you understand, please mail back if there is some more information you would like.


thanks,
tomas 

On Wed, Mar 12, 2003 at 11:54:48AM -0600, Martin A. Brown wrote:
> Tomas,
> 
> I'd like to look at your problem, but need a few more details.
> 
> Would you post the output of "ip rule show" and "ip route show" "ip route
> show table all" (and any other tables.
> 
> I like your sequence of 8 events....that help me understand your
> problem....
> 
> Thank you,
> 
> -Martin
> 
>  : i think i may know what the problem can be here.
>  :
>  : the order of what happends here is crucial, if the router wants to know
>  : what interface the packet is supposed to exit on and hence use that
>  : address as source, it needs to do a lookup in the routing table. while
>  : this is processing, the router cannot contribute a src address to the
>  : RPDB, thus the rule "from router, lookup 'main'" will not match.
>  :
>  : what will match is the rule "from all use 'main'". but 'main' doesnt
>  : hold this route.
>  :
>  : though this does not explain the arp packets being sent between the router and router x.
>  :
>  :
>  : argh, can someone please explain this to me?
>  :
>  : regards,
>  : tomas bonnedahl
>  :
>  : On Wed, Mar 12, 2003 at 05:55:27PM +0100, Tomas Bonnedahl wrote:
>  : > hello list subscribers, i may have been too cocky in my previous posts regarding this
>  : > policy routing problem of mine. (my old posts in further down).
>  : >
>  : > the problem that i cannot reach any defined network from the router still exists.
>  : > i though that would be solved when adding "from interface-address, use routing table
>  : > 'all'". well, it didnt.
>  : >
>  : > what i can conclude, with some help from tcpdump, from this is that the router can
>  : > see the routing table when trying to reach a defined network.
>  : >
>  : > the routing table looks pretty much like this: "network a could be reached via router x".
>  : > my router does send away a arp request to router x in order to send the packet through it, and
>  : > router x does indeed reply, so everything tcpdump shows is these two packets, nothing more.
>  : >
>  : > 'ping a' on the router returns:
>  : >
>  : > root@ibus-router:~# ping 172.16.1.2
>  : > PING 172.16.1.2 (172.16.1.2): 56 octets data
>  : > sendto: Network is unreachable
>  : > ping: sent 64 octets to 172.16.1.2, ret=-1
>  : >
>  : > i have googled on this but without any meaningful results.
>  : >
>  : > i was also concerned with the fact that only adding the interface address in the rules
>  : > would be a problem, and it is. the arp reply from router x will be routed according to table
>  : > 'main' and thus not reach the origin address. so i simpy added router x's address to the rules and
>  : > told it to use table 'all'. i still cannot reach network a from the router.
>  : >
>  : > the thing i seem to think is the most difficult to understand here is that route lookup is
>  : > correct, otherwise the arp request wouldnt be sent, but the packet never leaves the router.
>  : >
>  : > this is how i see it:
>  : > 1. router is requested by me to ping network a
>  : > 2. router looks in the RPDB to see which routing table to use
>  : > 3. RPDB says "use table 'all'"
>  : > 4. router looks after a route to network a in routing table 'all'
>  : > 5. router finds a route to network a and understands that it has to send it via router x
>  : > 6. router checks arp cache, doesnt see anything for router x
>  : > 7. router sends out a arp request to router x
>  : > 8. router x answers with a arp reply
>  : > (this is where nothing happends)
>  : > 9. router _should_ compose a packet and send it to router x
>  : >
>  : > ip route flush cache is not a problem.
>  : >
>  : > any insight on this would be helpful. thank you for your time and for reading this far.
>  : >
>  : >
>  : > best regards,
>  : > tomas bonnedahl
>  : >
>  : >
>  : > On Tue, Mar 11, 2003 at 06:07:03PM +0100, Tomas Bonnedahl wrote:
>  : > > hello again list. i have another solution to this that has some
>  : > > advantages over my last post.
>  : > >
>  : > > when dealing with packets and their 'coming-back' i choosed to add routes
>  : > > to these networks in table 'main', instead i can create two more rules (a
>  : > > total of four rules altogether) that looks like the first two but uses
>  : > > the to parameter unstead of the from. (they'll just say "packets that is going
>  : > > to x, use table 'all'").
>  : > >
>  : > >
>  : > > -tomas bonnedahl
>  : > >
>  : > > On Tue, Mar 11, 2003 at 05:32:51PM +0100, Tomas Bonnedahl wrote:
>  : > > > i have some additional information regarding this issue with policy routing.
>  : > > >
>  : > > > on the router that has policy routing implemented, read further down for
>  : > > > more information on my gols, three ethernet interfaces exists.
>  : > > >
>  : > > > since the routing table 'main' just consists of a route to 192.168.1/24
>  : > > > with a prohihbit 0/0, you cannot from the router reach a network
>  : > > > that is located on some of the other interfaces than 192.168.1/24 exists
>  : > > > on. this is because the src address in the packet will be the address of
>  : > > > that interface which the packet will exit. according to the rules that exists
>  : > > > in the RPDB, that address will use the routing table 'main' which, in turn,
>  : > > > does not have a route to that network.
>  : > > >
>  : > > > the solution to this would be to:
>  : > > > 1. make (two) rules which says "if the src address of a packet is the adress
>  : > > > of an interface, use table 'all'". (also note that im using the /32 address)
>  : > > > 2. add, in routing table 'main', routes to these /32 addresses.
>  : > > >
>  : > > > the first part here is used so that a packet could be _sent_ away correct, the
>  : > > > second part is used so that a packets can come _back_ correct.
>  : > > >
>  : > > > im sure martin have some insight in this, perhaps a simpler solution?
>  : > > >
>  : > > > indeed, i did not think of this when implementing policy routing since i was
>  : > > > only concerned with networks and not the router itself.
>  : > > >
>  : > > > i hope this will help someone struggeling with policy routing.
>  : > > >
>  : > > >
>  : > > > best regards,
>  : > > > tomas bonnedahl
>  : > > >
>  : > > > On Thu, Mar 06, 2003 at 04:31:42PM +0100, Tomas Bonnedahl wrote:
>  : > > > > hello list (and martin) ;x
>  : > > > >
>  : > > > > i have now composed my final(?) policy routing design.
>  : > > > >
>  : > > > > the goals i had when beginning with this, for you that have not follow
>  : > > > > mine and martins thread, was to 1) only let 192.168.1/24 to see all routes,
>  : > > > > 2) not route between defined networks, except to and from 192.168.1/24 and 3) not
>  : > > > > defined networks should only be able to reach 192.168.1/24.
>  : > > > >
>  : > > > > this might sound simple. it wasnt for me.
>  : > > > >
>  : > > > > the solution i came up with, after days and days of thinking (and patience) was
>  : > > > > this:
>  : > > > >
>  : > > > > two routing tables, one called "ALL" that, suprisingly, held routes to all networks defined
>  : > > > > and a default route to internet. the other called "main", just for ease, that held one route to
>  : > > > > 192.168.1/24 and had a default prohibit.
>  : > > > >
>  : > > > > the one rule that exists just says "if src = 192.168.1/24 use table ALL". of course there is
>  : > > > > an additional rule, the standard one that says "from all lookup main" with a number of 32766.
>  : > > > >
>  : > > > > so, for you that doesnt understand my poor english, literally every network that passes, except
>  : > > > > from 192.168.1/24, will use the main table that just holds the route to 192.168.1/24 and the
>  : > > > > prohibit one.
>  : > > > >
>  : > > > >
>  : > > > > this so simple, something just has to be wrong. feel free to englighten me.
>  : > > > >
>  : > > > >
>  : > > > > please flame.
>  : > > > >
>  : > > > > best regards,
>  : > > > > tomas bonnedahl
>  : > > > > _______________________________________________
>  : > > > > LARTC mailing list / LARTC@mailman.ds9a.nl
>  : > > > > http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
>  : > > > >
>  : > > > _______________________________________________
>  : > > > LARTC mailing list / LARTC@mailman.ds9a.nl
>  : > > > http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
>  : > > >
>  : > > _______________________________________________
>  : > > LARTC mailing list / LARTC@mailman.ds9a.nl
>  : > > http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
>  : > >
>  : > _______________________________________________
>  : > LARTC mailing list / LARTC@mailman.ds9a.nl
>  : > http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
>  : >
>  : _______________________________________________
>  : LARTC mailing list / LARTC@mailman.ds9a.nl
>  : http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
>  :
> 
> -- 
> Martin A. Brown --- SecurePipe, Inc. --- mabrown@securepipe.com
> 
> 
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [LARTC] policy routing problem
  2003-03-12 16:55 [LARTC] policy routing problem Tomas Bonnedahl
  2003-03-12 17:24 ` Tomas Bonnedahl
  2003-03-12 18:19 ` Tomas Bonnedahl
@ 2003-03-13  4:15 ` Martin A. Brown
  2003-03-13 10:27 ` Tomas Bonnedahl
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Martin A. Brown @ 2003-03-13  4:15 UTC (permalink / raw)
  To: lartc

Hi Tomas,

 : hello martin, i was sitting here and waiting for your answer, thank you
 : ;x

I hope you didn't sit there waiting for this answer!

 : (for ease in the migration i use table 'main' with all routes and table
 : 'test' with only routes to 192.168.1/24 and prohibit 0/0.)
 :
 : root@ibus-router:~# ip rule show
 : 0:      from all lookup local
 : 31000:  from 172.16.1.2 to 195.43.36.55 lookup main
 : 31100:  from 195.43.36.55 to 172.16.1.2 lookup main
 : 32000:  from 192.168.1.0/24 lookup main
 : 32100:  from 192.168.4.0/24 lookup main
 : 32200:  from 192.168.2.0/24 lookup main
 : 32300:  from all to 192.168.4.1 lookup main
 : 32400:  from all to 192.168.2.2 lookup main
 : 32500:  from all lookup test
 : 32766:  from all lookup main
 : 32767:  from all lookup default
 :
 : root@ibus-router:~# ip route show table main
 : 192.168.4.0/24 dev eth2  scope link
 : 192.168.2.0/24 dev eth0  scope link
 : 192.168.1.0/24 dev eth1  scope link
 : 10.47.17.0/24 via 192.168.2.1 dev eth0
 : 172.16.1.0/24 via 192.168.4.2 dev eth2
 : 10.46.23.0/24 via 192.168.2.1 dev eth0
 : 192.168.75.0/24 via 192.168.2.1 dev eth0
 : 10.100.0.0/16 via 192.168.2.1 dev eth0
 : 127.0.0.0/8 dev lo  scope link
 : default via 192.168.2.1 dev eth0
 :
 : root@ibus-router:~# ip route show table test
 : 192.168.1.0/24 dev eth1  scope link
 : 127.0.0.0/8 dev lo  scope link
 : prohibit default
 :
 : things i like to clarify:
 : 1. rules 31000 and 31100 is just so that one address on a defined network can reach an
 : 	address on the internet, and that works perfect.

Looks perfect.

 : 2. rules 32100-32400 is supposed to be so that the router can reach
 :    defined networks, this does not work.

This may be part of the "which comes first, the chicken or the egg"
scenario you alluded to in your previous mail.  I'm still trying to wrap
my mind around the intertwined relationship between source address
selection and route selection.  I can't answer your implied question about
why this doesn't work, nor can I answer your previous question about the
ARP queries which never have a following ethernet frame with IP payload.

Maybe one of the people more familiar with the kernel source code can help
out here.

 : 3. the reason of having so many routes in table main is just plain stupid
 :    when the default is the same as there "via..". i will change this in
 :    a near future but i added the networks so that it would be more
 :    clear what i was doing.

Clarity appreciated.

 : some ascii art over the network:

How about some modified ASCII art!  Everybody loves ASCII....

    0/0 internet -----+ +-------------+ +---- defined networks ipsec
                       \|      fw     |/       10.47.17.0/24
                        +-------------+        10.46.23.0/24
                        192.168.2.1/24         10.100.0.0/16
                                |              192.168.75.0/24
                                |
                        192.168.2.2/24
                        +-------------+
        192.168.4.1/24 /| linux router|\ 192.168.1.1/24
                      / +-------------+ +--- LAN
      192.168.4.2/24 /
          +------------+
          |   voip     |
          +------------+
               |
               +-- 172.16.1.0/24

This is what I'm able to gather from your routes and diagram, and you,
sir, have a garden of networks.

I think what you want to do on "linux router" is to try the following
(idiomatic) RPDB entry.

# ip rule add iif lo table all    # -- or table main in above case

I know it seems a very simple answer, to a complex question, but I hope it
will work for you.

By the way, Tomas, did you know that you can have rule types in the RPDB,
e.g.,

# ip rule add blackhole from 192.168.4.2 to 10.0.0.0/8
# ip rule add prohibit from 10.47.17.0/24 to 172.16.1.0/24
# ip rule add unreachable from 192.168.75.0/24 to 192.168.4.0/24

OK, I know that tidbit doesn't help you in your current troubles, but I
was hoping that the "iif lo" trick might help.


-Martin

-- 
Martin A. Brown --- SecurePipe, Inc. --- mabrown@securepipe.com

_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [LARTC] policy routing problem
  2003-03-12 16:55 [LARTC] policy routing problem Tomas Bonnedahl
                   ` (2 preceding siblings ...)
  2003-03-13  4:15 ` Martin A. Brown
@ 2003-03-13 10:27 ` Tomas Bonnedahl
  2003-12-08 18:21 ` Serdar KÖYLÜ
  2003-12-09 13:58 ` Serdar KÖYLÜ
  5 siblings, 0 replies; 7+ messages in thread
From: Tomas Bonnedahl @ 2003-03-13 10:27 UTC (permalink / raw)
  To: lartc

On Wed, Mar 12, 2003 at 10:15:21PM -0600, Martin A. Brown wrote:
> Hi Tomas,

hello again.
 
> I hope you didn't sit there waiting for this answer!

this time no. ;)

>  : things i like to clarify:
>  : 1. rules 31000 and 31100 is just so that one address on a defined network can reach an
>  : 	address on the internet, and that works perfect.
> 
> Looks perfect.
> 
>  : 2. rules 32100-32400 is supposed to be so that the router can reach
>  :    defined networks, this does not work.
> 
> This may be part of the "which comes first, the chicken or the egg"
> scenario you alluded to in your previous mail.  I'm still trying to wrap
> my mind around the intertwined relationship between source address
> selection and route selection.  I can't answer your implied question about
> why this doesn't work, nor can I answer your previous question about the
> ARP queries which never have a following ethernet frame with IP payload.

exactly my thought too with the "chicken or egg". i have looked at the iproute2
src code and also the kernel route.c code but since im not that good of a programmer
i couldnt make anything out of it.

i may be stupid here, the arp quierys were sent when i was trying to ping the voIP
network, but it _could_ have come from legatime traffic from the lan (the works) so
the arp request didnt necessarily had to come in conjunction with my ping. im not sure
but when we have now looked further into this, it seems possible that it was not from
ping but from other traffic.


> Maybe one of the people more familiar with the kernel source code can help
> out here.

yes. though im not sure anyone still reads this thread anymore, if anyone ever did. ;/


>  : some ascii art over the network:
> 
> How about some modified ASCII art!  Everybody loves ASCII....
> 
>     0/0 internet -----+ +-------------+ +---- defined networks ipsec
>                        \|      fw     |/       10.47.17.0/24
>                         +-------------+        10.46.23.0/24
>                         192.168.2.1/24         10.100.0.0/16
>                                 |              192.168.75.0/24
>                                 |
>                         192.168.2.2/24
>                         +-------------+
>         192.168.4.1/24 /| linux router|\ 192.168.1.1/24
>                       / +-------------+ +--- LAN
>       192.168.4.2/24 /
>           +------------+
>           |   voip     |
>           +------------+
>                |
>                +-- 172.16.1.0/24
> 
> This is what I'm able to gather from your routes and diagram, and you,
> sir, have a garden of networks.

indeed true. you figured it out and made a much better outline than me.
 
> I think what you want to do on "linux router" is to try the following
> (idiomatic) RPDB entry.
> 
> # ip rule add iif lo table all    # -- or table main in above case

hm. i do not have the possibility to check this right now, but i will do it
as soon as possible. but i have to tell you, i really dont see what this "means"
or will change. just that everything that exits (and enters?) on the loopback if
will use table all? 

> I know it seems a very simple answer, to a complex question, but I hope it
> will work for you.

well, so do i ;)

> By the way, Tomas, did you know that you can have rule types in the RPDB,
> e.g.,
> 
> # ip rule add blackhole from 192.168.4.2 to 10.0.0.0/8
> # ip rule add prohibit from 10.47.17.0/24 to 172.16.1.0/24
> # ip rule add unreachable from 192.168.75.0/24 to 192.168.4.0/24

yes, i knew that. i choosed prohibit since the blackhole just drops them on the floor
and let the client time out. 

> OK, I know that tidbit doesn't help you in your current troubles, but I
> was hoping that the "iif lo" trick might help.

ill check later today and ill mail back to you as soon as possible afterwards.

thank you martin

regards, 
tomas

_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [LARTC] policy routing problem
  2003-03-12 16:55 [LARTC] policy routing problem Tomas Bonnedahl
                   ` (3 preceding siblings ...)
  2003-03-13 10:27 ` Tomas Bonnedahl
@ 2003-12-08 18:21 ` Serdar KÖYLÜ
  2003-12-09 13:58 ` Serdar KÖYLÜ
  5 siblings, 0 replies; 7+ messages in thread
From: Serdar KÖYLÜ @ 2003-12-08 18:21 UTC (permalink / raw)
  To: lartc

Hello..

I Use mandrake 9.1 with a custom kernel. Policy routing etc. all routing
options selected while compile the kernel (2.4.22)..

System is a PC and contain 4 ethernet. 

eth0, a local subnet. 192.168.0.1
eth1, a ADSL modem. pppoe run this interface and ppp0 already up.
Interface numbered as 10.0.0.1 for access modem, and ppp0 masqueraded
for outgoing connections (with $IPT -A POST.. -o ppp0 -j MASQUERADE)

eth2, connect a FR line with a router and address
195.174.43.34 eth3, connect a DMZ with 212.174.154.128/25

Other hand, we use a /28 block for local subnet. eth2 masquerade packets
from local lan to using iptables ... DNAT. 

ADSL line newly connected, 2048/512 kbps.

Only FR line router defined as default gw. 

This system currently working fine, but don't use ADSL..

I want this reason:

All http request use ADSL line.

OR

Only a machine from DMZ (its a proxy server) use this ADSL line..

I read HOWTO and other sources, and test this commands:

echo 200 http >>/etc/iproute2/rttables (!?)

ip rule add fwmark 10001 table http
ip route add default via 81.215.8.1 table http
ip route flush cache
iptables -t mangle -A PREROUTING -p tcp --dport 80 \
  -j MARK --set-mark 10001

For this state, policy routing don't any effect. ppp0 TX/RX Values same
always.

I try this rule. 

ip rule add from 212.174.154.219 table http

Wow... This machine can't reach internet for this reason :(( No
routing.. 

I try, cut-edit-paste HOWTO lines. Create table john etc.. But same
result :(( 

I'm confused. You can help me ?

Excuse me for poor english :(

Thanks.. 
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [LARTC] policy routing problem
  2003-03-12 16:55 [LARTC] policy routing problem Tomas Bonnedahl
                   ` (4 preceding siblings ...)
  2003-12-08 18:21 ` Serdar KÖYLÜ
@ 2003-12-09 13:58 ` Serdar KÖYLÜ
  5 siblings, 0 replies; 7+ messages in thread
From: Serdar KÖYLÜ @ 2003-12-09 13:58 UTC (permalink / raw)
  To: lartc

Hi, i'm a stupid :))

Sorry, i forget first policy: RTFM..

On Mon, 8 Dec 2003 20:21:06 +0200
Serdar KÖYLÜ <skoylu@gizemcafe.net> wrote:

> ip rule add fwmark 10001 table http

ip uses hexadecimal notation. This number really 0x10001

> ip route add default via 81.215.8.1 table http
> ip route flush cache
> iptables -t mangle -A PREROUTING -p tcp --dport 80 \
>   -j MARK --set-mark 10001

but, iptables uses radix decimal.

I try "--set-mark 0x10001" and it's work fine..
 
> 
> ip rule add from 212.174.154.219 table http
> 
> Wow... This machine can't reach internet for this reason :(( No
> routing.. 

But this reason don't resolved.. Why ? 

Thanks..
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2003-12-09 13:58 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-03-12 16:55 [LARTC] policy routing problem Tomas Bonnedahl
2003-03-12 17:24 ` Tomas Bonnedahl
2003-03-12 18:19 ` Tomas Bonnedahl
2003-03-13  4:15 ` Martin A. Brown
2003-03-13 10:27 ` Tomas Bonnedahl
2003-12-08 18:21 ` Serdar KÖYLÜ
2003-12-09 13:58 ` Serdar KÖYLÜ

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.