Date: Wed, 29 Jan 97 21:33:45 CST From: Joe Greco <jgreco@solaria.sol.net> To: louie@TransSys.COM (Louis A. Mamakos) Cc: julian@whistle.com, hackers@freebsd.org Subject: Re: Network interfaces: removal of. Message-ID: <199701300333.VAA00595@solaria.sol.net> In-Reply-To: <199701280402.XAA03991@whizzo.transsys.com> from "Louis A. Mamakos" at Jan 27, 97 11:02:20 pm
next in thread | previous in thread | raw e-mail | index | archive | help
> > does anyone have any ideas on this?
>
> One idea: add a new message for the routing socket which can notify
> routing daemons that you want to delete an interface (or, like it or not,
> it's gone now). Hopefully they can then arrange to have active references
> to the interface be removed.
>
> I recall another system which had a the ability to "delete" a network
> interface. What it really did was cheat: it essentially overwrote the
> interface name, and shoved the data structure off into a corner. It was
> still around, though, so that if there was some errant reference to it,
> nothing "bad" would happen.
>
> Clearly, this is just a hack. However, it seems to work "well enough",
> so from a pragmatic perspective, you can't dismiss it completely.
>
> While I'm sure that the modules that reference interfaces are finite,
> there's nothing to allocate references to them. This would require a
> level of discipline unknown to the BSD net code. Hell, you might just
> as well wish for locks on the data structures to make the code SMP safe :-)
It's (definitely!) not BSD, but Solaris has some support for this. Their
interfaces are done on the fly..
# ifconfig le1
ifconfig: SIOCGIFFLAGS: le1: no such interface
# ifconfig le1 plumb
# ifconfig le1 10.1.1.1
# ifconfig le1
le1: flags=842<BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.1.1.1 netmask ff000000 broadcast 10.255.255.255
ether 8:0:20:1a:f5:1e
# ifconfig le1 up
# route add net 192.168.0.0 10.1.2.3 1
add net 192.168.0.0: gateway 10.1.2.3
# ifconfig le1
le1: flags=843<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.1.1.1 netmask ff000000 broadcast 10.255.255.255
ether 8:0:20:1a:f5:1e
# netstat -rn|grep 192.168
192.168.0.0 10.1.2.3 UG 0 0
# ifconfig le1 down
# netstat -rn|grep 192.168
192.168.0.0 10.1.2.3 UG 0 0
# ifconfig le1 unplumb
# ifconfig le1
ifconfig: SIOCGIFFLAGS: le1: no such interface
# netstat -rn|grep 192.168
192.168.0.0 10.1.2.3 UG 0 0
#
Not ideal... but something.
... Joe
-------------------------------------------------------------------------------
Joe Greco - Systems Administrator jgreco@ns.sol.net
Solaria Public Access UNIX - Milwaukee, WI 414/342-4847
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199701300333.VAA00595>
