Installation and configuration of the IRC server – ircd-irc2

On the test I will launch IRC (Internet Relay Chat) server ircd-irc2 in Ubuntu Server 14.04.

The first command is to install the IRC server in Ubuntu:

sudo apt-get install ircd-irc2

There are several configuration files in the /etc/ircd/ directory: /etc/ircd/ircd.conf (main), /etc/ircd/ircd.motd (message to users when connecting), /etc/ircd/iauth.conf (connection parameters ).
In the /usr/share/doc/ircd-irc2/ directory, you can see examples of configuration files.

After the changes in the configuration files, you must reboot the IRC server:

sudo /etc/init.d/ircd-irc2 restart

Users can create and connect to channels with this command:

/join #channel_name

Configuring the ircd-hybrid

Suppose we installed ircd-hybrid as I described in this article – Installing the IRC server – ircd-hybrid
Now proceed to setup.

Let’s edit the text of the welcome message:

sudo nano /etc/ircd-hybrid/ircd.motd

Make a copy of the configuration file just in case:

sudo cp /etc/ircd-hybrid/ircd.conf /etc/ircd-hybrid/ircd_original.conf

Open the main configuration file in the text editor, configure the parameters and comment out the unnecessary ones:

sudo nano /etc/ircd-hybrid/ircd.conf

In the configuration file, the standard serverinfo parameters are first followed, if desired, we change them:

serverinfo {
        name = "hybrid8.debian.local";
        description = "test";
        network_name = "debian";
        network_desc = "This is My Network";
        hub = no;
        default_max_clients = 512;
        max_nick_length = 15;
        max_topic_length = 300;
};

Further, contact the server administrator, if desired, change them:

admin {
        name = "SYSADMIN";
        description = "Main Server Administrator";
        email = "<admin@example.com>";
};

Network parameters (on which ports the ircd-hybrid will work, for example, you can change to 6667):

listen {
        port = 6665 .. 6669;
};

The first auth block that allows you to connect everything from the local address 127.0.0.1:

auth {
        user = "*@127.0.0.1";
        spoof = "i.love.debian.org";
        class = "opers";
        flags = need_password, spoof_notice, exceed_limit, kline_exempt,
                xline_exempt, resv_exempt, no_tilde, can_flood;
};

Another auth block allows you to connect to all (comment or change to your own needs):

auth {
        user = "*@*";
        class = "users";
        flags = need_ident;
};

For example, create a password for the user, copy the result of the command in an encrypted form:

mkpasswd PASSWORD

We add the possibility of authorization to any users only with a password and from the specified network:

auth {
        user = "*@192.168.3.0/24";
        class = "users";
        flags = need_password;
encrypted = yes;
password = "PASSWORD_FROM_mkpasswd";
};

In the auth block the password will be stored in encrypted form, in the IRC client it is specified as it is.
To specify the password in the auth block in the unencrypted form, you need to remove encrypted.

In the general section, disable the need_ident:

general {
...
disable_auth = yes;
...
};

Restart ircd-hybrid to apply the changes:

sudo /etc/init.d/ircd-hybrid restart
sudo service ircd-hybrid restart

We can also add an operator:

auth {
name = "admin";
user = "admin@192.168.3.254/32";
class = "opers";
flags = need_password, spoof_notice, exceed_limit, kline_exempt;
encrypted = yes;
password = "PASSWORD_FROM_mkpasswd";
};

You can block IP addresses as necessary in the following ways:

deny {
       ip = "192.168.4.4/32";
       reason = "Spam";
};

After the changes in the configuration file, you need to restart the ircd-hybrid.
As a customer you can use for example free AdiIRC.

Installing the IRC server – ircd-hybrid

Here is an example of installing an IRC server – ircd-hybrid.

To install ircd-hybrid in Ubuntu, run the following command:

sudo apt-get install ircd-hybrid

After installation, ircd-hybrid will use TCP ports 6665-6669.

If desired, to connect to the IRC from the terminal, you can set for example the IRC client epic4:

sudo apt-get install epic4

And connect:

irc 127.0.0.1

You can connect to the channel with the command:

/join CHANNEL

Go out:

/quit

Check whether the ircd-hybrid is running, for example:

netstat -a | grep irc
netstat -an | grep 6667

Restart ircd-hybrid as follows:

sudo /etc/init.d/ircd-hybrid restart

If iptables is used, before you need to write a rule:

sudo iptables -A INPUT -p tcp -m tcp -s 192.168.1.0/24 --dport 6667 -j ACCEPT

This completes the installation and you can proceed with the configuration.
See my article about setting up – Configuring the ircd-hybrid

I’ll also give an example of installing ircd-hybrid from the sources.
Download ircd-hybrid from the official site:

wget http://prdownloads.sourceforge.net/ircd-hybrid/ircd-hybrid-8.2.22.tgz
tar -xvf ircd-hybrid-8.2.22.tgz
cd ircd-hybrid-8.2.22

Install the necessary components:

sudo apt-get install build-essential unzip cmake

Configure and install ircd-hybrid:

./configure --prefix="/home/USER/ircd"
make
make install

You can also install Anope (to extend the functionality):

cd /tmp/
wget https://github.com/anope/anope/archive/2.0.zip
unzip 2.0.zip
cd anope-2.0
./Config
cd build
make
make install

Let’s install the right owner:

sudo chown -R USER: ~/services ~/ircd