A BNC1 (short for bouncer) is a piece of software that is used to relay traffic and connections in computer networks, much like a proxy. Using a BNC allows a user to hide the original source of the user’s connection, providing privacy as well as the ability to route traffic through a specific location. A BNC can also be used to hide the true target to which a user connects.
I was fed up to launch every day a ssh to connect to an external server, on which I had a tmux running a weechat to get IRC history. 2 problems here:
Sometimes, I forgot to connect on it and missed some messages
It was not integrated to Pidgin (what I use for any IM protocol)
For the configuration, it’s not complicated, you just have to follow the wizard on launching znc:
1
2
3
4
5
6
7
8
9
10
> znc --makeconf
[ ** ] Building new config
[ ** ][ ** ] First let's start with some global settings...
[ ** ][ ?? ] What port would you like ZNC to listen on? (1025 to 65535): 12345[ ?? ] Would you like ZNC to listen using SSL? (yes/no)[no]:
[ ?? ] Would you like ZNC to listen using ipv6? (yes/no)[yes]: no
[ ?? ] Listen Host (Blank for all ips):
[ ok ] Verifying the listener...
Up to you to choose what you want for the network part.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
[ ** ][ ** ] -- Global Modules --
[ ** ][ ** ] +-----------+----------------------------------------------------------+
[ ** ] | Name | Description |
[ ** ] +-----------+----------------------------------------------------------+
[ ** ] | partyline | Internal channels and queries for users connected to znc |
[ ** ] | webadmin | Web based administration module |
[ ** ] +-----------+----------------------------------------------------------+
[ ** ] And 13 other (uncommon) modules. You can enable those later.
[ ** ][ ?? ] Load global module <partyline>? (yes/no)[no]:
[ ?? ] Load global module <webadmin>? (yes/no)[no]: yes
Enable at least the webadmin to help you on configuration.
1
2
3
4
5
6
7
8
[ ** ][ ** ] Now we need to set up a user...
[ ** ] ZNC needs one user per IRC network.
[ ** ][ ?? ] Username (AlphaNumeric): username
[ ?? ] Enter Password:
[ ?? ] Confirm Password:
Choose a username and password for you to connect to ZNC.
Now set global IRC configuration credentials and nicknames:
1
2
3
4
5
6
7
8
9
10
11
[ ?? ] Would you like this user to be an admin? (yes/no)[yes]:
[ ?? ] Nick [username]:
[ ?? ] Alt Nick [username_]:
[ ?? ] Ident [test]:
[ ?? ] Real Name [Got ZNC?]:
[ ?? ] Bind Host (optional):
[ ?? ] Number of lines to buffer per channel [50]: 10000[ ?? ] Would you like to keep buffers after replay? (yes/no)[no]: yes
[ ?? ] Default channel modes [+stn]:
[ ** ]
[ ** ] -- IRC Servers --
[ ** ] Only add servers from the same IRC network.
[ ** ] If a server from the list can't be reached, another server will be used.
[ ** ][ ?? ] IRC server (host only):
[ ?? ] IRC server (host only): irc.freenode.net
[ ?? ][irc.freenode.net] Port (1 to 65535)[6667]:
[ ?? ][irc.freenode.net] Password (probably empty):
[ ?? ] Does this server use SSL? (yes/no)[no]:
[ ** ][ ?? ] Would you like to add another server for this IRC network? (yes/no)[no]:
[ ** ][ ** ] -- Channels --
[ ** ][ ?? ] Would you like to add a channel for ZNC to automatically join? (yes/no)[yes]:
[ ?? ] Channel name: #myassonthecommode[ ?? ] Would you like to add another channel? (yes/no)[no]:
[ ** ][ ?? ] Would you like to set up another user (e.g. for connecting to another network)? (yes/no)[no]:
[ ok ] Writing config [/home/vagrant/.znc/configs/znc.conf]...
[ ** ][ ** ] To connect to this ZNC you need to connect to it as your IRC server
[ ** ] using the port that you supplied. You have to supply your login info
[ ** ] as the IRC server password like this: user:pass.
[ ** ][ ** ] Try something like this in your IRC client...
[ ** ] /server <znc_server_ip> 12345 test:<pass>
[ ** ] And this in your browser...
[ ** ] http://<znc_server_ip>:12345/
[ ** ][ ?? ] Launch ZNC now? (yes/no)[yes]:
[ ok ] Opening Config [/home/vagrant/.znc/configs/znc.conf]...
[ ok ] Loading Global Module [webadmin]... [/usr/lib/znc/webadmin.so][ ok ] Binding to port [12345] using ipv4...
[ ** ] Loading user [username][ ok ] Adding Server [irc.freenode.net 6667]...
[ ok ] Loading Module [chansaver]... [/usr/lib/znc/chansaver.so][ ok ] Loading Module [keepnick]... [/usr/lib/znc/keepnick.so][ ok ] Loading Module [kickrejoin]... [/usr/lib/znc/kickrejoin.so][ ok ] Loading Module [nickserv]... [/usr/lib/znc/nickserv.so][ ok ] Forking into the background... [pid: 4305][ ** ] ZNC 0.206+deb2 - http://znc.in
Now it is launched! First thing to do is to kill znc to be in debug mode and understand what’s wrong when you’ll going to add accounts or if it fails to connect:
1
znc -D
Now open the web interface http://<znc_server_ip>:12345/ and you can finish to configure as it should be. For example in Pidgin, add as IRC server, your ZNC bouncer. Then join a channel that you previously configured into ZNC to get history etc…
If you want to get an idea of what a configuration looks like: