0

I have two network interfaces (e.g. eth0 and eth1) configured as two ends of a bridge in Ubuntu Linux 14.04. They are not assigned with any IP addresses. eth0 is physically connected to a subnet. I want to send UDP packets through eth0 to a subnet connected machine. I create a UDP socket and check that it can successfully bind to eth0 (i.e. setsockopt(socket, SOL_SOCKET, SO_BINDTODEVICE, eth0, strlen(eth0)), and executing sendto() reports success as well. However, the designated target machine cannot receive anything from eth0!!

Is there any Ubuntu tools/commands to trace where the UDP packets go (actually, I did try to use Wireshark. But, Wireshark cannot detect any network interface to capture!)?

And, is there any workarounds, under the situation that eth0 and eth1 must be set as a interconnected bridge with no IP addresses, to make use of eth0 to send UDP packets to other machine with designated IP address and port?

user1133555
  • 103
  • 8
  • What should go in the "sender IP" field in the header of the outgoing packet? The Linux TCP/IP stack isn't being given all the information needed to create a packet, so you'll probably have to write the headers yourself and use a raw socket to transmit. – Ben Voigt Aug 20 '15 at 04:24
  • Ben, would you advise me with references and codes. Thanks a lot. – user1133555 Aug 20 '15 at 04:30
  • Can I hijack the created socket to fill in fake sender IP info? – user1133555 Aug 20 '15 at 04:35
  • Perhaps search for `IP_HDRINCL example` in your favorite search engine? – Ben Voigt Aug 20 '15 at 04:43

0 Answers0