There are loads of irssi scripts which do this, but the truth is irssi actually supports these things very well out of the box. Here’s how.
Start up irssi, then:
/connect irc.freenode.net /nick MyIRCNick /SERVER ADD -auto -network freenode irc.freenode.net 6667 <password>
(you may have to shutdown and restart irssi at this point for it to recognize the network name “freenode” in the next step)
/CHANNEL ADD -auto #ubuntu freenode
Another method of auto-identifying is seen below. The above is generally preferred.
/NETWORK ADD -autosendcmd "/^msg NickServ IDENTIFY password;wait 2000" freenode