Re: [opensuse] Re: ifroute.ethX not supporting 'ip' options same as 'routes' does



Linda Walsh wrote:

I don't have a weighted setup myself, but I do have a configuration
with multiple redundant routes to the same place. I think(!) you
could use BGP to work with multiple routes, but I don't know enough
about it. In my setup, I switch between three routing-tables
(1="both routes are fine, just alternate", 2="only route1 is
availble", 3="only route2 is available".
---
You switch routing tables: automatically or manually? I'm looking
for autodetect based on which interface comes up.


I do it semi-automatically, but mine isn't based on interface status,
but on which "router" is available (they're really front-end servers).
If you decide to use multiple route tables, it should be possible to
have scripts automatically invoked from /etc/sysconfig/network/if-{up
down}.d.

If I wanted to, I could put it in /etc/sysconfig/network/routes as
"default 0.0.0.0 0.0.0.0 eth0 via x.x.x.1" (in fact, that's what I'm
using as a workaround).

But putting it in the "ifroute.eth0" file fails -- it seems the
ifroute.ethX files are parse differently than the global 'routes'
file, especially in regards to allowing "ip options" at the end of the
line. That's the problem -- the ifroute.ethX files don't seem to
process "ip options" at the end of the their config lines as the
'routes' file *does*.

Maybe take a look at /etc/sysconfig/network/scripts/ifup-route - that's
the script that reads the ifroute-ethX files - the read_route function
will parse the file, and the whole thing is then read by a line:

while read DEST GWAY MASK IFACE TYPE IPOPTS ;

It appears just to be a "bug" -- the ifroute.eth0 file should be
processed the same as the global 'routes' file, with the exception
that the device doesn't need to be specified -- (it's would default to
the device that is the last part of the filename (ifroute.ethX -
routes for "ethX").

Yep. Did you use '-' as a placeholder for the device name?

Okay. You can only have one default gateway - isn't that going to
cause a problem if you try to add a second one when your cross-over
interface comes up?
---

Let's say that I detect carrier loss on eth0. Also, say I run
something like ifplugd that can detect carrier loss and run a script
on loss -- then it could ifdown the non-working interface,which would
remove both, the route to x.x.x.0 (the subnet eth0 was on) and the
default route (as it is no longer accessible via eth0).

I'm not sure it'll also removed the default route, but it sounds
reasonable. Okay.

Now, the sript could start the 2ndard interface, say, on eth3. It
would have the same IPADDR as eth0 did, so I'd automatically get the
route for subnet (x.x.x.0). Then, if I could get ifroute.ethX to
allow specifying 'ip add' flags (as 'routes' does), I could install
the new default route to the gw going out eth3.

Okay.

I can't put the default route in file 'routes', since it might be
on eth0 or eth3 depending on the link status. That's why I'm trying
to specify the default in the ifroute.ethX file. Unfortunately, it
_looks_ like there is a 'bug' in the ifX script system that is not
allowing (or not parsing) 'ip' options in the ifroute.ethX files as is
allowed in the routes (/etc/sysconfig/network/routes) file.

I would not be surprised - I suspect it's probably a very rarely used
feature. Which extra options do you need?

I would imagine your ifroute-eth3 to look like this:

default <gateway> netmask - -

With <gateway> being your gateway as reachable via eth3.

The ifroute.ethX file parser should allow giving 'ip' options just
the same as it allows in 'routes' -- that way I can specify my default
route IN the ifroute.ethX files (which requires me using the "gw
x.x.x.1" option to 'ip'.

Why is that? Wouldn't my suggestion from above work?

The bit with the 'default' routes being in ifroute.ethX (which is
allowed/supported, if you don't need the "gw <host>", 'ip' option) is
more important. That's the one I'd claim is more likely a "bug",
though being able to support the same 'ip' options in 'ifroute.ethX'
as is supported in 'routes' would be the real goal for a fix.

Okay, now I understand - depending on your network, you may have
multiple routes going to the same place?
----
Well not exactly -- with the 'default' route case, it'd only
be which ever card was 'up' that would be the route to the same place..

Understood. I'm really tempted to try this out, just to see what
happens.



--
Per Jessen, Zürich (21.6°C)

--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx



Relevant Pages