IRC chat from behind a firewall December 2, 2005Posted by Carthik in guides, snippets, ubuntu.
Stuck at school/work behind a firewall which does not allow you to chat on IRC (Internet Relay Chat)? That happens to me all the time. But now, I still can chat at #ubuntu or wherever else I want on IRC networks, by using ssh port forwarding.
Essentials for doing this are:
1. A login at some ssh server — You can set up an ssh server at home, or use one provided by your hosting provider, or a geeky friend.
Now, to forward port 6667, which is the port used for connecting to IRC chat networks, you should execute the following command:
ssh -L 6667:irc.freenode.net:6667 example.com -p 8888 -l username
That commands reads in English as follows:
Open an ssh connection to example.com (replace with your ssh server URL), on port 8888 (replace with whatever port your ssh server uses, if it is the default port then leave out the “-p 8888″ part), as the user “username” (the -l is a “minus ell”), forward the local port 6667 to the port 6667 on irc.freenode.net.
Now, fire up Xchat to connect to the IRC network, and then type “/server localhost” as it tries to connect. Cool, now you can connect to the IRC network even though youa re behind a firewall.