Configure and test ipv4 multicast routes in RHLinux

Source: Internet
Author: User
Configure and test ipv4 multicast routes in RHLinux-Linux Enterprise Application-Linux server application information. For details, refer to the following section. I. Test Environment
1. Network Topology
Vswitch
Internet route
Eth1 eth0

(Sorry, the network topology cannot be posted)
IP Address Allocation: (configure in a linux image)
Eth1: 202.198.a. B // Internet portal
Eth0: 192.168.0.1 // intranet egress
Host1: 192.168.0.2 // host in the subnet
Host2: 192.168.0.3 // host in the subnet
2. External access
Here we use a simple NAT (refer to the LAN construction content), so that the Intranet can access the Internet.
Add the following content to/etc/rc. local:

Echo "1">;/proc/sys/net/ipv4/ip_forward // enable the forwarding function
/Sbin/modprobe ip_tables // load the corresponding kernel filter module
/Sbin/modprobe iptable_filter
/Sbin/modprobe iptable_nat
/Sbin/modprobe ip_conntrack
/Sbin/modprobe ip_conntrack_ftp
/Sbin/modprobe ip_nat_ftp
Iptables-a postrouting-t nat-s 192.168.0.0/24-o eth1-j SNAT -- to-source 202.198.a. B
Save files
Chmod + x/etc/rc. local
Execution file/etc/rc. local
Test LAN:
On host1: ping 192.168.0.2
Ping 192.168.0.1
Ping 202. 198 .. a.254 // The route gateway address. This step indicates that the configuration is successful.

Our network can work well, but we still don't know about multicast. Next, let's let it work for our multicast.


2. Configure multicast routes
1. software requirements:
Mrouted3.9beta3
Ftp://ftp.rge.com//pub/communica... ed-3.9-beta3.tar.gz
Mrouted Linux patch:
Ftp://ftp.debian.org/debian/dist... 3.9-beta3-1.diff.gz
2 kernel requirements:
Linux Kernel (My rh9 2.4.20) does not need to be re-compiled to change the kernel.
Select the following items
Networking options --->;
IP: multicasting
IP: advanced router
IP: multicast routing
PIM-SM version 1 support
PIM-SM version 2 support
3. Install mrouted:
Assume that your file is downloaded to the/tmp directory.
Cd/usr/src
Tar xvzf/tmp/mrouted-3.9-beta3.tar.gz
Gunzip/tmp/mrouted_3.9-beta3-1.diff.gz | patch-p0
Output result
Patching file 'mrouted-3.9-beta3.orig/Makefile'
Patching file 'mrouted- 3.9-beta3.orig/defs. H'
Patching file 'mrouted- 3.9-beta3.orig/pathnames. H'
Patching file 'mrouted- 3.9-beta3.orig/debian/init. d'
Patching file 'mrouted- 3.9-beta3.orig/debian/changelog'
Patching file 'mrouted- 3.9-beta3.orig/debian/copyright'
Patching file 'mrouted-3.9-beta3.orig/debian/dirs'
Patching file 'mrouted- 3.9-beta3.orig/debian/control'
Patching file 'mrouted-3.9-beta3.orig/debian/rules'
Patching file 'mrouted-3.9-beta3.orig/debian/README. debian'
Patching file 'mrouted- 3.9-beta3.orig/igmp. I'
Patching file 'mrouted-3.9-beta3.orig/netinet/ip_mroute.h'
Patching file 'mrouted- 3.9-beta3.orig/vers. c'
Cd mrouted *
This software is applied in FreeBSD. We need to modify it before we can use it here.
998: fprintf (stderr, "% 02d: % 02d: % 02d. % 03ld % s", thyme->; tm_hour,
999: thyme->; tm_min, thyme->; tm_sec, now. TV _usec/1000, msg );
Modify:
998: fprintf (stderr, "now: % s ",
999: msg );
Make
Here mrouted installation is complete.
4. mroute configuration file
After the installation is complete, create the file/etc/mrouted. conf and add the following content. We can also use the default configuration.

Phyint eth0 rate_limit 0 igmpv1
Phyint eth1 rate_limit 0 igmpv1
Here you can add more configuration information. The above two statements indicate that mrouted uses igmpv1 on the eth0 and eth1 interfaces, and the rate limit is 0, currently, both igmpv1 and igmpv2 are supported in linux, but we can test whether v2 works here.

5. Configure static routes:
Route add? Net 224.0.0.0 netmask 240.0.0.0 dev eth0
Here, eth0 is the egress of multicast data. You can modify it as needed.
Start mrouted
Mrouted? C/etc/mrouted. conf? D

You can add the startup to/etc/rc. local.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.