From owner-freebsd-questions Wed Nov 6 19:30: 4 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8CD3A37B401 for ; Wed, 6 Nov 2002 19:30:02 -0800 (PST) Received: from web40702.mail.yahoo.com (web40702.mail.yahoo.com [66.218.78.159]) by mx1.FreeBSD.org (Postfix) with SMTP id 3F1E143E75 for ; Wed, 6 Nov 2002 19:30:02 -0800 (PST) (envelope-from alirezamahini@yahoo.com) Message-ID: <20021107033002.47061.qmail@web40702.mail.yahoo.com> Received: from [217.218.29.96] by web40702.mail.yahoo.com via HTTP; Wed, 06 Nov 2002 19:30:02 PST Date: Wed, 6 Nov 2002 19:30:02 -0800 (PST) From: alireza mahini Subject: How can i use multiple ethernet card for data transfer in my program( in C language)? To: questions@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG I have two ethernet card(NIC)im my computer .Their characteristics are: name:rl0 ip:128.128.64.235 netmask:255.255.0.0 broadcast:128.128.255.255 name:rl1 ip:128.128.65.235 netmask:255.255.0.0 broadcast:128.128.255.255 Both of them is up when i use ifconfig command. I want develop a program that can use rl0 and rl1 for data communication.My code is similar as flow: main(){ ... for(i=0;i<3,i++){ sd[i]=socket(...);//create DGRAM sockets if (sd[i]==-1) return -1; } bind(sd[0],...);//bind sd0 to ip address of rl0 bind(sd[1],...);//bind sd1 to ip address of rl0 bind(sd[2],...);//bind sd2 to ip address of rl1 bind(sd[3],...);//bind sd3 to ip address of rl1 sendto(sd[0],...);//send form rl0 to remout host1 sendto(sd[2],...);//send from rl1 to remout host2 recvfrom(sd[1],...);//receive in rl0 recvfrom(sd[3],...);//receive in rl1 return 1; } In the first time when i executed my program all data sent form rl0 ,in other word packets of rl1 and packets of rl0 were sent by rl0; So i use the route command as flow: #route add [remout host2]-interface rl1 In this case data of rl1 weren't sent by rl0 but rl1 didn't send data too. please guide me .Thanks. __________________________________________________ Do you Yahoo!? U2 on LAUNCH - Exclusive greatest hits videos http://launch.yahoo.com/u2 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message