Subject: Re: ifconfig alias and routing
To: Zafer Aydogan <email@example.com>
From: David Maxwell <firstname.lastname@example.org>
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 (18.104.22.168), 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 (22.214.171.124) 32.033 ms 32.929 ms
> 31.332 ms
> 4 ge-0-1-0.r01.frnkge02.de.bb.verio.net (126.96.36.199) 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
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, email@example.comfirstname.lastname@example.org -->
Net Musing #5: Redundancy in a network doesn't mean two of everything and
half the staff to run it.
- Tomas T. Peiser, CET