Configuring Linux to Support Multicast IP

来源:互联网 发布:淘宝网床单 编辑:程序博客网 时间:2024/05/22 21:51
Most Linux systems have multicast IP capability turned off by default. In order to use multicast sockets on my Linux system, I had to reconfigure and build my kernel, and then run the following command as root after re-booting:
route add -net 224.0.0.0 netmask 240.0.0.0 dev lo
Make sure that this route has been added by typing
route -e
You should see output like this:
markw@colossus:/home/markw > su
Password:
markw # route add -net 224.0.0.0 netmask 240.0.0.0 dev lo
colossus:/home/markw # route -e
Kernel IP routing table
Destination   Gateway   Genmask    Flags   MSS Windowirtt Iface
loopback      *         255.0.0.0  U      3584 0          0 lo
224.0.0.0     *         240.0.0.0  U      3584 0          0 lo
markw #
Please note that I ran the route commands as root. I don’t permanently add this route for multicasting to my Linux development system; rather, I manually add the route (as root) when I need to use multicast IP. Re-configuring and building the kernel is also fairly simple. On my Linux system, I use the following steps to configure and build a new kernel with multicast IP support:
1. cd /usr/src/linux
2. make menuconfig
select networking options
check the box labeled “enable multicast IP”
save and exit from menuconfig
3. make dep; make clean; make zImage
4. cp /vmlinux /vmlinux_good
5. cp arch/i386/boot/zImage /vmlinux
6. cd /etc
7. edit lilo.conf, adding a new entry for the /vmlinux_good kernel
8. lilo