All of lore.kernel.org
 help / color / mirror / Atom feed
* [LARTC] adv. routing features not working?
@ 2001-12-20 21:50 Ross Simpson
  2001-12-20 21:56 ` bert hubert
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Ross Simpson @ 2001-12-20 21:50 UTC (permalink / raw)
  To: lartc

Hello,

I posted here a couple of weeks ago with problems trying to specify and use
multiple gateways.

Got lots of good advise, but I had a little OS trouble.
So I've finally upgraded to 2.4.9, and made sure that the correct options
are compiled in (adv. router, policy routing, etc.)

Here's a quick summary of my goal:
I have two DSL routers connected to my linux box.  Packets are
port-forwarded from each router to an IP on the linux box (each has its own
IP to forward to).  I would like incoming requests to be serviced, and then
returned on the gateway it came in on.  10.4.44.1 is currently the default
gw, and all packets coming in are leaving via it.  10.4.44.2 is the other
router.
10.4.44.11 and .12 are the two IPs (one virtual) for the linux box.

I added the rule:
	ip rule add to 10.4.44.11/24 dev eth0 table speed

and the route:
	ip route add default via 10.4.44.2 dev eth0 table speed
	ip route flush cache

No errors, but if I look at packets (with ethereal), I see the destination
of all outgoing packets is 10.4.44.1.

Now the above rule and route worked fine on another system -- packets went
where they were supposed to.
So my question is, is there a way to test the basic functionality of the
advanced routing features?  I tried forwarding all outgoing packets to
10.4.44.2, and that had no effect either.

I think that I'm either missing a step, or that something is configured
wrong.

Any help's appreciated.
thanks!

Ross




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

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

* Re: [LARTC] adv. routing features not working?
  2001-12-20 21:50 [LARTC] adv. routing features not working? Ross Simpson
@ 2001-12-20 21:56 ` bert hubert
  2001-12-20 22:18 ` Ross Simpson
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: bert hubert @ 2001-12-20 21:56 UTC (permalink / raw)
  To: lartc

On Thu, Dec 20, 2001 at 02:50:06PM -0800, Ross Simpson wrote:
> Hello,
> 
> I posted here a couple of weeks ago with problems trying to specify and use
> multiple gateways.
> 
> Got lots of good advise, but I had a little OS trouble.
> So I've finally upgraded to 2.4.9, and made sure that the correct options
> are compiled in (adv. router, policy routing, etc.)

Can you draw a picture of your situation, and where exactly you entered
the commands you show?

> IP to forward to).  I would like incoming requests to be serviced, and then
> returned on the gateway it came in on.  10.4.44.1 is currently the default
> gw, and all packets coming in are leaving via it.  10.4.44.2 is the other
> router.
> 10.4.44.11 and .12 are the two IPs (one virtual) for the linux box.
> 
> I added the rule:
> 	ip rule add to 10.4.44.11/24 dev eth0 table speed

I think you should change 'to' to 'from'.

If that doesn't help, check the mac address of packets! A packet that is
routed is only sent to a mac address, the destination IP address isn't
changed!

Regards,

bert

-- 
http://www.PowerDNS.com          Versatile DNS Software & Services
http://www.tk                              the dot in .tk
Netherlabs BV / Rent-a-Nerd.nl           - Nerd Available -
Linux Advanced Routing & Traffic Control: http://ds9a.nl/lartc

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

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

* RE: [LARTC] adv. routing features not working?
  2001-12-20 21:50 [LARTC] adv. routing features not working? Ross Simpson
  2001-12-20 21:56 ` bert hubert
@ 2001-12-20 22:18 ` Ross Simpson
  2001-12-20 22:22 ` bert hubert
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Ross Simpson @ 2001-12-20 22:18 UTC (permalink / raw)
  To: lartc

Bert,

Here's a little diagram:

>
>                I N T E R N E T
>                /              \
>    -------------             -------------
>    | 10.4.44.1 |             | 10.4.44.2 |
>    |  lucent   |             |   speed   |
>    -------------             -------------
> port-fw 10.4.44.12:80     port-fw 10.4.44.11:80
>               \               /
>                \             /
>                 \           /
>                  -----------
>                  |   hub   |
>                  -----------
>                       |
>                       |
>                       |
>                      eth0
>                 --------------
>                 | 10.4.44.11 |
>                 | 10.4.44.12 |
>                 |   linux    |
>                 --------------

So basically what I want is that for packets coming in from 'speed' to use
speed as the outgoing gateway.  Looking at incoming packets on the linux
box, I see that when the router does port forwarding, it doesn't rewrite any
addresses -- the packets are still from the remote client and destined for
the linux box.

The reason I had 'to' in my rule (and two IPs on the linux box) is so I
could differentiate traffic from each router -- traffic going to 10.4.44.11
has to be from the 10.4.44.2 router.  The 'from' address was always
different (the remote client).

I thought using mac addresses would be easier, but last time I asked, I was
told IPs were easier ;)

