Re: UDP broadcast source address when > 1 NIC



"Dave Lowther" <davel@xxxxxxxxx> wrote
> My PC (XP Pro SP2) has two Ethernet interfaces, 10.0.0.6 and
> 192.168.0.200, both IPs are static.
>
> When I broadcast a UDP datagram using sendto() and a destination of
> 255.255.255.255, it sends the UDP datagram out on both Ethernet interfaces
> which is what I wanted.
>
> Unfortunately it uses the same IP source address (192.168.0.200) on both
> interfaces, which isn't what I wanted.

I'd still like to know whether the above is expected behaviour or not ?

Since my OP I've implemented a solution like this which works fine but seems
over complicated:
o Enumerate the network interfaces and make a list of all IP (addresses,
masks) on the PC
o From the above list, make a list of subnet broadcast addresses and remove
any duplicates
o Do a sendto() for each subnet broadcast address in the above list.

Now my broadcasts get sent with the 'correct' source IP address and the
receivers can reply ok.

Dave.


.



Relevant Pages

  • UDP broadcast source address when > 1 NIC
    ... it sends the UDP datagram out on both Ethernet interfaces ... interfaces, ... I expected it to send the broadcast from the 10.0.0.6 interface with a ... The receiver of my broadcast uses recvfromand then sendto() to send a ...
    (microsoft.public.win32.programmer.networks)
  • Re: UDP broadcast source address when > 1 NIC
    ... >> When I broadcast a UDP datagram using sendtoand a destination of ... it sends the UDP datagram out on both Ethernet ... >> interfaces, ... > o Do a sendto() for each subnet broadcast address in the above list. ...
    (microsoft.public.win32.programmer.networks)
  • Re: Odd routing problem
    ... >practice serves only the wireless connection for my son. ... broadcast ntp udp packets for 192.168.1 ... particular if ntpd was restarted while xl0 was down and hasn't been ... address is for the respective interfaces. ...
    (comp.unix.bsd.freebsd.misc)
  • Re: single host netmask (255.255.255.255)
    ... The routes from three interfaces, propagate via OSPF to the rest of network.... ... One way is to remember IP addresses assigned to each interfaces, but more smart solution is to assign to this machine one EXTERNAL LOOPBACK address (single IP with mask 255.255.255.255, in other words SINGLE HOST assigned to Microsoft loopback adapter), and propagate this address ... The address 255.255.255.255 denotes a broadcast on a local hardware network, ...
    (microsoft.public.win2000.networking)
  • Re: how to disallow nis-client to broadcast on certain interfaces
    ... Did you look at implementing NIS securnets by using the file ... how to disallow nis-client to broadcast on certain interfaces ...
    (AIX-L)

Loading