From owner-freebsd-net Sat Oct 26 5:45:10 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 3CB4437B401 for ; Sat, 26 Oct 2002 05:45:05 -0700 (PDT) Received: from tninet.se (sheridan.tninet.se [195.100.94.102]) by mx1.FreeBSD.org (Postfix) with ESMTP id C99BC43E65 for ; Sat, 26 Oct 2002 05:45:03 -0700 (PDT) (envelope-from krs@canit.se) Received: from canit.se (h72n5c1o1026.bredband.skanova.com [217.209.176.72]) by sheridan.tninet.se (BMR ErlangTM/OTP 3.0) with ESMTP id 756662.636300.1035.1s415094sheridan for ; Sat, 26 Oct 2002 14:45:00 +0200 Date: Sat, 26 Oct 2002 14:45:00 +0200 Subject: Re: Choosing interface for a destination Content-Type: text/plain; charset=ISO-8859-1; format=flowed Mime-Version: 1.0 (Apple Message framework v546) From: Robert Staflin To: freebsd-net@FreeBSD.ORG Content-Transfer-Encoding: quoted-printable In-Reply-To: <61AA1726-E926-11D6-B166-00039304172A@canit.se> Message-Id: 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 It really was a newbie question - sorry for the bandwidth. If anyone=20 else wonders, email me and I'll help! /Robert Staflin On l=F6rdag, okt 26, 2002, at 23:03 Europe/Stockholm, Robert Staflin=20 wrote: > I'm developing an application to set the interface to use for=20 > different IP addresses, e.g. if I want to use a modem to talk to=20 > certain "protected" nets while using the ordinary ethernet port for=20 > web access a.s.o. > > I've wracked my head for two days now, trying different ways of making=20= > "route" do the job, to no avail. At the moment I'm running with the=20 > ethernet card (en0) as 192.168.0.2 and a wlan card (en1) as=20 > 192.168.0.5. Now, I want to reach the address 192.168.0.3 through en1=20= > 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.=20= > Netstat -r gives me (no change after adding the above route): > > Routing tables > > Internet: > Destination Gateway Flags Refs Use Netif=20 > 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 =20= > 765 > localhost UHS 0 47 lo0 > 0:50:e4:30:7a:71 UHLW 0 54 en0 =20= > 324 > localhost UHS 0 0 lo0 > > I've only tried this in Windows before, so please bear with me if I=20 > 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 > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D KRS Consulting =20 Robert Staflin Jenny Linds v=E4g 75 Tel: +46 (18)=20 369425 S-756 50 UPPSALA Mobile: +46 (708) 369578 SWEDEN To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message