2006/05/26

BNC Setup Guide

BNC Setup Guide May 25th, 2006.
Printable Version

Joey's BNC Setup Guide
Created on June 12th, 2000.

This weekend, while trying to connect to DALnet via my laptop, my host was autokilled for not having Ident installed. Since I am running IP Masquerading and didn't feel like setting up midentd, I thought I would give BNC a try.

"BNC is a great IRC proxying server under the GPL (General Public License). It allows users to connect to chat servers by bouncing off the computer which is running BNC. Basically, it forwards the information from the user to the server and vise versa."

Please note that this program SHOULD NOT be run as root. Run BNC as your own user or you are potentially opening up your system for exploitation. Also, if you don't set up the configuration file properly, you are basically going to allow other people to use you as an irc proxy. With that said, lets begin.

Let's start off by downloading bnc2.6.4.tar.gz from http://gotbnc.com/download.html. Once you have downloaded it, place it in your home directory and untar the file by running the following:

tar -zxvf bnc2.6.4.tar.gz

That will create a new directory called bnc2.6.4, enter it and enter the following commands to compile the program.

./configure
make

Once that has finished, copy the example.conf to bnc.conf. Now before we edit the bnc.conf you will want to pick a password that you will have to enter each time you connect to your BNC server. This password should not be easily guessed.

With that said, type mkpasswd and you should see something that looks like this:

plaintext:

Just type the password you want to use, and it will spit out something that looks like: .eAE2V8lLMG3c

Copy the encrypted password and then open up the bnc.conf with your favorite editor. Scroll down to the bottom of the file and you will see this:

# EXAMPLE CONFIG - CHANGE THIS:
# if your pass starts with + it is encrypted, if not it is a normal pass
#
S:+qcNQHJfDIAfhQ
D:9000:0:testpass
W:1
A:1:*

Erase the encrypted password from the S: line and paste in your own. So if your encrypted pass was .eAE2V8lLMG3c, then S: should read:

S:+.eAE2V8lLMG3c

Next up is the D: line. Pick a port number that you like, which is currently not being used on your machine, such as 6969 and replace the 9000 default. The next field is :0:, that is the max users, with 0 meaning unlimited. If you're the only one that will be using the BNC proxy, then I suggest changing this to 1, just for security reasons. The next field is a password that allows you to connect to an outside server. This again should probably be encrypted so use the mkpasswd utility again.

The next field we will look at is A:. The default allows anyone from anywhere to connect to you. Not a good idea. Like I said in the beginning, I am using BNC via my laptop, so here I placed my laptops internal LAN IP, 192.168.0.2. So the A: line should read:

A:1:192.168.0.2

Once the bnc.conf is fully edited, save & exit the file. Now you can start it up (as your regular user, NOT ROOT) by typing bnc. You should see something like the following:

(lyte@linuxhelp.net) ~/bnc2.6.4# bnc
Irc Proxy v2.6.4 GNU project (C) 1998-99
Coded by James Seter :bugs-> (Pharos@refract.com) or IRC pharos on efnet
--Using conf file bnc.conf
--Configuration:
Daemon port......:6969
Maxusers.........:1
Default conn port:6667
Pid File.........:./pid.bnc
Vhost Default....:-SYSTEM DEFAULT-
Process Id.......:18313
Exit bnc{7} :Successfully went into the background.

That means it's working. Now try to connect to your bnc proxy by loading up an IRC client and typing /server your-bnc-proxys-host.com 6969. It will as you for your password, which is the one that replaces "testpass". Enter in your password by typing /quote pass yourpassword. Then it will move on to the next stage and ask you what server you would like to connect to. Connect to a server by running the following example:

/quote conn irc.dal.net

That should get you onto your IRC network. If your machine also has vhosts, you can specify them in the bnc.conf.