Subject: Re: ifconfig alias and routing
To: Zafer Aydogan <zafer@gmx.org>
From: David Maxwell <david@vex.net>
List: netbsd-users
Date: 12/20/2004 12:15:31
On Mon, 20 Dec 2004, Zafer Aydogan wrote:
> if I enable packet forwarding (net.inet.ip.forwarding=1)
> and use a second ip for the machine via alias (ifconfig ex0 192.168.0.222
> alias) beside his originial ip which is 192.168.0.111,
> then traceroute shows only 192.168.0.111 instead of 192.168.0.222.
> Everything works fine, but I'd like to see 222 in traceroute :/
>
> $ traceroute netbsd.org
> traceroute to netbsd.org (204.152.190.12), 64 hops max, 40 byte packets
> 1 ns1 (192.168.0.111) 0.500 ms 0.447 ms 0.379 ms
> 2 gw.sst.net (192.168.0.33) 1.307 ms 1.329 ms 1.295 ms
> 3 ge-0.decix.frnkge03.de.bb.verio.net (80.81.192.46) 32.033 ms 32.929 ms
> 31.332 ms
> 4 ge-0-1-0.r01.frnkge02.de.bb.verio.net (129.250.5.38) 32.072 ms 54.435
> ms 34.895 ms
> 5 *
>
> The first hop should show "maingate (192.168.0.222) ...."
NetBSD selects an address on the outbound interface as the local, or
'source' address.
I'm not sure what the selection criteria are. I'd guess that it prefers
the primary address.
If you want the traceroute to read 0.222, try making 0.222 the primary
address, and 0.111 an alias.
--
David Maxwell, david@vex.net|david@maxwell.net -->
Net Musing #5: Redundancy in a network doesn't mean two of everything and
half the staff to run it.
- Tomas T. Peiser, CET