The last octet or the last two octets? An octet is 8 bits.
Your example indicates you want two octets:
Code:
echo $IPADDRESS | sed ‘s/:[^:]*$/:1/‘
That replaces everything after the last colon. Testing is your responsibility.
If you only want to replace the last octet, it’s a bit more complicated, but should be doable with sed with little more effort.