» HOW TO: Install a BNC

» HOW TO: Install a BNC

1. Introduction
A BNC or IRC Bouncer, acts as a proxy for irc, allowing you to hide your real IP address and use a vhost. Connecting to IRC via your shell account using a BNC will benefit you in many ways, such as:-Anonymity: Because the BNC is routing you through the shell server, your IP stays private. Your real IP address will not show up on IRC, therefore your IP address cannot be traced directly back to you.
-Protection: Because of the fact that a BNC hides your IP address, you should be pretty immune to attacks that can be launched against you.
-Vhosts: Vhosts or Virtual Hosts are used in conjunction with a BNC. The BNC will allow you to switch hostname at leisure, with practically no limits on what you can use.
2. Installation
There are two different ways to install a BNC.If you want a fast install and to get the job done quick use method a) below.
If you know your way around the unix operating system, and have a specific reason use method b)
a) Pre-Compiled
After logging into your account type: getbnc This will launch the install of the BNC. Select OK once the install is complete, the automated install will also launch the configuration script, skip to section 3-b Automated Configuration for details on how to answer the questions.
b) New Install
First you will need to login to the shell account.
Then you will have to download the BNC source to your account.
bash$ wget http://gotbnc.com/files/bnc2.9.4.tar.gz
=> `bnc2.9.4.tar.gz’
Resolving gotbnc.com… done.
Connecting to gotbnc.com[208.155.109.110]:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 52,569 [application/x-tar]100%[====================================>] 52,569 116.41K/s ETA 00:0021:54:57 (116.41 KB/s) – `bnc2.9.4.tar.gz’ saved

bash-2.05b$

Now that you have downloaded the source to your account you have to uncompress the archive:-

bash$ tar -zxvf bnc2.9.4.tar.gz
bnc2.9.4/
bnc2.9.4/CHANGES
bnc2.9.4/server.c
bnc2.9.4/Makefile
bnc2.9.4/motd
bnc2.9.4/mkpasswd.c
bnc2.9.4/example.conf
bnc2.9.4/configure.in
bnc2.9.4/configure
bnc2.9.4/config.h.in
bnc2.9.4/conf.c
bnc2.9.4/cmds.c
bnc2.9.4/bncsetup
bnc2.9.4/bncchk
bnc2.9.4/bnc.c
bnc2.9.4/README
bnc2.9.4/Makefile.out
bnc2.9.4/Makefile.in
bnc2.9.4/COPYING
bnc2.9.4/sbuf.h
bnc2.9.4/sbuf.c
bnc2.9.4/send.h
bnc2.9.4/send.c
bnc2.9.4/struct.h
-bash$

We need to go into the bnc directory:-

bash$ cd bnc2.9.4


-bash$ pwd

/home/username/bnc2.9.4

We will now launch the BNC configuration:-

bash$ ./configure
creating cache ./config.cache
checking for gcc… gcc
checking whether the C compiler (gcc ) works… yes
checking whether the C compiler (gcc ) is a cross-compiler… no
checking whether we are using GNU C… yes
checking whether gcc accepts -g… yes
checking how to run the C preprocessor… gcc -E
checking for POSIXized ISC… no
checking for AIX… no
checking for ANSI C header files… yes
checking for sys/wait.h that is POSIX.1 compatible… yes
checking whether time.h and sys/time.h may both be included… yes
checking for sys/time.h… yes
checking for unistd.h… yes
checking for sys/select.h… yes
checking return type of signal handlers… void
checking for select in -lsocket… no
checking for select in -lnsl… no
checking for gethostbyname in -lresolv… no
checking for malloc in -lgnumalloc… no
checking for malloc in -lbsdmalloc… no
checking for select in -linet… no
checking for select in -lcposix… no
checking for select in -lnet… no
checking for crypt in -lcrypt… yes
checking for snprintf… yes
checking for vsnprintf… yes
updating cache ./config.cache
creating ./config.status
creating Makefile
creating config.h
-bash$

Finally the compile the BNC:-

bash$ gmake
gcc -O3 -Wall -c bnc.c
gcc -O3 -Wall -c conf.c
gcc -O3 -Wall -c server.c
gcc -O3 -Wall -c cmds.c
gcc -O3 -Wall -c send.c
gcc -O3 -Wall -c sbuf.c
gcc -O3 -o bnc bnc.o conf.o server.o cmds.o sbuf.o send.o -lcrypt
gcc -O3 -Wall -lcrypt -o mkpasswd mkpasswd.c
-bash$

You are done! The BNC is installed, skip to Paragraph 3-a Manual Configuration.

