Date: Thu, 23 Aug 2001 11:16:13 -0600 From: Nate Williams <nate@yogotech.com> To: Toshihiko ARAI <toshi@jp.FreeBSD.org> Cc: nate@yogotech.com (Nate Williams), freebsd-mobile@FreeBSD.org, imp@FreeBSD.org Subject: Re: Documentation for rc.conf's removable_interfaces? Message-ID: <15237.14941.939157.115769@nomad.yogotech.com> In-Reply-To: <200108231653.f7NGrO802605.toshi@jp.FreeBSD.org> References: <15228.2988.181554.313833@nomad.yogotech.com> <200108200357.f7K3vMn18594.toshi@jp.FreeBSD.org> <15233.22136.524384.459698@nomad.yogotech.com> <200108211348.f7LDmTh30188.toshi@jp.FreeBSD.org> <15234.48176.6699.983659@nomad.yogotech.com> <200108231653.f7NGrO802605.toshi@jp.FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
> > This is good. However, there is still one more problem with the file as
> > it exists. If a default_router exists, it will not be used because of
> > the following lines.
>
> > # Add default route into $static_routes
> > case ${defaultrouter} in
> > [Nn][Oo] | '')
> > ;;
> > *)
> > static_routes="default ${static_routes}"
> > route_default="default ${defaultrouter}"
> > ;;
> > esac
>
> > However, I'm not sure what the purpose of adding 'default' to
> > static_routes is, and unfortunately 'route_default' is not used anywhere
> > in the file.
>
> > Can you explain what is intended here?
>
> 'route_default' variable is used with following eval line.
> Because '${i}' is element of '${static_routes}',
> in this case 'route_${i}' is substituted for 'route_default'.
> I referred to 'network_pass1' function of /etc/rc.network,
> it is around 330th line.
>
> # Set up any static routes if specified
> if [ -n "${static_routes}" ]; then
> for i in ${static_routes}; do
> eval route_args=\$route_${i}
> route add ${route_args}
> done
> fi
*lightbulb goes on*
Thanks for the clarification. I understand much better now. Now, I
need to figure out why it doesn't work on my box.
> > ps. The below patch is good, although it may be necessary to do a route
> > flush in certain cases.
>
> When I do hot-plug of PC-card Ethernet and USB Ethernet with
> more than one environment, former route is left and may become
> a problem.
The same problem exists with me.
> Therefore I was able to control it with
> 'removable_route_flush' variable.
> There is a method to add 'removable_route_flush=NO' to
> /etc/defaults/rc.conf, but which is better compared with below patch?
>
> >> - # Clean the routing table
> >> - case ${removable_route_flush} in
> >> - [Nn][Oo])
> >> - ;;
> >> - *)
> >> - # flush beforehand, just in case....
> >> - route -n flush -inet
> >> - ;;
> >> - esac
This means we have the potential for two new variables not (yet) in
-stable.
removable_interfaces (which I still don't know what it's supposed to
do), and removable_route_flush, which is still not generic enough to
work in all cases.
In particular, in one situation, I have 2 network cards in my computer.
If one type of card is removed (my test network), the routes should not
be touched. However, if I remove/insert one the other cards (wireless
and/or ethernet for connection to the net), I need the route added
and/or removed.
Having the route explicitly removed/added when I insert/remove cards
does not work. However, I suspect this is not a 'common' situation, so
I don't believe the code needs to support it.
The code *does* need to support normal activities for laptops, and for
most people I suspect that means adding/removing the default route when
a network card is inserted/removed.
Do others have an opinion on this? What is the default behavior
'out-of-the-box' that FreeBSD should support when a network card is
inserted? For 4.4, I don't think we have time to get it working in all
cases, but the current setup doesn't work in the normal case.
Insertion:
1) DHCP should be supported (of course)
2) If DHCP is not used, should FreeBSD add a default route
Removal
1) DHCP leases are lost
2) Should the default route be flushed (I'm not sure DHCP does this for us)?
Nate
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-mobile" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?15237.14941.939157.115769>