I have looked at the adv-routing howto and searched newsgroups, but haven't
found a way to specify rules and routes with mac addresses.  I tried this:
	ip rule add from 00:01:02:03:04:05 dev eth0 table speed

but got an error: "an inet prefix is expected rather than
"00:01:02:03:04:05".

Is there an option to ip that signifies addresses are mac addresses?


thanks for the help!
Ross



-----Original Message-----
From: lartc-admin@mailman.ds9a.nl [mailto:lartc-admin@mailman.ds9a.nl]On
Behalf Of bert hubert
Sent: Thursday, December 20, 2001 1:57 PM
To: Ross Simpson
Cc: Lartc@Mailman. Ds9a. Nl
Subject: Re: [LARTC] adv. routing features not working?


On Thu, Dec 20, 2001 at 02:50:06PM -0800, Ross Simpson wrote:
> Hello,
>
> I posted here a couple of weeks ago with problems trying to specify and
use
> multiple gateways.
>
> Got lots of good advise, but I had a little OS trouble.
> So I've finally upgraded to 2.4.9, and made sure that the correct options
> are compiled in (adv. router, policy routing, etc.)

Can you draw a picture of your situation, and where exactly you entered
the commands you show?

> IP to forward to).  I would like incoming requests to be serviced, and
then
> returned on the gateway it came in on.  10.4.44.1 is currently the default
> gw, and all packets coming in are leaving via it.  10.4.44.2 is the other
> router.
> 10.4.44.11 and .12 are the two IPs (one virtual) for the linux box.
>
> I added the rule:
> 	ip rule add to 10.4.44.11/24 dev eth0 table speed

I think you should change 'to' to 'from'.

If that doesn't help, check the mac address of packets! A packet that is
routed is only sent to a mac address, the destination IP address isn't
changed!

Regards,

bert

--
http://www.PowerDNS.com          Versatile DNS Software & Services
http://www.tk                              the dot in .tk
Netherlabs BV / Rent-a-Nerd.nl           - Nerd Available -
Linux Advanced Routing & Traffic Control: http://ds9a.nl/lartc

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


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

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

* Re: [LARTC] adv. routing features not working?
  2001-12-20 21:50 [LARTC] adv. routing features not working? Ross Simpson
  2001-12-20 21:56 ` bert hubert
  2001-12-20 22:18 ` Ross Simpson
