The rubber part is to create the seal so if there were a backup or for sewer gasses, the connection doesn't leak...your CI looks pretty corroded. I'd want to try a wire brush on it to clean things off, then decide if I could get a decent seal either inside or outside. If it's a 4" pipe, if you can get it cleaned up, either should work, but if it is a 3" pipe, you should only consider an external one. If there's enough there, a plumber could install a new leaded joint, too. Not usually something a typical homeowner has the tools necessary to complete.