How do you join a server using an ip?

Is it possible to join servers by using their ips? and how do you do it?

In the console type:


connect *put ip here*

Or better yet:


connect *put ip here***:***put port here*

Thank you so much.