UDP tx interface problem
I am new to Ubuntu and have installed version 9.04.
I am trying to transmit UDP data from one computer to another. The transmitting computer has three interface cards. I can transmit data from the main interface (eth0) but not eth1, which is the one I would like to use. I have set the interfaces file up as follows: -
iface eth0 inet static
hwaddress ether 00:10:18:2b:4a:83
iface eth1 inet static
hwaddress ether 00:18:f3:f9:3e:0e
iface eth2 inet static
hwaddress ether 00:18:f3:f9:3e:e7
iface lo inet loopback
And the code I am using to set up the socket is: -
int create_udp_socket(int port)
struct sockaddr_in host_address;
s=socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP);
if (s < 0)
memset((void*)&host_address, 0, sizeof(host_address));
host_address.sin_addr.s_addr=inet_addr("10.10.27.1 "); /*Interface IP being used*/
if (bind(s, (struct sockaddr*)&host_address, sizeof(host_address)) < 0)
Can anyone see where I'm going wrong?
Thanks in advance!
Tags for this Thread