Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Dec 1996 19:38:41 -0500 (EST)
From:      Greg Lehey <grog@lemis.de>
To:        henrich@crh.cl.msu.edu (Charles Henrich)
Cc:        hackers@freebsd.org (FreeBSD Hackers)
Subject:   Re: Intelligent source IP's in multinet singlephysicalnet connections?
Message-ID:  <199612130038.TAA00340@papillon.lemis.de>
In-Reply-To: <199612100321.WAA25837@crh.cl.msu.edu> from Charles Henrich at "Dec 9, 96 10:21:08 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
Charles Henrich writes:
> I posted this some months ago, but the suggested "I just fixed it" apparently
> didnt.
>
> On a FreeBSD box with multiple IP addresses, shouldnt FreeBSD pick the source
> IP of a packet of the net that the destination IP address is for (if possible?)
>
> That is, in my case I have an IP address on a standard network class C address,
> as well as an alias in the non-routed 10.x.x.x range.  I have a default route
> for both networks:
>
> e.g.
>
> 10                 link#1             UCSc       11        0
> CLASSC             link#1             UC          0        0
>
> When I send any packets to the 10. addresses, I want my source IP to be my
> aliased 10. Address.  In all other cases I want it to be my normal address.
>
> This is because I have a bunch of devices hanging on the 10. network that I
> want to talk to, and who can only communicate to other devices on the 10.
> network.  The kicker is this works under Win95 if I define multiple networks
> for myself..

I'm not sure that I understand what you're saying here, but what I
think you're saying is: when sending a local packet (i.e.  a packet
that originates on my machine), the source IP address should be the
source IP address of the interface on which the packet leaves the
machine.  For example, assume you have two interfaces:

ep0	  192.168.0.1	    (default)
ep1	  10.0.0.1	    (for net 10)

All locally generated packets which leave on ep0 will have the source
address 192.168.0.1, and those which leave on ep1 will have the source
address 10.0.0.1.  Of course, if the packets are being routed, their
source address remains unchanged.

Does this answer your question?  Is it what you want?  

Greg




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199612130038.TAA00340>