Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 26 Oct 2002 23:03:31 +0200
From:      Robert Staflin <krs@canit.se>
To:        freebsd-net@FreeBSD.ORG
Subject:   Choosing interface for a destination
Message-ID:  <61AA1726-E926-11D6-B166-00039304172A@canit.se>

next in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?61AA1726-E926-11D6-B166-00039304172A>