Creating a Secondary IP in Linux using Bash Script (Subinterface)

#!/bin/bash
#How to create a sub interface in Linux
echo " Create Sub-Interface"
echo ""
echo "Example input (CIDR): 192.168.1.1/24"
read -p "Enter the Sub Interface IP Address: " SUBIFIP
echo "You Entered: $SUBIFIP
read -p "Enter the Default Gateway: " GATEWAY
echo "You Entered: $GATEWAY"
ifconfig eth0:0 inet $SUBIFIP
route add default gw $GATEWAY

Comments