Sean Boudreau(deleted)
|
Re: RE: Multicast routing question
|
Sean Boudreau(deleted)
01/17/2009 9:15 AM
post20278
|
Re: RE: Multicast routing question
On Fri, Jan 16, 2009 at 06:41:37PM -0500, Paul Kahn wrote:
> Sean/Robert, thanks both for your replies.
>
> Here are the two tables:
>
> 1) DHCP (Windows DHCP server)
>
> Internet:
> Destination Gateway Flags
> default 192.168.50.1 UG
> localhost.localdo 127.0.0.1 UH
> 192.168.50.0 link#2 U
> 192.168.50.1 00:40:10:13:dd:f5 UH
>
> 2) Fixed IP Address
>
> Routing tables
>
> Internet:
> Destination Gateway Flags
> 10.0.0.0 link#2 U
> localhost.localdo 127.0.0.1 UH
>
>
> I understand I can add a route in the fixed IP configuration. If I have a physical subnet with two computers that use
fixed IP addresses; what do I set for the gateway? The stack appears to need one to register for mutlicast packets.
>
When sending multicast packets the stack has to know
which iface to send it out. You can use the IP_MULTICAST_IF
socket opt like:
{
struct in_addr addr;
const char *iface = "10.0.0.1" /* address of your local iface */
memset(&addr, 0, sizeof(addr));
addr.s_addr = inet_addr(argv[1]);
setsockopt(s, IPPROTO_IP, IP_MULTICAST_IF, &addr, sizeof(addr));
}
Or add a route. You can add one for the specific address
you're sending to, or a default:
# route add 225.0.0.40 10.0.0.2
or
# route add default 10.0.0.2
Where 10.0.0.2 is another machine on your 10.0.0.x subnet.
-seanb
|
|
|