logo banniere

S'il n'y a pas de solution c'est qu'il n'y a pas de problème!


The Masq



Intro

Below, you wil find information and files necessary to masquerade Netmeeting and Directplay (games like Age of Empires) for 2.2.12-16 and 2.2.19 kernels.

You first need standart development tools like a C compiler... you may have to recompile your kernel (for sure, if you want to receive Netmeeting calls behind your Linux box. You are supposed to already have setup masquerade and IP forwarding in your kernel.

Be careful.According to your kernel (2.2.12-16 or 2.2.19) the modules and the possibilities are not the same.
For 2.2.19 kernel, you only need the module ip_masq_h323 and ipmasqadm to send and receive calls behind your linux nat box
For 2.2.12-16, you also need to apply a tiny patch to the kernel in order to receive calls
I have no information for 2.4 kernels.

Netmeeting: receiving calls (jump to next § if you only need to place calls)

All this has been tested with kernel 2.2.14-16
You need experimental options of the kernel:

prompt for development and/or incomplete code/drivers (CONFIG_EXPERIMENTAL=y)
IP masquerading special modules support
IP ipautofw masquerade support (CONFIG_IP_MASQUERADE_IPAUTOFW=y/m)
IP ipportfw masquerade support (CONFIG_IP_MASQUERADE_IPPORTFW=y/m)
IP ipmarkfw masquerade support (CONFIG_IP_MASQUERADE_MFW=y/m)

Before compiling your kernel, read the entire page, you may need more options in your kernel.

You also need ipmasqadm package (glibc2) available here or at http://juanjox.kernelnotes.org/.

Once you have loaded the ip_masq_h323 module (see below), in order to receive calls, you need to enter:

/usr/sbin/ipmasqadm portfw -a -P tcp -L public_ip 1720 -R local_ip 1720
/usr/sbin/ipmasqadm portfw -a -P tcp -L public_ip 1503 -R local_ip 1503

where public_ip is the IP of you Linux gate and local_ip is the ip og the Windows box running Netmeeting. Yoy just have to wait to be called!:)

I have written a small script netmeeting which starts, stop and give the status the forwarding status. It gets the public_ip from "ifconfig". Usage:

netmeeting start local_ip
netmeeting stop
netmeeting status

where local_ip is the IP of the machine running netmeeting.

Receiving calls with 2.2.12-2.2.16 kernels (jump to next § if you use a 2.2.19 kernel or if you just want to place calls)

You need to modify one of the kernel file: /usr/src/linux/net/ipv4/ip_masq_app.c
Begin by making a backup copy of this file!!
Edit the file and find the structure:

struct ip_masq_app * ip_masq_bind_app(struct ip_masq *ms)

        struct ip_masq_app * mapp;

    if (ms->protocol != IPPROTO_TCP && ms->protocol != IPPROTO_UDP)
        return NULL;

        mapp = ip_masq_app_get(ms->protocol, ms->dport);

#if 0000
/* #ifdef CONFIG_IP_MASQUERADE_IPAUTOFW */
    if (mapp == NULL)
        mapp = ip_masq_app_get(ms->protocol, ms->sport);
/* #endif */
#endif

        if (mapp != NULL) {
                /*
                 *    don't allow binding if already bound
                 */

                if (ms->app != NULL) {
                        IP_MASQ_ERR("ip_masq_bind_app() called for already bound object.\n");
                        return ms->app;
                }

                ms->app = mapp;
                if (mapp->masq_init_1) mapp->masq_init_1(mapp, ms);
                ip_masq_app_bind_chg(mapp, +1);
        }
        return mapp;
}

You have to replace it by:

 struct ip_masq_app * ip_masq_bind_app(struct ip_masq *ms)
{
        struct ip_masq_app * mapp;

        if (ms->protocol != IPPROTO_TCP && ms->protocol != IPPROTO_UDP)
                return NULL;

        mapp = ip_masq_app_get(ms->protocol, ms->dport);

#if 0000
/* #ifdef CONFIG_IP_MASQUERADE_IPAUTOFW */
        if (mapp == NULL)
                mapp = ip_masq_app_get(ms->protocol, ms->sport);
/* #endif */
#endif

        if (mapp == NULL)
                /*
                 * paolo 24/10/2000
                 */
                mapp = ip_masq_app_get(ms->protocol, ms->mport);

        if (mapp != NULL) {
                /*
                 *      don't allow binding if already bound
                 */

                if (ms->app != NULL) {
                        IP_MASQ_ERR("ip_masq_bind_app() called for already bound object.\n");
                        return ms->app;
                }

                ms->app = mapp;
                if (mapp->masq_init_1) mapp->masq_init_1(mapp, ms);
                ip_masq_app_bind_chg(mapp, +1);
        }
        return mapp;
}

Vous can get this structure directly here.

Now, compile you kernel. Do not forget to setup a rescue kernel...

Module for 2.2 kernels

A great thanks to www.coritel.it for giving me all the explanations and modules.

I tested the configuration with kernels 2.2.12-16, 2.2.19 and Netmeeting 3.01 and all works OK.
All the setup below is achieved under root account.

The module is not the same according to your kernel.

For 2.2.12-16 kernels, the module source is: ip_masq_h323.c

For 2.2.19 kernel, the module source is: ip_masq_h323.c

Then copy ip_masq_h323.c to /usr/src/linux/net/ipv4.

Edit /usr/src/linux/net/ipv4/Makefile:

M_OBJS += ip_masq_ftp.o ip_masq_irc.o ip_masq_raudio.o ip_masq_quake.o ip_masq_h323.o

I mean that you added ip_masq_h323.o at the end of the line (which has not necessary all these modules on your configuration)

Be sure that modules support and dynamic loading of modules are activated in your kernel.

Then go to a terminal in directory /usr/src/linux and run:

make modules

You should "see" the compilation of ip_masq_h323.o
Then run:

make modules_install

Try to load the module with:

insmod ip_masq_h323

Look for error messages in /var/log/messages and if the module is effectively loaded by lsmod.

There cannot be several Nemeeting sessions at the same time!

Direct Play

I tested the directplay module with 2.2.12-16 kernels.

You need a kernel compiled with masq standart options AND IP masquerade special modules support in Networking options. This option is available with yes to Prompt for development and/or incomplete code/drivers in Code maturity level options.
If this not not the case, you need to compile your kernel.

The module source is ip_masq_dplay-0_3_00.tgz.

Uncompress it:

tar -zxf ip_masq_dplay-0_3_00.tgz

You get a new directory (that you can move for example to /usr/local/src) in which you run make. Then copy the file ip_masq_dplay.o in the directory /lib/modules/2.2.x/ipv4).

You load the module by:

insmod ip_masq_dplay host=local_ip

where local_ip is the adress of the "playinng" machine on the LAN. If it is always the same machine which plays, you can add:

alias dplay ip_masq_dplay
options dplay host=local_ip

to you file /etc/modules.conf (modules.conf on some distributions). Then run:

depmod -a

To unload the module run:

rmmod dplay

to load it run:

modprobe dplay

Good play!


Dernière modification le jeudi 17 avril 2003 à 00:39:32 Paris
Webmaster: TNK
Valid HTML 4.01! Valid CSS! quanta anybrowser suse powered by

linux apache mod_gzip php mysql openssl modssl