printf '192.168.1.%d\n' {1..251}
This will use the brace expansion of bash (originally a zsh feature, also available in ksh93) to generate numbers between 1 and 251, and for each number the printf will print an IP address with the number inserted at the end.
The following would read an IP address and do the same with that:
IFS='.' read a1 a2 a3 a4 printf -- "$a1.$a2.$a3.%d\n" {1..251}
If you'd wanted to use awk:
awk 'BEGIN { OFS = FS = "." } { for (i = 1; i <= 251; ++i) print $1, $2, $3, i }' <<<"$IP"
We want both the input and output field delimiter to be a dot, so we set both FS and OFS to this character in a BEGIN block. Then we read the IP addresses from standard input, and for each IP address we iterate from 1 to 251 and print out the list.
On the command-line we feed in $IP as a "here-string" (originally a feature of zsh, but also available in bash and ksh93).