@ 2001-12-20 22:22 ` bert hubert
  2001-12-20 23:24 ` Ross Simpson
  2001-12-21 10:30 ` bert hubert
  4 siblings, 0 replies; 6+ messages in thread
From: bert hubert @ 2001-12-20 22:22 UTC (permalink / raw)
  To: lartc

On Thu, Dec 20, 2001 at 03:17:47PM -0800, Ross Simpson wrote:
> Bert,
> 
> Here's a little diagram:

Ok - that helps a *lot*. I sometimes feel as if the esteemed readers of our
list think that we are clairvoyant!

> >                I N T E R N E T
> >                /              \
> >    -------------             -------------
> >    | 10.4.44.1 |             | 10.4.44.2 |
> >    |  lucent   |             |   speed   |
> >    -------------             -------------
> > port-fw 10.4.44.12:80     port-fw 10.4.44.11:80
> >               \               /
> >                \             /
> >                       |
> >                      eth0
> >                 --------------
> >                 | 10.4.44.11 |
> >                 | 10.4.44.12 |
> >                 |   linux    |
> >                 --------------
> 
> So basically what I want is that for packets coming in from 'speed' to use
> speed as the outgoing gateway.  Looking at incoming packets on the linux
> box, I see that when the router does port forwarding, it doesn't rewrite any
> addresses -- the packets are still from the remote client and destined for
> the linux box.

Ok. 

> The reason I had 'to' in my rule (and two IPs on the linux box) is so I
> could differentiate traffic from each router -- traffic going to 10.4.44.11
> has to be from the 10.4.44.2 router.  The 'from' address was always
> different (the remote client).

That's still the case isn't it? I think your linux box needs this:

ip rule add from 10.4.44.11 table speed
ip rule add from 10.4.44.12 table lucent

ip route add default via 10.4.44.1 dev eth0 table speed
ip route add default via 10.4.44.1 dev eth0 table lucent

Regards,

bert

-- 
http://www.PowerDNS.com          Versatile DNS Software & Services
http://www.tk                              the dot in .tk
Netherlabs BV / Rent-a-Nerd.nl           - Nerd Available -
Linux Advanced Routing & Traffic Control: http://ds9a.nl/lartc

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

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

* RE: [LARTC] adv. routing features not working?
  2001-12-20 21:50 [LARTC] adv. routing features not working? Ross Simpson
                   ` (2 preceding siblings ...)
  2001-12-20 22:22 ` bert hubert
@ 2001-12-20 23:24 ` Ross Simpson
  2001-12-21 10:30 ` bert hubert
  4 siblings, 0 replies; 6+ messages in thread
From: Ross Simpson @ 2001-12-20 23:24 UTC (permalink / raw)
  To: lartc

Bert,

I think that I've just spent so much time staring at this that I think
everyone else knows what I know :)

Your suggestions work great (with one minor change).. thank you!
But... I don't understand why.

> ip rule add from 10.4.44.11 table speed
> ip rule add from 10.4.44.12 table lucent

What context is the 'from' in?  It seems to me that the linux box would
never see packets from either of those two addresses (.11 and .12).  Maybe
to them, but not from them.



> ip route add default via 10.4.44.1 dev eth0 table speed
> ip route add default via 10.4.44.1 dev eth0 table lucent

I changed the gw on the speed entry to 10.4.44.2, which is correct for that
router.


Thanks again for all the help..
Ross




-----Original Message-----
From: lartc-admin@mailman.ds9a.nl [mailto:lartc-admin@mailman.ds9a.nl]On
Behalf Of bert hubert
Sent: Thursday, December 20, 2001 2:23 PM
To: Ross Simpson
Cc: Lartc@Mailman. Ds9a. Nl
Subject: Re: [LARTC] adv. routing features not working?


On Thu, Dec 20, 2001 at 03:17:47PM -0800, Ross Simpson wrote:
> Bert,
>
> Here's a little diagram:

Ok - that helps a *lot*. I sometimes feel as if the esteemed readers of our
list think that we are clairvoyant!

> >                I N T E R N E T
> >                /              \
> >    -------------             -------------
> >    | 10.4.44.1 |             | 10.4.44.2 |
> >    |  lucent   |             |   speed   |
> >    -------------             -------------
> > port-fw 10.4.44.12:80     port-fw 10.4.44.11:80
> >               \               /
> >                \             /
> >                       |
> >                      eth0
> >                 --------------
> >                 | 10.4.44.11 |
> >                 | 10.4.44.12 |
> >                 |   linux    |
> >                 --------------
>
> So basically what I want is that for packets coming in from 'speed' to use
> speed as the outgoing gateway.  Looking at incoming packets on the linux
> box, I see that when the router does port forwarding, it doesn't rewrite
any
> addresses -- the packets are still from the remote client and destined for
> the linux box.

Ok.

> The reason I had 'to' in my rule (and two IPs on the linux box) is so I
> could differentiate traffic from each router -- traffic going to
10.4.44.11
> has to be from the 10.4.44.2 router.  The 'from' address was always
> different (the remote client).

That's still the case isn't it? I think your linux box needs this:

ip rule add from 10.4.44.11 table speed
ip rule add from 10.4.44.12 table lucent

ip route add default via 10.4.44.1 dev eth0 table speed
ip route add default via 10.4.44.1 dev eth0 table lucent

Regards,

bert

--
http://www.PowerDNS.com          Versatile DNS Software & Services
http://www.tk                              the dot in .tk
Netherlabs BV / Rent-a-Nerd.nl           - Nerd Available -
Linux Advanced Routing & Traffic Control: http://ds9a.nl/lartc

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


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

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

* Re: [LARTC] adv. routing features not working?
  2001-12-20 21:50 [LARTC] adv. routing features not working? Ross Simpson
                   ` (3 preceding siblings ...)
  2001-12-20 23:24 ` Ross Simpson
@ 2001-12-21 10:30 ` bert hubert
  4 siblings, 0 replies; 6+ messages in thread
From: bert hubert @ 2001-12-21 10:30 UTC (permalink / raw)
  To: lartc

On Thu, Dec 20, 2001 at 04:23:54PM -0800, Ross Simpson wrote:

> Your suggestions work great (with one minor change).. thank you!
> But... I don't understand why.
> 
> > ip rule add from 10.4.44.11 table speed
> > ip rule add from 10.4.44.12 table lucent
> 
> What context is the 'from' in?  It seems to me that the linux box would
> never see packets from either of those two addresses (.11 and .12).  Maybe
> to them, but not from them.

This is *outgoing* routing! So in this case, 'from' looks at the source
address.

> > ip route add default via 10.4.44.1 dev eth0 table speed
> > ip route add default via 10.4.44.1 dev eth0 table lucent
> 
> I changed the gw on the speed entry to 10.4.44.2, which is correct for that
> router.

I was just testing to see if you were paying attention :-)

> Thanks again for all the help..

Np.

Regards,

bert

-- 
http://www.PowerDNS.com          Versatile DNS Software & Services
http://www.tk                              the dot in .tk
Netherlabs BV / Rent-a-Nerd.nl           - Nerd Available -
Linux Advanced Routing & Traffic Control: http://ds9a.nl/lartc

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

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

end of thread, other threads:[~2001-12-21 10:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-12-20 21:50 [LARTC] adv. routing features not working? Ross Simpson
2001-12-20 21:56 ` bert hubert
2001-12-20 22:18 ` Ross Simpson
2001-12-20 22:22 ` bert hubert
2001-12-20 23:24 ` Ross Simpson
2001-12-21 10:30 ` bert hubert

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.