I have tried '-inet' on 6.3/i386 firewall/GW/VPN/etc.. adding 4 aliases (public 
IPs) and then removing 2 of them. If_driver was vr(4). I did it few times over 
SSH without any meltdown of the network. Everything seems to work as expected.

$ cat /etc/hostname.vr0
-inet
inet A.B.C.77 255.255.254.0
inet alias A.B.C.76 255.255.255.255 NONE description "Alias76"
inet alias A.B.C.75 255.255.255.255 NONE description "Alias75"
inet alias A.B.C.74 255.255.255.255 NONE description "Alias74"
inet alias A.B.C.73 255.255.255.255 NONE description "Alias73"

On Sat, 8 Dec 2018 06:48:35 +1100
tomr <t...@equalit.ie> wrote:

> 
> 
> On 12/8/18 6:09 AM, Tom Smyth wrote:
> > Hi Florian,
> > 
> > i had the inet address as the first line ...
> > and then all the inet alias lines were after that...
> > the behaviour was  as described...
> > Thanks for the suggestion though
> > On Fri, 7 Dec 2018 at 18:48, Florian Obser <flor...@openbsd.org> wrote:
> 
> I think Florian was saying you could use '-inet' to remove *all* inet
> addresses first, different to what you probably have already.
> 
> Maybe something like the following would work to remove any aliases not
> set explicitly in hostname.if (with reduced risk of melting the network)....
> 
> in hostname.vio4:
> !/usr/local/bin/clean_ifaliases.sh \$if
> 
> in /usr/local/bin/clean_ifaliases.sh:
> #!/bin/ksh
> for addr in $(ifconfig $1 | awk '/^[[:blank:]]inet/ {print $2}') ; do
> egrep "^(alias|inet) $addr" /etc/hostname.$1 >/dev/null || ifconfig $1
> delete $addr ; done
> 
> 
> 
> hth
> 
> 
> >> One possible workaround is putting
> >> -inet as the first line in /etc/hostname.vio4
> >> It will nuke all v4 addresses and re-add them.
> >>
> >> Depending on your usecase this might work for you or it might melt
> >> down your whole network ;)
> >>
> >> On Thu, Dec 06, 2018 at 10:49:01PM +0000, Tom Smyth wrote:
> >>> Hello,
> >>>
> >>> Im running a router with multiple ips on an interface using the
> >>> inet alias
> >>>
> >>> issue:
> >>> when commenting out configured  aliases on hostname.if
> >>> after running sh /etc/netstart vio4
> >>>
> >>> if you run ifconfig vio4 after the restart of the interface
> >>> the old aliases that were commented still appear in ifconfig output ahead
> >>> of the first ip address configured in the /etc/hostname.vio4 file.
> >>>
> >>> ifconfig  before commenting  out   10.134.91.253  in hostname.vio4
> >>> is listed below
> >>> vio4: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
> >>>         lladdr 16:2c:a4:f2:b4:e3
> >>>         index 5 priority 0 llprio 3
> >>>         media: Ethernet autoselect
> >>>         status: active
> >>>         inet 10.94.0.1 netmask 0xffff0000 broadcast 10.94.255.255
> >>>         inet 10.134.91.65 netmask 0xfffffffc broadcast 10.134.91.67
> >>>         inet 10.134.91.69 netmask 0xfffffffc broadcast 10.134.91.71
> >>>         inet 10.134.91.73 netmask 0xfffffffc broadcast 10.134.91.75
> >>>         inet 10.134.91.85 netmask 0xfffffffc broadcast 10.134.91.87
> >>>         inet 10.134.91.89 netmask 0xfffffffc broadcast 10.134.91.91
> >>>         inet 10.134.91.93 netmask 0xfffffffc broadcast 10.134.91.95
> >>>         inet 10.134.91.161 netmask 0xfffffffc broadcast 10.134.91.163
> >>>         inet 10.134.91.165 netmask 0xfffffffc broadcast 10.134.91.167
> >>>         inet 10.134.91.169 netmask 0xfffffffc broadcast 10.134.91.171
> >>>         inet 10.134.91.173 netmask 0xfffffffc broadcast 10.134.91.175
> >>>         inet 10.134.91.193 netmask 0xfffffffc broadcast 10.134.91.195
> >>>         inet 10.134.91.197 netmask 0xfffffffc broadcast 10.134.91.199
> >>>         inet 10.134.91.201 netmask 0xfffffffc broadcast 10.134.91.203
> >>>         inet 10.134.91.205 netmask 0xfffffffc broadcast 10.134.91.207
> >>>         inet 10.134.91.209 netmask 0xfffffffc broadcast 10.134.91.211
> >>>         inet 10.134.91.213 netmask 0xfffffffc broadcast 10.134.91.215
> >>>         inet 10.134.91.217 netmask 0xfffffffc broadcast 10.134.91.219
> >>>         inet 10.134.91.221 netmask 0xfffffffc broadcast 10.134.91.223
> >>>         inet 10.134.91.225 netmask 0xfffffffc broadcast 10.134.91.227
> >>>         inet 10.134.91.229 netmask 0xfffffffc broadcast 10.134.91.231
> >>>         inet 10.134.91.233 netmask 0xfffffffc broadcast 10.134.91.235
> >>>         inet 10.134.91.237 netmask 0xfffffffc broadcast 10.134.91.239
> >>>         inet 10.134.91.241 netmask 0xfffffffc broadcast 10.134.91.243
> >>>         inet 10.134.91.245 netmask 0xfffffffc broadcast 10.134.91.247
> >>>         inet 10.134.91.249 netmask 0xfffffffc broadcast 10.134.91.251
> >>>         inet 10.134.91.253 netmask 0xfffffffc broadcast 10.134.91.255
> >>> --------------------------------------------------------------------------------------------
> >>>
> >>> after commenting out the last 2 inet aliases , and running sh 
> >>> /etc/netstart vio4
> >>>
> >>> the ifconfig output is as follows  (i have highlighted with ***  the 
> >>> addresses
> >>> which I think should have been removed
> >>>
> >>> vio4: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
> >>>         lladdr 16:2c:a4:f2:b4:e3
> >>>         index 5 priority 0 llprio 3
> >>>         media: Ethernet autoselect
> >>>         status: active
> >>>     ** inet 10.134.91.249 netmask 0xfffffffc broadcast 10.134.91.251****
> >>>     ** inet 10.134.91.253 netmask 0xfffffffc broadcast 10.134.91.255****
> >>>         inet 10.94.0.1 netmask 0xffff0000 broadcast 10.94.255.255
> >>>         inet 10.134.91.65 netmask 0xfffffffc broadcast 10.134.91.67
> >>>         inet 10.134.91.69 netmask 0xfffffffc broadcast 10.134.91.71
> >>>         inet 10.134.91.73 netmask 0xfffffffc broadcast 10.134.91.75
> >>>         inet 10.134.91.85 netmask 0xfffffffc broadcast 10.134.91.87
> >>>         inet 10.134.91.89 netmask 0xfffffffc broadcast 10.134.91.91
> >>>         inet 10.134.91.93 netmask 0xfffffffc broadcast 10.134.91.95
> >>>         inet 10.134.91.161 netmask 0xfffffffc broadcast 10.134.91.163
> >>>         inet 10.134.91.165 netmask 0xfffffffc broadcast 10.134.91.167
> >>>         inet 10.134.91.169 netmask 0xfffffffc broadcast 10.134.91.171
> >>>         inet 10.134.91.173 netmask 0xfffffffc broadcast 10.134.91.175
> >>>         inet 10.134.91.193 netmask 0xfffffffc broadcast 10.134.91.195
> >>>         inet 10.134.91.197 netmask 0xfffffffc broadcast 10.134.91.199
> >>>         inet 10.134.91.201 netmask 0xfffffffc broadcast 10.134.91.203
> >>>         inet 10.134.91.205 netmask 0xfffffffc broadcast 10.134.91.207
> >>>         inet 10.134.91.209 netmask 0xfffffffc broadcast 10.134.91.211
> >>>         inet 10.134.91.213 netmask 0xfffffffc broadcast 10.134.91.215
> >>>         inet 10.134.91.217 netmask 0xfffffffc broadcast 10.134.91.219
> >>>         inet 10.134.91.221 netmask 0xfffffffc broadcast 10.134.91.223
> >>>         inet 10.134.91.225 netmask 0xfffffffc broadcast 10.134.91.227
> >>>         inet 10.134.91.229 netmask 0xfffffffc broadcast 10.134.91.231
> >>>         inet 10.134.91.233 netmask 0xfffffffc broadcast 10.134.91.235
> >>>         inet 10.134.91.237 netmask 0xfffffffc broadcast 10.134.91.239
> >>>         inet 10.134.91.241 netmask 0xfffffffc broadcast 10.134.91.243
> >>>         inet 10.134.91.245 netmask 0xfffffffc broadcast 10.134.91.247
> >>>
> >>> This behaviour is counter intuitive  as it is different to sh 
> >>> /etc/netstart
> >>> behaviour on the configuration of  inet addresses
> >>> im wondiring is this a feature or a bug ...  or me misunderstanding the
> >>> use of netstart script to reset / reload the configuration of an interface
> >>>
> >>> Thanks
> >>>
> >>> Tom Smyth
> >>>
> >>
> >> --
> >> I'm not entirely sure you are real.
> > 
> > 
> > 
> 


-- 
radek

Reply via email to