3. Configuration
a) Manual
The BNC configuration file looks like this:You will need to remove the # in front of every line you wish to use.Make sure you are in the bnc directory using “pwd” if you are not navigate to the directory using “ls” and “cd”.
Open up example.conf with your favorite text editor, in the screenshot above we used “pico”.Edit your file as follows:S:+password
Replace password with the password you wish to use. The + in front of it will make an encrypted password and makes for better security, but if you do not wish to encrypt, then just remove the +.
D:port:1:+password
Replace port with any number between 10000 and 55000, this is the port you will use to connect to the BNC. Make sure to use a number between the range given to you, otherwise the BNC will NOT start. Replace password with a password of your choice (same as supervisor is fine).The optional configurations are self explanatory, if you wish to use them just remove the # in front of the line in question.Save the file to bnc.conf and you are done.
b) Automated
If you are not continuing from 2-b Installation then type:-bash-2.05b$ ./bncsetupOtherwise just answer the questions:-Port to listen on? Anything between 10000 and 55000 is fine.
-Pick a Password.
-Use Encrypted passes in config file? Highly recommend you enter “yes”
-Enter a default Vhost to use? Yes or No If you choose yes, you can find a list of public vhosts on the shell by typing “vhosts” at the shell prompt.
-Would you like BNC to log? If you choose yes you will be asked to specify a filename for the BNC to log to.
-Would you like BNC to display a MOTD? MOTD means message of the day. This message will be displayed everytime you connect to the BNC. If you answer yes, you will be asked to specify the filename of the motd.
-Pick a File to save configuration in if you do not want to use the default.Once you are done the script will exit out and you will be ready to start using the BNC.
4. Starting the BNC.
To start the daemon you need to be in the bnc directory:-bash-2.05b$ pwd
/home/username/bncx.x.xIf you are not in the bnc directory, navigate to it using “cd”To start the BNC type:./bncThis will work if your configuration file is called bnc.conf, if you named the configuration something different you will need to type:

./bnc file.conf

-bash-2.05b$ ./bnc
Irc Proxy v2.8.2 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……:20840
Maxusers………:1
Default conn port:6667
Pid File………:./pid.bnc
Vhost Default….:-SYSTEM DEFAULT-
Process Id…….:69664
Exit ./bnc{7} :Successfully went into the background.

5. Stopping the BNC.
You will need to check your current jobs. Type: ps –x

OR

ps –U username

bash$ ps -x
PID TT STAT TIME COMMAND
98417 ?? Is 0:00.01 ./bnc
64793 p4 Ss 0:00.27 -bash (bash)
69718 p4 R+ 0:00.00 ps -x
-bash$ Locate the PID number of the BNC process, in this case 98417, and type: kill -9 98417
-bash$ ps -x
PID TT STAT TIME COMMAND
64793 p4 Ss 0:00.29 -bash (bash)
70047 p4 R+ 0:00.00 ps -x
-bash$

Common Errors:

Problem Solution
When I try and start the BNC it gives me this error:
-bash$ /bnc
-bash: /bnc: No such file or directory
-bash-2.05b$
1. You forgot to put the “.” In front of /bnc to start the program.2. Your are not in the BNC directory. Go to it using “cd”.
My BNC will not start:
-bash-2.05b$ ./bnc
Irc Proxy v2.8.2 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……:20000
Maxusers………:1
Default conn port:6667
Pid File………:./pid.bnc
Vhost Default….:-SYSTEM DEFAULT-
Exit ./bnc{4} :Unable to bind to socket.
-bash-2.05b$
This means that the BNC was not able to use the port you chose, just open the BNC configuration file and change the port.
6. Connecting to the BNC
Open up your favorite IRC client IRSSI, mIRC, jIRC, BitchX, Xchat etc…Use the following commands to connect to the BNC.

/server absinthe.freebsdshell.com <PORT>
replace the port with the one you selected earlier. /quote pass <password>
replace password with the one selected earlier.At this point you can elect to use the default vhost or to switch.
A list of available vhosts is visible by typing “vhosts” at the shell prompt. /quote vip somedumb.hostname.com
replace somedumb.hostname.com with any vhost in the public vhost list (type vhosts at the shell prompt to view the vhost list). Make sure to use the full hostname, not the IP. Finally you will connect to the IRC server: /quote conn -s irc.network.com If the BNC fails to connect you can just use the last command again:
/quote conn -s irc.different.network.com


Common Problems:

Problem Solution
When I type:
/server irc.myserver.com
I receive a timeout error.
This could be a number of problems ranging from lag to the BNC not being started. First step is to login to the shell and check if the BNC is running. If it is then just restart it. If that still does not work send an email to support@freebsdshell.com with the following information:
Login Name
Directory of the program you are having problems with
Detailed explanation of the problem, or paste the error directly to the email.
I’m connected to the BNC, but it will not connect to the IRC network. Once again this could be a host of problems, from a simple network issue, to the IRC network in question being full, to a K-line.
If in doubt, just email support@freebsdshell.com with the following information:
Login Name
Directory of the program you are having problems with
Detailed explanation of the problem, or paste the error directly to the email.
I connected myself to IRC via my BNC, but my hostname is not the vhost I chose. You need to use the command:
/quote vip hostname.com
Make sure to use the hostname NOT the IP.
7. Getting more help
If this Tutorial is not enough for you, just email support@freebsdshell.com with the following information:
Login Name
Detailed description of the problem
Screenshot, or copy paste of the error.
If you want live help, indicate the IRC network on which are on, you IRC nickname and channel and what times you are available between.
8. Relevant Links
BNC Home Page