From owner-freebsd-net Fri Oct 25 14: 3:18 2002 Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3632837B401 for ; Fri, 25 Oct 2002 14:03:17 -0700 (PDT) Received: from tninet.se (lennier.tninet.se [195.100.94.105]) by mx1.FreeBSD.org (Postfix) with ESMTP id 08BCC43E42 for ; Fri, 25 Oct 2002 14:03:15 -0700 (PDT) (envelope-from krs@canit.se) Received: from canit.se (h72n5c1o1026.bredband.skanova.com [217.209.176.72]) by lennier.tninet.se (BMR ErlangTM/OTP 3.0) with ESMTP id 96709.579794.1035.0s123004lennier for ; Fri, 25 Oct 2002 23:03:14 +0200 Date: Sat, 26 Oct 2002 23:03:31 +0200 Mime-Version: 1.0 (Apple Message framework v546) Content-Type: text/plain; charset=US-ASCII; format=flowed Subject: Choosing interface for a destination From: Robert Staflin To: freebsd-net@FreeBSD.ORG Content-Transfer-Encoding: 7bit Message-Id: <61AA1726-E926-11D6-B166-00039304172A@canit.se> X-Mailer: Apple Mail (2.546) Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org I'm developing an application to set the interface to use for different IP addresses, e.g. if I want to use a modem to talk to certain "protected" nets while using the ordinary ethernet port for web access a.s.o. I've wracked my head for two days now, trying different ways of making "route" do the job, to no avail. At the moment I'm running with the ethernet card (en0) as 192.168.0.2 and a wlan card (en1) as 192.168.0.5. Now, I want to reach the address 192.168.0.3 through en1 instead of en0. If I try i.e. route -n add -host 192.168.0.3 -interface 192.168.0.5 no traffic at all gets through, and I have to delete the route again. Netstat -r gives me (no change after adding the above route): Routing tables Internet: Destination Gateway Flags Refs Use Netif Expire default UGSc 13 137 en0 localhost localhost UH 12 56901 lo0 169.254 link#4 UCS 0 0 en0 192.168.0 link#4 UCS 2 0 en0 0:5:5d:dc:33:3c UHLW 13 0 en0 765 localhost UHS 0 47 lo0 0:50:e4:30:7a:71 UHLW 0 54 en0 324 localhost UHS 0 0 lo0 I've only tried this in Windows before, so please bear with me if I seem like a total newbie! Thanks for any help! /Robert Staflin To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message