I have an interface that I setup like this
ip addr add 192.168.1.1/24 dev eth0
ip addr add 192.168.1.2/24 dev eth0
ip addr add 192.168.1.3/24 dev eth0
etc.
Is there an easy way to delete all of the IPs I add with out doing
ip addr del 192.168.1.1/24 dev eth0
ip addr del 192.168.1.2/24 dev eth0
ip addr del 192.168.1.3/24 dev eth0
or doing something like
ips=`ip addr show dev eth0 | grep -oe '192\.168\1\.[0-2][0-9]{1,2}'`
for ii in $ips; do
ip addr del $ii dev eth0
done
There must be a more elegant way to do this.
Does the flush command not do what you want