Subject: Re: default route and private networks
To: None <tech-net@NetBSD.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: tech-net
Date: 04/26/2005 03:22:44
>> That's almost, but not quite, what is needed here. If you specify
>> -ifa, the packet is sent out on that interface. We want to send on
>> interface A while using some address from interface B.
> Do we necessarily want that? I'd be happy with going out an
> interface that that address is on.
I don't know about "we", but yes, I want exactly that. In fact, I'm
using it right now on my house gateway (but see below).
Specifically, to give real addresses: my house network is
216.46.5.0/28. My uplink is 216.46.14.122/30. My house gateway is
216.46.5.9 on le0 and 216.46.14.122 on qe0. My default route needs to
point, effectively, to 216.46.14.121 on qe0, so packets for the world
get sent to my upstream. But when the gateway initiates traffic, I
want it to use 216.46.5.9 as the ip_src, even if the traffic is to
somewhere out in the world rather than on the house LAN.
Someone sketched here, upthread, a very similar situation where my
uplink /30 was replaced by a chunk of RFC1918 private space and thus
the admin even more strongly needs the ip_src to be the "wrong"
address.
As I remarked, I'm using this right now. I'm achieving it with a
kludge involving a pseudo-interface rather than routing table
jiggery-pokery; if anyone wants, I can go into more detail.
> Another optioon would be that the -ifa and -ifp parameters could both
> be set such that we indicate we use address X out iface Y, when
> address X is on iface Z.
If that worked, it would be just about perfect for my use.
> The cases when we'd want to go out address A but with an addr on B
> are all ones where, AFAICT, we have a defined source address already.
If I correctly understand what you mean by "defined source address",
this is not so in my case. I want connections from unbound TCP sockets
to the world, for example, to use 216.46.5.9, not 216.46.14.122.
/~\ The ASCII der Mouse
\ / Ribbon Campaign
X Against HTML mouse@rodents.montreal.qc.ca
/ \ Email! 7D C8 61 52 5D E7 2D 39 4E F1 31 3E E8 B3 27 4B