It also works when I try to connect from the outside. Sounds wacky, but trust me. I actually got blocked from the server when using 18.104.22.168 after previously being connected because the ports were closed. lol
Also, you're probably going to need to do a /whitelist reload after adding someone. Try and make sure their name is all lowercase. I'm not entirely sure if it matters, but that's how the game handles it.