Date: Sat, 26 Oct 2002 14:45:00 +0200 From: Robert Staflin <krs@canit.se> To: freebsd-net@FreeBSD.ORG Subject: Re: Choosing interface for a destination Message-ID: <BDD9A576-E8E0-11D6-B088-00039304172A@canit.se> In-Reply-To: <61AA1726-E926-11D6-B166-00039304172A@canit.se>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?BDD9A576-E8E0-11D6-B088-00039304172A>