ifconfig alias digital accounting inconvenience.

Hello.
Why are network aliases still being counted?
Code:
ifconfig_ix0_alias0="inet 1.1.1.1 netmask 255.255.255.255"
ifconfig_ix0_alias1="inet 1.1.1.2 netmask 255.255.255.255"
Digital accounting creates inconvenience when there are about 200 aliases in the system.
And you need to delete the alias number 97, after which you have to rebuild the alias numbering.
Very uncomfortable.
 
sh mkalias.sh 10-20 7 12 44-99 88-200
Bash:
#!/bin/sh
MASK=32
NET=1.1.1
IFACE=bce0
PREF="ifconfig_${IFACE}_alias"
LIST=$1
j=0
while [ "$1" != "" ]
do
for i in $1
 do
  MIN=${i%-*}
  MAX=${i#*-}
  for t in $(seq $MIN $MAX)
   do
   echo ${PREF}${j} $NET.$t/$MASK
   j=$(($j+1))
   done
  done
 shift
 done
 
What I have indicated is an example.
Subnets are used differently and there are up to 30 subnets.
a more correct example.
ifconfig_ix0_alias0="inet 9.10.1.1 netmask 255.255.255.255"
ifconfig_ix0_alias1="inet 1.131.1.2 netmask 255.255.255.255"
...
...
ifconfig_ix0_alias42="inet 21.1.9.1 netmask 255.255.255.255"
ifconfig_ix0_alias43="inet 151.1.110.2 netmask 255.255.255.255"
 
It is more convenient to use without alias numbering.
How do variables work in the shell?
Code:
#!/bin/sh 

FOO="bar"
FOO="something else"

echo $FOO
Guess what this outputs.

What would you suggest to change? And how would that work?
 
hmm.
List aliases in a separate file.
Generate activation of aliases at server start automatically.
Something like this.
It is much more convenient than redoing the list of aliases with different subnets, from 50 or 150 aliases.
It's my opinion.
 
It begs the question though, why do you need so many aliases?
Example.
There are web projects that live for six months and after that it is not relevant and have to clean it.
Promotional stubs for the project.
 
Back
Top